Doum Posted February 10, 2014 Share Posted February 10, 2014 (edited) hey, I'm new to python. I try to write a shelf button to load abc files with the alembic archive node and I try to use python to update hierarchy. I am able to set a parameter, but when I try to put 1 to this one "buildHierarchy", it tell me that it's an integer not a string. How can I do that? thanks Doum Edited February 11, 2014 by Doum Quote Link to comment Share on other sites More sharing options...
Doum Posted February 11, 2014 Author Share Posted February 11, 2014 (edited) Here my code at the moment. maybe it's not clean, but I'm not a programmer #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) else : newnode = hou.node('obj/Render_Cam') #Set abc path abcpath = newnode.parm("fileName") abcpath.set(filepath) I would like to add an other operation if the condition is true. I want to make it click the build or update hierarchy automatically to be able to set the cam res and other parm in the camera's parameters. I try something like this: update = newnode.parm("buildHierarchy") update.set("1") But it doesn't seem to simulate a left click on the buildhierarchy button. Any idea ? Thanks Doum Edit : Problem solve by a nice guy on the sidefx mailing list Lars van der Bijl. update = newnode.parm("buildHierarchy") update.pressButton() Edited February 11, 2014 by Doum Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.