[Sidefx-houdini-list] Some python questions...

Graham Thompson captainhammy at gmail.com
Thu Feb 12 11:42:00 EST 2009


When trying to create parms in python you can take advantage of using
hou.ParmTemplate.asCode() to see how exactly you can reproduce certain
settings of that parm in the creation command.

print hou.('/obj/geo1').parm("scale").parmTemplate().asCode()



On Thu, Feb 12, 2009 at 8:28 AM, Edward Lam <edward at sidefx.com> wrote:

> To create a single element tuple in Python, you need to have a trailing
> comma. ie. (1,)
>
> See: http://en.wikibooks.org/wiki/Think_Python/Tuples
>
> Regards,
> -Edward
>
> guillaume laforge wrote:
> > An other little question :
> >
> > It looks like the FloatParmTemplate method need a 'vector list' for
> > the default_value argument. I tried (1, 0, 0) and (1) but it gives an
> > error as I define the parameter with just one component like this :
> >
> > restLengthParm = hou.FloatParmTemplate('restLength', 'Rest Length',
> > num_components=1, default_value=(1.0), min=0.01, max=10.0 )
> >
> > Is it a bug ?
> >
> > Thanks
> >
> > Guillaume
> >
> >
> > On Thu, Feb 12, 2009 at 3:00 PM, guillaume laforge
> > <guillaume at alamaison.fr> wrote:
> >> Bonjour Francois,
> >>
> >> Thanks ! It helps me a lot !
> >>
> >> Cheers
> >>
> >> Guillaume
> >>
> >> On Thu, Feb 12, 2009 at 2:16 PM, Francois-Xavier Boussard
> >> <b.fx at free.fr> wrote:
> >>> Bonjour Guillaume
> >>>
> >>> You may try that :
> >>>
> >>> nullObj = hou.node('obj').createNode('null') mysparefloat =
> >>> hou.FloatParmTemplate("myfloat" , "Myfloat", 1)
> >>> nullObj.addSpareParmTuple(mysparefloat, in_folder=(["MYFOLDER"]),
> >>> create_missing_folders=True)
> >>>
> >>> To see what is going on look at the script that houdini generate
> >>> itself to create the node with:
> >>>
> >>> hcreate = nullObj.asCode(save_creation_commands=True) print
> >>> hcreate
> >>>
> >>> hope this help francois
> >>>
> >>>
> >>> ----- Mail Original ----- De: "guillaume laforge"
> >>> <guillaume at alamaison.fr> À: sidefx-houdini-list at sidefx.com
> >>> Envoyé: Jeudi 12 Février 2009 11:47:15 GMT +01:00 Amsterdam /
> >>> Berlin / Berne / Rome / Stockholm / Vienne Objet:
> >>> [Sidefx-houdini-list] Some python questions...
> >>>
> >>> Hi,
> >>>
> >>> I can't find a way to create a spare parameter in python !
> >>>
> >>> The only related methods seems to be  "addSpareParmTuple". But I
> >>> don't want to add a vector parameter, just a float (I can't find
> >>> something like "addSpareParm" ). Trying the "addSpareParmTuple",
> >>> I can't figure out how to define the "parm_template" argument ?
> >>>
> >>> I'm also trying to find a parameter in a specific folder and it
> >>> always fail. Here is a snippet :
> >>>
> >>> nullObj = hou.node('obj').createNode('null')
> >>> nullObj.addSpareParmFolder("TEST")
> >>> nullObj.parmsInFolder(("TEST"))
> >>>
> >>> It returns an "OperationFailed: The attempted operation failed."
> >>> message.
> >>>
> >>> Is it possible to create a spare parameter in Python in a
> >>> specific folder ?
> >>>
> >>> It looks like I miss something really simple but I can't find the
> >>> light :/.
> >>>
> >>> Cheers
> >>>
> >>> -- Guillaume Laforge 3d Technical Director
> >>> http://www.alamaison.fr
> >>> _______________________________________________
> >>> 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
> >>>  Ý
> > _______________________________________________ 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