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

Dominik Kirouac dk at shedmtl.com
Tue Feb 11 08:14:44 EST 2014


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/>




More information about the Sidefx-houdini-list mailing list