No More Retake

3DCG屋さん向けTips&Referenceサイト

メニュー

Houdiniレシピ:Wrangle Memo 02

Houdini回。
Wrangle(SOP)のVEX例文。メモより抜粋、その2。
その1はこちら

Wrangle02_01a

入力を取得

@OpInput1  //1番目の入力
@OpInput2  //2番目の入力
@OpInput3  //3番目の入力
@OpInput4  //4番目の入力

 

アトリビュートを取得とか

#1番目の入力のdensityを取得
density = findattribval( @OpInput1, "primitive", "name", "density");
#ついでにvolumesample
volumesample_density = volumesample(@OpInput1, density, @P);

 

wrangleでrampを使う

Wrangle02_02

ざっくり手順をば!
まず、rampのGUIを先に作っとく。
wrangle記述の方で、rampで使う値を0~1のレンジで作成。
それをrampに適応。
出てきた値を使う。

「例」

float airresist = 0;
float range = fit(@P.y, 0,-10, 0, 1);
float rampVal = chramp("ramp", range);

airresist = rampVal*0.1;

 

foreach

pythonのfor~in文に相当するもの(・・・たぶん)

int list[]; 
int item;
int count = 0;
foreach(int val; list)
{
    if (item == val) return count;
    count++;
}

 

接続しているポイントの数を取得

for(int i=1; i<@numpt; i++){
    i@ptCount = neighbourcount(0, @ptnum);
}

 

ちょっと少ないけど以上!
間違い等ありましたら、ご指摘を!

関連記事

コメントをお待ちしております

このサイトについて

3DCG Tipsサイト。Houdiniの記事が多めです。

RSS

follow us in feedly

Archives

  • 2024 (1)
  • 2023 (2)
  • 2022 (9)
  • 2021 (14)
  • 2020 (46)
  • 2019 (17)
  • 2018 (33)
  • 2017 (29)
  • 2016 (36)
  • 2015 (64)
  • 2014 (54)
  • 2013 (60)
  • 2012 (55)

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

スポンサードリンク

言語切り替え

  • English (United States)
  • 日本語

Houdiniを使えるようになる本


Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.facebook.com/restserver.php?method=links.getStats&urls=http%3A%2F%2Fnomoreretake.net%2F2016%2F04%2F20%2Fhoudini_wrangle-memo-02%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(): Failed to enable crypto in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132

Warning: file_get_contents(http://api.b.st-hatena.com/entry.count?url=http%3A%2F%2Fnomoreretake.net%2F2016%2F04%2F20%2Fhoudini_wrangle-memo-02%2F): failed to open stream: operation failed in /usr/home/nomorere/nomoreretake.net/wordpress/wp-content/themes/n1-custom/functions/social.php on line 132