Two things to note:
Tcl
puts
does not return a value. It sounds like you want Tclset
, which does.The docs for
nuke.tcl
at http://www.nukepedia.com/reference/Python indicate:tcl(command, arg, arg, ...)
Run a tcl command. The arguments must be strings and passed to the command. If no arguments are given and the command has whitespace in it then it is instead interpreted as a tcl program (this is depreciated)
Rather than invoking it as a full script, it seems you could both use the non-deprecated version and get the behavior you want by using:
G = nuke.tcl("set", "THIS")
Whic should reutrn the value of the THIS
variable.