No More Retake

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

メニュー

Houdini:Dissable When/Hide When (Edit Parameter Interface)

Houdini回。
地味な奴です。
Edit Parameter interfaceの”Disable When”と”Hide When”のところの条件文の書き方。
毎回、忘れるので。

Parameter_01

マニュアル曰く、”コンディショナルルール”と言うそうです。
構文は以下のとおり。

{ parm_name operator value ...}

大括弧{ }で条件文を囲うらしい。
条件がTureになれば、そのパラメータが無効、または非表示になる。
大括弧{ }の中に複数条件を書くと&(and)の意味、大括弧{ }を複数書くと|(or)の意味になる。

{ toggle == 1 value > 0 } { tolerance < 0.1 }

上記の条件だと、
「toggleパラメータが1、且つvalueパラメータが0より大きい」または、「toleranceパラメータが0.1より小さい」
という条件を満たしたときに、パラメータが無効/非表示になる。

注意事情として、オペレータ(==とか>とか)の前後にスペースが必ず必要らしい。それがないと動かない。

例として、ToggleボタンのON/OFFでパラメータの有効/無効を切り替えてみます。

Parameter_01

LabelAの方は”Disable When”は

{ toggleA == 1 toggleB == 1 }

とし、LabelBの方は”Hide When”に

{ toggleA == 1 } { toggleB == 1 }

と書きました。

これで、LabelAの方はtoggleAとBの両方がOFFの場合にDisableになり、LabelBの方はtoggleAとBのどちらかがOFFの時にHideされます。


 

あと、使える関数があるらしいです。

ninputs()・・・Inputに接続された場所の番号

hasinput(0)・・・指定した入力番号に入力があるか否か。

これらを使うと、入力接続の有無でパラメターの有効/無効、表示/非表示を切り替えられる。

作ってみた!

Parameter_02

LabelCの”Disable When”に下記の条件を書いた。3番目の入力以降に接続されると無効になる。

{ ninputs() > 2 }

LabelDの”Disable When”に下記の条件を書いた。2番目の入力に接続されると無効になる。

{ hasinput(1) == 1 }

サンプルファイル Parm.hiplc


あと、コンディショナルルールではエクスプレッションは利用できないが、エクスプレッションを含む他のパラメータを参照することで、間接的にエクスプレッションを利用することができるらしい。

 

 

以上!
間違いありましたらご指摘を!

関連記事

  1. 2017.08.17

    Houdini:MoebiusRing
  1. Abe 2016.07.02 1:07pm

    hasinputとninputsが使えるの知りませんでした。ナイスな情報、ありがとうございます。

    • 0
    • 0
    • kitagawa 2016.07.05 12:58am

      こちらこそ、コメントありがとうございます。励みになります。

      • 0
      • 0

このサイトについて

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%2F07%2F02%2Fhoudini_dissable-whenedit-parameter-interface%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%2F07%2F02%2Fhoudini_dissable-whenedit-parameter-interface%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