Python - create rendering parameters

   11014   7   1
User Avatar
Member
856 posts
Joined: Oct. 2008
Offline
Is it possible to create rendering paramaters via python? I'd like to creat and set vm_volumestepsize on big bunch of nodes I have.
--
Jobless
User Avatar
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.
Graham Thompson, Technical Artist @ Rockstar Games
User Avatar
Member
856 posts
Joined: Oct. 2008
Offline
I'm sorry but I still don't quite get it. What is the function that adds parameters? I looked for addParms, createParms or something along those lines but I can't find it.
--
Jobless
User Avatar
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)
Aleksei Rusev
Sr. Graphics Tools Engineer @ Nvidia
User Avatar
Member
856 posts
Joined: Oct. 2008
Offline
Thanks Alex and Graham.
--
Jobless
User Avatar
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?
--
Jobless
User Avatar
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
User Avatar
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
  • Quick Links