Python - create rendering parameters
11014 7 1- Soothsayer
- Member
- 856 posts
- Joined: Oct. 2008
- Offline
- graham
- Member
- 1904 posts
- Joined: Nov. 2006
- Offline
Rendering parameters are just like any other parameter but named in such a way as having meaning to Mantra so, you can add them manually using Python. There's no Python interface for easily adding rendering parameters but if you know the settings you can easily add various ones.
You can always add your parameter to a node and use asCode() to get the creation commands for it.
You can always add your parameter to a node and use asCode() to get the creation commands for it.
Graham Thompson, Technical Artist @ Rockstar Games
- Soothsayer
- Member
- 856 posts
- Joined: Oct. 2008
- Offline
- Stalkerx777
- Member
- 183 posts
- Joined: Nov. 2008
- Offline
Hi.
Here is a simple example from documentation
>>> node = hou.node(“/obj”).createNode(“geo”)
>>> group = node.parmTemplateGroup()
>>> folder = hou.FolderParmTemplate(“folder”, “My Parms”)
>>> folder.addParmTemplate(hou.FloatParmTemplate(“myparm”, “My Parm”, 1))
>>> group.append(folder)
>>> node.setParmTemplateGroup(group)
Here is a simple example from documentation
>>> node = hou.node(“/obj”).createNode(“geo”)
>>> group = node.parmTemplateGroup()
>>> folder = hou.FolderParmTemplate(“folder”, “My Parms”)
>>> folder.addParmTemplate(hou.FloatParmTemplate(“myparm”, “My Parm”, 1))
>>> group.append(folder)
>>> node.setParmTemplateGroup(group)
Aleksei Rusev
Sr. Graphics Tools Engineer @ Nvidia
Sr. Graphics Tools Engineer @ Nvidia
- Soothsayer
- Member
- 856 posts
- Joined: Oct. 2008
- Offline
- Soothsayer
- Member
- 856 posts
- Joined: Oct. 2008
- Offline
Oh on follow-up question to this.
How to I find sub-tabs?
For example on my node I have “Mytab” as a subtab of “Material”. Now, I can find Material like so:
hou.node('/obj/mynode').parmTemplateGroup().findFolder(“Material”)
but
hou.node('/obj/mynode').parmTemplateGroup().findFolder(“Mytab”)
does not work.
I tried variations of this (like Material/Mytab) but there seems to be no easy way of getting it?
How to I find sub-tabs?
For example on my node I have “Mytab” as a subtab of “Material”. Now, I can find Material like so:
hou.node('/obj/mynode').parmTemplateGroup().findFolder(“Material”)
but
hou.node('/obj/mynode').parmTemplateGroup().findFolder(“Mytab”)
does not work.
I tried variations of this (like Material/Mytab) but there seems to be no easy way of getting it?
--
Jobless
Jobless
- Soothsayer
- Member
- 856 posts
- Joined: Oct. 2008
- Offline
Well, I found a way to do it by looping through parmTemplates but it appears to be useless because for some reason the parameter is not picked up by the renderer. It only works when I use the local material parameter overrides, which is kind of strange because the parameter has the same name…
--
Jobless
Jobless
- Amit Khanna
- Member
- 14 posts
- Joined: Oct. 2015
- Offline
Hi guys,
I am adding a rendering parm to a ROP using the code provided here. But when I add this parm, some of my settings on Image Planes are reverted to default. For example Light Exports are set back to “No Light Exports” also if I have Override Camera Resolution checked, then Resolution Scale is also set to 1/10…
Any idea what might be happening?
Thanks,
ak
I am adding a rendering parm to a ROP using the code provided here. But when I add this parm, some of my settings on Image Planes are reverted to default. For example Light Exports are set back to “No Light Exports” also if I have Override Camera Resolution checked, then Resolution Scale is also set to 1/10…
Any idea what might be happening?
Thanks,
ak
-
- Quick Links