[Sidefx-houdini-list] Help With hou Module

Graham Thompson gthompson at sidefx.com
Sat Jan 19 09:19:58 EST 2008


You are in fact doing most everything correct, except the syntax about 
the folders you want them to be in. It expects a tuple.

The proper syntax is in_folder=('Spare_Test', ). This will cause Houdini 
to create just the one folder with that name.
If you had a folder 'Nested' inside that 'Spare_Test' then you would use 
('Spare_Test', 'Nested')

You can observe this by finding a parameter in one or more folders on a 
node and doing a hou.Parm.containingFolders.

Hope that helps.


Andrew D Lyons wrote:
> I think you helped me find a bug.
>
> rop = hou.node("/out").createNode("comp", node_name="testrop",
> run_init_scripts=False)
>
> parmtemplate = hou.StringParmTemplate( 'test_spare5', 'Test Spare5', 1 )
>
> parm = rop.addSpareParmTuple( parmtemplate, in_folder=('Spare_Test'),
> create_missing_folders=True )
>
> For me these 3 lines create a parm called "Test Spare5" in a tree of
> folders where there is a folder for every letter in "Spare_Test". The
> parm is in the last 't' folder....
>
> --------------------------------------
>
> This creates a folder, but I couldn't find a way to get a parm into it with HOM:
>
> rops = hou.node("/out").createNode("comp", node_name="testrop",
> run_init_scripts=False)
>
> rops.addSpareFolder("Spare_Test", in_folder=(),
> parm_name="test_spare", create_missing_folders=True)
>
> Maybe SESI can help (iwth a bugfix at least)
>
> Cheers
>
>
>
>
>
>
> On 18/01/2008, Robert Thomas <shinyary2 at gmail.com> wrote:
>   
>> Hi everyone,
>>
>> I'm trying to set up a Python script that will automatically add a spare
>> parameter to a folder called "Spare" on the current operator, both as an
>> exercise and as something to speed up my workflow, but I keep running up
>> against the incomplete documentation for the "hou" module.  So, I've been
>> trying to reverse engineer everything that is not documented, and it's slow
>> going.
>>
>> My current problem is that I cannot seem to create a default parmTemplate
>> object (since, naturally, there happens to be no constructor for that
>> class--and of course no documentation).  My approach is to create one of
>> these and add it to the node using the "addSpareParmTuple()" function, which
>> appears to work the way I want it to if I extract the parmTemplate of an
>> already existing parameter.
>>
>> Incidentally, I'm not sure how to reference folders, so I don't know how to
>> stuff my new parameter into a folder using this function.
>>
>> Help!
>>
>> Thanks,
>>
>> Robby
>> _______________________________________________
>> 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