Hi
I want to find a node (in children of a geometry) that it's flag is set to “Render Flag”.
So, according to these doc pages :
http://www.sidefx.com/docs/houdini/hom/hou/Node.html#findNetworkBox [www.sidefx.com]
and
http://www.sidefx.com/docs/houdini/hom/hou/nodeFlag.html [www.sidefx.com]
I put these codes in my Python script but it doesn't work :
Python: is node's flag set to Render?
3518 2 0- Masoud
- Member
- 414 posts
- Joined: Aug. 2015
- Offline
- huey_yeng
- Member
- 69 posts
- Joined: Nov. 2016
- Offline
You cannot directly iterate a tuple/list with the children() method. Instead you need to process it again with a loop.
Not very elegant but does the job.
import hou a = hou.selectedNodes() for each in a: c = each.children() for n in c: p = n.path() node = hou.node(p) type = hou.nodeFlag.Render flag = node.isGenericFlagSet(type) print (p + " Render Flag is " + str(flag))
Not very elegant but does the job.
/obj/geo2/sphere1 Render Flag is False
/obj/geo2/tube1 Render Flag is True
/obj/geo2/box1 Render Flag is False
/obj/geo1/sphere1 Render Flag is True
/obj/geo1/tube1 Render Flag is False
/obj/geo1/box1 Render Flag is False
- Masoud
- Member
- 414 posts
- Joined: Aug. 2015
- Offline
-
- Quick Links