pelos Posted January 18, 2019 Share Posted January 18, 2019 I have a parameter in my node that I want to convert to use python, usually we can right click> expression >change language to python but for some reason is gray out =( and reading documentation I could do parm.setExpression("2+2". language=Something) but I thought using hou.lenguage.Python as argument but wants a value? do we have something like parm.setScriptLenguage? or an easy way to switch all the node to use python, or just that parameter? Quote Link to comment Share on other sites More sharing options...
anim Posted January 18, 2019 Share Posted January 18, 2019 it's grayed out, because you don't have any keyframe or existing expression there, if you had one, you can convert you can also set your node language to Python and then when your parm is in expression editing mode, you can just type it in and it will create expression keyframe for you but this should work too, what errors are you getting?: yourParm.setExpression("2+2", hou.exprLanguage.Python) Quote Link to comment Share on other sites More sharing options...
pelos Posted January 18, 2019 Author Share Posted January 18, 2019 (edited) if I do something like exp = """ node = hou.pwd() geo = node.geometry() prim0 = geo.prim(0) return len(prim0.points()) """ attribvop_node.parm("num_points_per_line").setExpression(exp, hou.exprLanguage.Python) now it works =) in the UI shows purple, and not green I think is because just that parm is python and the rest are hscript. thanks =)!!!! (go to sleep is 1 am) Edited January 18, 2019 by pelos Quote Link to comment Share on other sites More sharing options...
anim Posted January 18, 2019 Share Posted January 18, 2019 yes, the colors may be confusing - it all depends on what is the node's default scripting language (shown top-right next to cog icon) - if expression on the parameter is the same language, it is green, if it is other language then purple 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.