Jump to content
Hello world

adding child to multiparm list python

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)

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Here you go, the chs("../fileStamp") expression is pointing to the multiparm block, and I am appending the copy number onto the end of the channel path with '+'.

fileStamp.hip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×