[Sidefx-houdini-list] simulate left click on a parameter button in python?

Lars van der Bijl com48com at gmail.com
Tue Feb 11 08:16:01 EST 2014


try

update.pressButton()


On Tue, Feb 11, 2014 at 1:14 PM, Dominik Kirouac <dk at shedmtl.com> wrote:

> Hey,
>
> This is my first attempt to python scripting. I try to write a shelf
> button to load abc files(Camera) with the alembicarchive node and one of
> the operation is to simulate a left click press on the build hierarchy
> button.
>
> I am able to set a parameter, but when I try to put ("1") to
> the"buildHierarchy" param. It update the parameter, but didn't run the
> button as it is supposed to.
>
>
> Here is a part of the code:
>
>
> #Choose abc file
> filepath=  hou.ui.selectFile(initpath,"select model",False,)
>
> #create alembicarchive node call Render_Cam
> iscreated=  hou.node('obj/Render_Cam')
>
> if  iscreated==  None:
>     obj.createNode('alembicarchive','Render_Cam',True)
>     newnode=  hou.node('obj/Render_Cam')
>     #Set abc path
>     abcpath=  newnode.parm("fileName")
>     abcpath.set(filepath)
>  -->update=  newnode.parm("buildHierarchy")
>  -->update.set("1")
>
> else  :
>     newnode=  hou.node('obj/Render_Cam')
>     #Set abc path
>     abcpath=  newnode.parm("fileName")
>     abcpath.set(filepath)
>
> Someone know how to do that ?
>
> Thanks
>
>
> *Dominik Kirouac // SHED **
> *FX Artist
> 1410, RUE STANLEY, 11E Étage MONTRÉAL (QUÉBEC) H3A 1P8
> T 514 849-1555 F 514 849-5025 WWW.SHEDMTL.COM <http://www.shedmtl.com/>
>
> _______________________________________________
> 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