nicoalter Posted September 9, 2016 Share Posted September 9, 2016 Hello, how can I force a channel in a sop to evaluate my python expression as an expression (not as the final value) ? With hscript it is simple I write : `mycode` But with Python I don't get it, sometimes I write something like : frame() or hou.frame() or hou.pwd() And it is recognized immediately as an expression and is evaluated (blue/cyan background), sometimes the very same text is considered as the final value (background black). I sometimes need to enter the code many times in order to have it recognized as code. I do not understand why ? Any help is very welcome (I am on houdini 15.5.565 on Windows 10) Thanks, Nicolas Quote Link to comment Share on other sites More sharing options...
Atom Posted September 9, 2016 Share Posted September 9, 2016 (edited) You need to change the expression language for every single node where you want to use Python. Click that Black H icon in the upper right area. Choose Python instead of Hscript. If you know you are going to use Python all the time you can set the system default to be Python instead of hScript under Houdini Preferences\Scripting The only other thing that comes to mind is that the Preferences has a little note which states that every "new" node will inherit this setting. Perhaps failures are occurring on old nodes...? Edited September 9, 2016 by Atom Quote Link to comment Share on other sites More sharing options...
nicoalter Posted September 9, 2016 Author Share Posted September 9, 2016 Thanks Atom for the help but unfortunately I already did both things you told me. My default scripting in my preferences is "python" I try only on new nodes I created once my preferences were setup (and saved I closed houdini and reopened) to python. WhenI create a new node it is with the Python icon on the script interpretation icon. That is why I am puzzled. Quote Link to comment Share on other sites More sharing options...
nicoalter Posted September 9, 2016 Author Share Posted September 9, 2016 (edited) Problem solved, I have been told a workaround : create a key before writing the python code so it is properly evaluated after. Thanks, Nicolas. Edited September 9, 2016 by nicoalter 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.