I'm curious on how to set a string value that has global variables in a Python callback script?
Referring to the above screenshot (pardon my lame humour as I'm still debugging it), if I execute the code in the Python Source Editor, it returns the value that I wanted with the global variables intact while executing the same code through callback expand the global variables.
Ninja edit: Guess using this weird workaround by (“$” + “HIP”) solved the issue for me.
Basically here's what I did to get it to evaluate to my desire result:
oldspam="$HIP/geo/$HIPNAME/"+hires_name+"/"+hires_name+".$F4.vdb"# Only works in Python Source Editorworkingspam="$"+"HIP/geo/"+"$"+"HIPNAME/"+hires_name+"/"+hires_name+"."+"$"+"F4.vdb"
the reason why it works in Source editor and not in the parm is that variables are automatically expanded in parms before the text gets passed to python (or VEX) you can see that by MMB on parm label so that's why you need escaping, it's to prevent houdini from evaluating the variable, nothing to do with Python in this case