jonp Posted December 23, 2016 Share Posted December 23, 2016 After a bit of light testing it seems that if I import a Python module when loading Houdini, using pythonrc.py, I cannot later use it directly in a parameter expression. Instead I have to import it into the expression again, which could make the expression string more complicated and error-prone (multiple lines or semicolons). Is this really the case? I feel like I must not be doing something correctly. Quote Link to comment Share on other sites More sharing options...
jonp Posted December 29, 2016 Author Share Posted December 29, 2016 Probably shouldn't post anything over Christmas / NYE break... Quote Link to comment Share on other sites More sharing options...
Stalkerx777 Posted January 2, 2017 Share Posted January 2, 2017 http://www.sidefx.com/docs/houdini/hom/hou/expressionGlobals Quote Link to comment Share on other sites More sharing options...
jonp Posted January 13, 2017 Author Share Posted January 13, 2017 Ah thank you Alex, I wasn't aware of that before! Quote Link to comment Share on other sites More sharing options...
Kappy Posted January 13, 2017 Share Posted January 13, 2017 Additionally, to use random modules in one-liners, sometimes I like to use the __import__ function, like this: __import__('re').sub('foo','bar','foobar') Still makes your expression longer, but at least it's a single line. -James 1 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.