Symbolic Posted July 6, 2009 Share Posted July 6, 2009 Hi, I am trying to trigger a button of an OTL with a small python script. target=hou.pwd(); target.parm("parm").pressButton(); When I run this in the python editor... it just kills houdini. If I put that script on a script SOP... it klicks the button, I get my result... and then in crashes. Any ideas? Thanks. Quote Link to comment Share on other sites More sharing options...
graham Posted July 6, 2009 Share Posted July 6, 2009 What exactly is your button doing? Can you post an example? I use it all the time and have no problems. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted July 6, 2009 Author Share Posted July 6, 2009 (edited) What exactly is your button doing? Can you post an example? I use it all the time and have no problems. Well, The button is on an imaginary OTL right now. The script on the OTL is: def runMe(): self = hou.pwd() hou.ui.displayMessage("Hit me! " + str(self)) def execute(): runMe() The button it self has this script: hou.pwd().hdaModule().runMe() Then when you click the button, you get the message. When you try to triger it with the python script... things go terribly wrong. ?! Edited July 6, 2009 by Symbolic Quote Link to comment Share on other sites More sharing options...
static Posted July 6, 2009 Share Posted July 6, 2009 Seems to be a bug, I tried something similar just now and it seems to just hang when it reaches the displayMessage... only when you run the callback from the .pressButton() though... Quote Link to comment Share on other sites More sharing options...
Symbolic Posted July 6, 2009 Author Share Posted July 6, 2009 I am sure it was working the other day!? Quote Link to comment Share on other sites More sharing options...
graham Posted July 6, 2009 Share Posted July 6, 2009 (edited) I can definitely reproduce and will submit a bug. I have an idea why it's hanging. I'll ask around. Edit: Bug submitted: 36185 Running the following line from the shell in the attached file causes the problem. hou.node("/obj/gthompson_geo11").parm("parm").pressButton() button_crash.hip Edited July 6, 2009 by graham Quote Link to comment Share on other sites More sharing options...
graham Posted July 6, 2009 Share Posted July 6, 2009 I am sure it was working the other day!? I tested it in 3 different versions of H (9.5, 10.0, 10.x) and it was the same in all of them Quote Link to comment Share on other sites More sharing options...
Symbolic Posted July 6, 2009 Author Share Posted July 6, 2009 (edited) Hah! So it is a bug?! Any solutions?... ideas?... I just have lots of OTLs and selecting all of them -> pressing that button... does not work. I need to have a small script going through a list of those OTLs and trigering that button Simple. Edited July 6, 2009 by Symbolic Quote Link to comment Share on other sites More sharing options...
graham Posted July 6, 2009 Share Posted July 6, 2009 I'm pretty sure the problem is caused by the fact you are attempting to display the message window. If you remove that line and say print or something else it's fine. It looks like a thread locking problem between the shell and the UI your callback is trying to display. A quick way around that right now would be to do something like this for each asset. cwd = hou.pwd() hou.setPwd(my_node) my_node.hdaModule().runMe() hou.setPwd(cwd) This avoids the callback and gets around the bug in my tests. If you had your runMe function defined differently you could get around not having to set the current directory but that's not really a big deal. Quote Link to comment Share on other sites More sharing options...
Symbolic Posted July 6, 2009 Author Share Posted July 6, 2009 Thanks graham, I do not need to display any messages. It was just to test the CLIKC process. Actually it seems like that test caused me troubles. It works for a simple "print" output. So it works. Cheers. 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.