Couple of basic pyhton questions
26411 48 1- graham
- Member
- 1914 posts
- Joined: Nov. 2006
- Offline
- Soothsayer
- Member
- 864 posts
- Joined: Oct. 2008
- Offline
Great that works. There is a minor problem with the layout if I use a folder.
What is going on there???
obj = hou.node(“/obj”)
camera_node = obj.createNode(“cam”, “my_camera”)
hou_node = camera_node
myTemplate = hou.FloatParmTemplate( “myparm”, “My Parm”, 1, default_value), naming_scheme=hou.parmNamingScheme.Base1, disable_when=“”)
hou_node.addSpareParmTuple( myTemplate, in_folder“Convert”), create_missing_folders=True)
What is going on there???
obj = hou.node(“/obj”)
camera_node = obj.createNode(“cam”, “my_camera”)
hou_node = camera_node
myTemplate = hou.FloatParmTemplate( “myparm”, “My Parm”, 1, default_value), naming_scheme=hou.parmNamingScheme.Base1, disable_when=“”)
hou_node.addSpareParmTuple( myTemplate, in_folder“Convert”), create_missing_folders=True)
--
Jobless
Jobless
- Anonymous
- Member
- 678 posts
- Joined: July 2005
- Offline
- graham
- Member
- 1914 posts
- Joined: Nov. 2006
- Offline
Yeah, what Swann said. The in_folder argument expects a tuple of folder names to specify exactlly which folders/sub folders to insert the parameter in. For example, in_folder'Render', ‘Shading’) would put your parameter in the Render->Shading folder on an Geometry node.
Graham Thompson, Technical Artist @ Rockstar Games
- Soothsayer
- Member
- 864 posts
- Joined: Oct. 2008
- Offline
- graham
- Member
- 1914 posts
- Joined: Nov. 2006
- Offline
- Soothsayer
- Member
- 864 posts
- Joined: Oct. 2008
- Offline
- graham
- Member
- 1914 posts
- Joined: Nov. 2006
- Offline
hou.Color takes a tuple of rgb values for the constructor.
col = hou.Color((0.6, 0.1, 0.1))
mynode.setColor(col)
I highly recommend looking in the *toolutils.py modules in $HH/scripts/python to see good examples of a lot of common operations like these. A lot of the stuff has comments and it can be interesting to see what Houdini is doing under the hood.
col = hou.Color((0.6, 0.1, 0.1))
mynode.setColor(col)
I highly recommend looking in the *toolutils.py modules in $HH/scripts/python to see good examples of a lot of common operations like these. A lot of the stuff has comments and it can be interesting to see what Houdini is doing under the hood.
Graham Thompson, Technical Artist @ Rockstar Games
- Soothsayer
- Member
- 864 posts
- Joined: Oct. 2008
- Offline
-
- Quick Links