Notice
Recent Posts
Recent Comments
Link
«   2025/07   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31
Tags more
Archives
Today
Total
관리 메뉴

테드옹의 VFX

까먹으면 안되는 테크닉들 본문

Houdini

까먹으면 안되는 테크닉들

Tedd_Kim 2021. 12. 14. 21:59

[ Solver를 이용하여 infect, spread 어트리뷰트를 설정하기 ]

 

1. Scatter를 이용하여 포인트화 시키기

2. 원하는 시작점을 임의로 선택하여 split노드를 사용해서 구분

 

@group_spread = 1;

 

wrangle의 종류에 따라서 point그룹이나 prim그룹을 "생성"하거나 편입시키는 라인 (!!!!!!!까먹지좀 마라!!!!!!!)

3. 두 개의 아웃풋을 merge하여 i@spread = 0; 라인을 통하여 변수를 생성 및 초기화

4. solver의 prev_frame노드를 인풋으로 하여 작업

 

if(inpointgroup(0, "srepad", @ptnum)) {
    i@spread = 1;
    int arr[] = pcfind(0, "P", @P, float radius, int max_pts);
    
    foreach(int pt; arr) {
    	setpointgroup(0, "spread", pt, 1, "set"); // 서치한 포인트들을 spread그룹에 넣음
    }
}

 

[ Constaints를 SOP에서 프리뷰 하는 방법 ]

 

1. Geometry Data Path주의, 하단에 Transform관련 체크박스 주의

2. broken그룹을 blast노드로 삭제

3. tranformpieces노드를 사용하여 모션 프리뷰 가능

 

+) 보너스 SOP solver에서 DOP 시뮬레이션 프리뷰

 

 

[ DOP의 geometry데이터를 가져오는 방법 ]

 

stamps(stamp_op_path, token, value)

scope : 값을 가져올 노드의 경로

token : 가져올 값의 변수명

value : token이 존재하지 않을 때 사용할 문자열

ex) stamps("../copydata1", "name", "defaultname") -> copydata1노드의 name값을 가져오고, 존재하지 않으면 defaultname이란 값을 사용해라

 

`stamps("..", "DATAPATH", chsop("relnode") + 

":Relationships/" + 

chs(chsop("relnode") + "/relname") + 

"/" + 

chs(chsop("relnode") + "/relationship/dataname") + 

"/Geometry")`

 

/obj/geo2/dopnet2/constraintnetwork1:Relationships/constraintnetwork1/constraintnetwork/Geometry

여기서 가장 중요한 부분은 콜론(:)이다. 이 콜론의 의미는 DOP geometry데이터를 불러오겠다는 수식

 

 

[ Rigidboysolver의 pre-solve인풋에서 constraints를 깨는 방법 ]

 

1. Constraints Network노드의 Relationship탭에서 Attach.... 체크박스에 체크한다

2. pre-solve에 SOP solver를 붙이고 Data Name을 바꾼다 (웬만하면 ConstraintGeometry로). SOP Output is in Simulation space 체크해제, Unique data name 체크

3. 혹은 Geometry wrangle의 Data binding 탭에서 ConstraintGeometry를 적어넣는다

 

[  정지프레임에서 life와 death attribute를 정하는 법 ]

 

life를 정한 다음 start난수를 구하고 active를 계산하는 방법

굳이 solver나 시뮬레이션을 진행하지 않고 primitive나 point마다 life를 계산할 수 있는 방법이다

특히 Line생성하여 애니메이션을 줄 때 유용

float seed = detail(1, "iteration", 0); //각 반복의 iteration을 시드값으로 하여 난수 생성
@__rand = floor(fit01(rand(seed), 0.5, 1)) * chi("max_life"); // 선형보간을 할 때,
//value의 범위가 너무 뭉개지는 것을 방지하기 위하여 최솟값을 0.5로 설정하고, 원하는 최대 life만큼 숫자 곱셈

i@__life = fit(@__rand, chi("max_life")*0.5, chi("max_life"), chi("min_life"), chi("max_life")+1);
i@__temp = chi("last_frame") - chi("first_frame") - chi("max_life"); // 마지막에 max_life뺄셈은 여유프레임을 남기기 위하여
i@__start = rand(@ptnum) * @__temp + chi("first_frame"); //프레임 범위만큼 선형적으로 난수 생성

i@active = int(@Frame) - @__start; // 이 값이 음수면 아직 start프레임에 다다르지 않는 것

 

'Houdini' 카테고리의 다른 글

후디니, 서브스턴스 페인터 워크플로우  (2) 2022.01.13
서브스턴스 디자이너 필기  (0) 2022.01.12
Constraints  (2) 2021.12.12
point cloud  (0) 2021.12.06
그래픽스 이론 관련  (0) 2021.11.27