csp Posted December 1, 2014 Share Posted December 1, 2014 While using python hscript command how can use have in this single argument script an if statement? I tried unsuccessfully: more code; do_that if statement; more code Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted December 1, 2014 Share Posted December 1, 2014 While using python hscript command how can use have in this single argument script an if statement? I tried unsuccessfully: more code; do_that if statement; more code Although you can use Python's version of ternary operation such as x,y,z = 10,10,0; z = x**y if z == 0 else x*y; print z If you have more complicated python code, consider putting it in file, or just don't use hscript at all Quote Link to comment Share on other sites More sharing options...
csp Posted December 2, 2014 Author Share Posted December 2, 2014 just don't use hscript at all I wish that I could avoid hscript but when you want to hack Houdini's interface, like adding items to node's right click menu using OPmenu, you have to Hscript. If you have more complicated python code, consider putting it in file At least I can do that but I was trying to avoid have OPmenu script calling an hsc script which is calling a python script 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.