magneto Posted December 31, 2011 Share Posted December 31, 2011 I am looking for a way to insert the contents of a python file into a Python SOP, so I can have the actual SOP code in an external file while the SOP code only loads it. For instance something like this: include "$OperatorTypeName.py" This is more of a compile-time thing where it literally copy/pastes the contents of the file. Is this possible? Quote Link to comment Share on other sites More sharing options...
graham Posted December 31, 2011 Share Posted December 31, 2011 Can you not just import the external module and either let it run right away or just call a function? import mymodule mymodule.cookMySop(hou.pwd()) Quote Link to comment Share on other sites More sharing options...
magneto Posted December 31, 2011 Author Share Posted December 31, 2011 (edited) Thanks Graham, that would work too. Although the less code I have in the SOP, the better Also in the include method, I wouldn't have to look at the internal SOP code or change it ever again, hence me also using the $HDA_NAME. Edited December 31, 2011 by magneto 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.