Skip to content

Instantly share code, notes, and snippets.

@yamadaaaaaaa
Last active March 6, 2018 00:16
Show Gist options
  • Save yamadaaaaaaa/ac128a66e42606e6c0f5ea7e7da23fdb to your computer and use it in GitHub Desktop.
Save yamadaaaaaaa/ac128a66e42606e6c0f5ea7e7da23fdb to your computer and use it in GitHub Desktop.
search node for houdini
import hou
import re
_node = hou.node('/obj/geo1/')
# 選択ノード指定でやりたいときはこっち
'''
_nodes = hou.selectedNodes()
if len(_nodes) != 0:
_node = oNodes[0]
'''
# 指定ノード以下の子を処理
_children = _node.children()
for child_item in _children:
# materialと名の付くノード以外は無視
if not re.search("material",child_item.name()):continue
# 更にlambertと名の付くパラメーター以外は無視
if not re.search("lambert",child_item.parm("shop_materialpath1").eval()):continue
print "<" + child_item.name() + '>' + child_item.parm("shop_materialpath1").eval()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment