Jump to content

adding child to multiparm list python


Hello world

Recommended Posts

I have created the multiparm parameter

I have also created the geometry-file parameter.but when i add it to the multiparm list paramter as a child.Nothing happens for no reason.Code is executing.But it doesnt seem to return any error.

Please tell me how to proceed

mpl=hou.FolderParmTemplate(........)
hda.spareParmParmTuple(mpl)
geo=hou.StringParmTemplate("ggeo","GEO",1,default_value=(["default.bgeo"]),naming_scheme=hou.parmNamingScheme.Base1,string_type=hou.stringParmType.FileReference,menu_items=([""]),menu_labels=([""]),icon_names=([]),item_generator_script="",item_generator_script_language=hou.scriptLanguage.Python,menu_type=hou.menuType.StringReplace)
hda.addSpareParmTuple(geo)
mpl.addParmTemplate(geo)

Link to comment
Share on other sites

I think it should be more like this

templateGeo = hou.StringParmTemplate('geoName', 'geoName', 1, ("",))
templateFolder = hou.FolderParmTemplate("asd","Asd",folder_type = hou.folderType.MultiparmBlock, parm_templates=(templateGeo,))
hou.node('/obj/null1').addSpareParmTuple(templateFolder)

Notice that in templateFolder I give it the template for the parm

Apparently you can do it like this;

hou.node('/obj/null1').addSpareParmTuple(templateGeo,('asd',) )

('asd' is the folder)

But that didn't work for my multiparm block. It does work if you use the "Transform" or something.

I found this useful: http://houdinitips.posterous.com/

Edited by sam.h
Link to comment
Share on other sites

Nice example!

Now if we try to load the bgeo file,it doesnt load.Do we need to add the file node and reference this.

If so,Could you give share a small snippet of code so that if the user presses the + button,the file node is created.Could this be done?

Edited by Omy
Link to comment
Share on other sites

Nice example!

Now if we try to load the bgeo file,it doesnt load.Do we need to add the file node and reference this.

If so,Could you give share a small snippet of code so that if the user presses the + button,the file node is created.Could this be done?

In sops you would have file node, then a copy node.

On the copy node, number of copies should be referencing the multiparm folder, so it gets the number of entries in the block.

On the copy node, turn on stamping and stamp $CY to copyNum.

On the file node use an expression like chs("../geopath" + stamps("../copy1","copyNum",""))

I can put together an example if that doesn't make sense.

Link to comment
Share on other sites

hi I tried your method.

what is geopath pointing to? the dig asset which contains the multiparm folder list?

seems to be not working for me.Im getting warning and error.dont know where i made mistake.A hip file would be really great.

Thank you

Edited by Omy
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...