bento Posted December 15, 2015 Share Posted December 15, 2015 Hi, I'm attempting to create a digital asset via python scripting and would like to set up some of the parameters and interface as part of that process. I've had success creating parameters and arranging the interface for normal nodes (spare parameters), but taking the same sort of approach with an asset only appears to be half working. Here is my debugging example code: hou.hipFile.clear() # just whilst we're testing; do a fresh start objNode = hou.node('/obj').createNode('geo') objNode.setName('myAsset') if objNode.canCreateDigitalAsset(): objNode = objNode.createDigitalAsset( name='test::myAssetA', description='myAsset', hda_file_name='/tmp/foo_v001.hda', ) parm_group = objNode.type().definition().parmTemplateGroup() first = parm_group.findFolder('Transform') folderTemplate = hou.FolderParmTemplate('myFolder','My Folder') buttonTemplate = hou.ButtonParmTemplate('myButton','My Button') folderTemplate.addParmTemplate(buttonTemplate) parm_group.insertBefore(first,folderTemplate) objNode.type().definition().setParmTemplateGroup(parm_group) What I'm hoping to do here is create an asset, add a folder as the first item in the interface, and add a button to that folder. Like I said, this sort of seems to work - if I then go to the Edit Opertator Type Properties dialog I see the parameters listed as expected. Weirdly though, all the pre-existing folders are now renamed to match the new folder I added (i.e. myFolder_1,myFolder_2 etc). Then when I look at the interface in the parameter editor, 'myFolder' appears as a check box instead of a folder and the custom UI elements are drawn last rather than first. (see attached screen grab). So, the question is - am I going about this the wrong way (likely), or do you think this might be a bug (happy to log if so)? cheers Ben Quote Link to comment Share on other sites More sharing options...
bento Posted December 16, 2015 Author Share Posted December 16, 2015 Here's the screen grab that didn't attach properly. Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted December 24, 2015 Share Posted December 24, 2015 You're doing this right. It's ok that folder names are renamed, you are not going to work with folder names directly, instead you will use folder labels most of the time. To actually see your parm in a folder, you need to create an instance of you newly create operator type. For some reason it's not updating right after creating from script. 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.