Hi all,
I am wondering if there is a way to create custom “preset” for PDG's Python Processor node like Parm Evaluation, Clone Upstream Items, etc.?
Thank you.
How to create custom PDG Python Processor preset
3075 7 0- tung
- Member
- 26 posts
- Joined: 1月 2018
- Offline
- tpetrick
- スタッフ
- 578 posts
- Joined: 5月 2014
- Offline
Yes, that's possible. The presets used on TOP nodes are implemented using Houdini's standard parm preset builder, which will look for file(s) named “PythonScripts.txt” on the Houdini search path. You can add a file with that name to your Houdini Path and put custom preset definitions in there. For example, on Linux you'd save the custom presets file to $HOME/houdini18.0/PythonScript.txt.
The snippet entries should start with the parm name the preset belongs to, then the name of the preset in the menu, and finally the code itself. For example:
You can also check $HH/PythonScripts.txt for reference, which contains all of the parm presets for the various Python nodes shipped with Houdini.
The snippet entries should start with the parm name the preset belongs to, then the name of the preset in the menu, and finally the code itself. For example:
Top/pythonprocessor/generate
My Custom Snippet Name
import hou
print(hou.pwd())
Top/pythonprocessor/generate
My Other Snippet Name
print("hello")
You can also check $HH/PythonScripts.txt for reference, which contains all of the parm presets for the various Python nodes shipped with Houdini.
- tung
- Member
- 26 posts
- Joined: 1月 2018
- Offline
- tung
- Member
- 26 posts
- Joined: 1月 2018
- Offline
- BrookeA
- スタッフ
- 387 posts
- Joined: 8月 2017
- Offline
- tung
- Member
- 26 posts
- Joined: 1月 2018
- Offline
- tung
- Member
- 26 posts
- Joined: 1月 2018
- Offline
- BrookeA
- スタッフ
- 387 posts
- Joined: 8月 2017
- Offline
If you are able to trigger a Python callback, you can add spare parameters to your node's interface. To do this you will need to make use of
Here is an example code snippet from the documentation:
hou.ParmTemplateGroup
(https://www.sidefx.com/docs/houdini/hom/hou/ParmTemplateGroup.html).Here is an example code snippet from the 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)
Edited by BrookeA - 2020年7月29日 19:52:01
-
- Quick Links