[Sidefx-houdini-list] Python parameter join to next

Graham Thompson captainhammy at gmail.com
Sun Apr 8 11:13:58 EDT 2012


Parm Template Groups are definitely much quicker when adding actual
parameters to an asset's HDADefinition.  Every time you add a parm
template to the definition using addParmTuple it has to write into
that definition and if your asset contains lots of stuff inside it
this can get very slow.  With template groups you can  add them all to
the group and then set the group to the definition with a single
update, thus saving yourself potentially lots of IO slowness.

On Sun, Apr 8, 2012 at 1:25 AM, Nick van Zutphen <nvanzutphen at live.com> wrote:
> Well in H12 I've been using them quit successfully, apart from this little thing.
> It wouldn't surprise me if this method would be faster though, compared to adding parameters 1 by 1.
>
> Tnx Andrew :-)
>
> Be Nick, be Nimble
> ----
> http://www.nickvanzutphen.com/ngtl
>
>
>
>
> On Apr 8, 2012, at 2:41 AM, Andrew Lyons wrote:
>
>> The parmTemplateGroup is the new style for working with the spare parms:
>>
>> ptg = node.parmTemplateGroup()
>> stringTemplate2 = hou.StringParmTemplate(name='testName2', label='Test
>> Label2', num_components=1)
>> stringTemplate = hou.StringParmTemplate(name='testName', label='Test
>> Label', num_components=1)
>> stringTemplate.setJoinWithNext(True)
>> stringTemplate2.setJoinWithNext(True)
>> ptg.addParmTemplate(stringTemplate)
>> ptg.addParmTemplate(stringTemplate2)
>> node.setParmTemplateGroup(ptg)
>>
>> The old parm commands don't seem to work any more at best, and crash
>> Houdini at worst.
>>
>> Cheers
>>
>>
>> On 7 April 2012 12:30, Nick van Zutphen <nvanzutphen at live.com> wrote:
>>> Hi!
>>>
>>> I'm a bit confused here, if you create a set of parameters on an HDA and for a particular one toggle 'Join to next' this parameter will be on the same line as the next parameter, cosy joined together.
>>> Now If I use python to add a set of parameters, this options doesn't seem to work.
>>>
>>> Imagine that after this, another parameter is created, by similar code but of a different type. I would like that this parameter joins that parameter.
>>> I think that it doesn't work because it tries to join a parameter that doesn't exist jet. Which makes me wonder, how does this work in the normal creation of parameters? Should I update an existing parameter? How do I do that?
>>>
>>> A sniped of my code:
>>>
>>>   stringTemplate = hou.StringParmTemplate(name='testName', label='Test Label', num_components=1)
>>>   stringTemplate.setJoinWithNext(True)
>>>   try:
>>>       #Create parameter
>>>       stringParm = node.addSpareParmTuple(stringTemplate,\
>>>           in_folder=['Node Name'],\
>>>           create_missing_folders=True)
>>>   except:
>>>       print 'Could not create string parameter'
>>>
>>> Cheers,
>>>
>>> Be Nick, be Nimble
>>> ----
>>> http://www.nickvanzutphen.com/ngtl
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Sidefx-houdini-list mailing list
>>> Sidefx-houdini-list at sidefx.com
>>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>
>>
>>
>> --
>> =======================================
>> Andrew D Lyons | Digital Artist | http://www.tstex.com
>> =======================================
>> _______________________________________________
>> Sidefx-houdini-list mailing list
>> Sidefx-houdini-list at sidefx.com
>> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list
>>
>
> _______________________________________________
> Sidefx-houdini-list mailing list
> Sidefx-houdini-list at sidefx.com
> https://lists.sidefx.com:443/mailman/listinfo/sidefx-houdini-list



More information about the Sidefx-houdini-list mailing list