kaffee, junge Posted May 28, 2016 Share Posted May 28, 2016 (edited) Hi there, I am creating folders and parms on an hda with python. The script looks for a folder name in the hda's children, then creates the same folder with the same (renamed) parms on the hda. Now I want to make relative references from the hda to the child parms. Is there a way to do that by just using the parmTemplates that I already have using the script below? I dont want to look through each parm on the nodes and match them by name. I think I would need to distinguish between parm and parmTuple and so on... In the script the hda is named test1 with one child node. The child node has a folder called 'Test Folder' containing arbitrary parms. node = hou.node('/obj/test1') assetDef = node.type().definition() ##get the first childs parmTemplateGroup and folder by name parm_group = node.children()[0].parmTemplateGroup() folder = parm_group.findFolder(('Test Folder')) ##returns FolderParmTemplate ##get all parms in folder parm_tuple = folder.parmTemplates() ##create new Folder on the asset newFolder = assetDef.addParmFolder('Test Folder') ##clone each parm, rename and add to the asset for item in parm_tuple: oldName = item.name() clone = item.clone() clone.setName('new_' + oldName) assetDef.addParmTuple(clone, ('Test Folder',)) Edited May 28, 2016 by cookiemonsterandthegirls code tags Quote Link to comment Share on other sites More sharing options...
kaffee, junge Posted May 31, 2016 Author Share Posted May 31, 2016 ok my workaround for now is to use Grahams parmutils.py:http://houdinitoolbox.com/houdini.php?asset=15 there is a function called 'linkParmsTo' that works like a charm for this. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.