Spike Posted February 14, 2019 Share Posted February 14, 2019 Hi i want to assign a global variable as path for a rop node with python - but the thing is that python translates $F to the current frame, and every other parameter... node_rop.parm('sopoutput').set("$JOB/render/$HIPNAME.$F.bgeo.sc") gets translatet to /Users/xxxx/Project/render/path.12.bgeo.sc in the rop network so how can i assign a $F to a textinput field with python thank you for help! Quote Link to comment Share on other sites More sharing options...
kiryha Posted February 14, 2019 Share Posted February 14, 2019 1 hour ago, Spike said: gets translatet to /Users/xxxx/Project/render/path.12.bgeo.sc Do you mean translated in UI? Cos it's wired. It could be translated when getting this parameter with node.parm('name').eval() , so you need to use node.parm('name').rawValue() instead. Quote Link to comment Share on other sites More sharing options...
Spike Posted February 14, 2019 Author Share Posted February 14, 2019 1 hour ago, kiryha said: Do you mean translated in UI? Cos it's wired. It could be translated when getting this parameter with node.parm('name').eval() , so you need to use node.parm('name').rawValue() instead. so node.parm('$F').rawValue() ? - looks strange cause its no parm of node - yes i mean in the UI of the rop Quote Link to comment Share on other sites More sharing options...
kiryha Posted February 14, 2019 Share Posted February 14, 2019 Can you post the file with code in Python Source editor reproducing the issue? In node.parm('$F').rawValue(), parm('...') should contain string parameter name, which you take value from. Quote Link to comment Share on other sites More sharing options...
Spike Posted February 15, 2019 Author Share Posted February 15, 2019 (edited) 22 hours ago, kiryha said: Can you post the file with code in Python Source editor reproducing the issue? In node.parm('$F').rawValue(), parm('...') should contain string parameter name, which you take value from. still cant figure out the solution pythonRop.hiplc Edited February 15, 2019 by Spike Quote Link to comment Share on other sites More sharing options...
kiryha Posted February 18, 2019 Share Posted February 18, 2019 Ah, Python node... I don't know why it happened and I don't have a solution for this case. From the other side, this code is working and you will get correct images in your ROP. And why are you doing it with Python node when you can do the same in ROP directly? Quote Link to comment Share on other sites More sharing options...
graham Posted February 18, 2019 Share Posted February 18, 2019 You can set values with variables in them by escaping the $: node_rop.parm('sopoutput').set("\$JOB/render/\$HIPNAME.\$F.bgeo.sc") 2 Quote Link to comment Share on other sites More sharing options...
larabrian Posted September 3, 2019 Share Posted September 3, 2019 You can use a global variable in other functions by declaring it as global in each function that assigns to it. Python assumes that any name that is assigned to, anywhere within a function, is local to that function unless explicitly told otherwise. If it is only reading from a name, and the name doesn't exist locally, it will try to look up the name in any containing scopes (e.g. the module's global scope). 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.