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

Dominik Kirouac dk at shedmtl.com
Tue Feb 11 08:29:23 EST 2014


So logical "pressButton" :). I searched in the help for button, but 
didn't find that one...

Thanks for the help !

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

Le 11/02/2014 8:16 AM, Lars van der Bijl a écrit :
> 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
>>
> _______________________________________________
> 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