user4611642
user4611642

Reputation: 27

nuke tcl in python returns command instead of string

In a python script I'm using nuke.tcl() to return a value but I keep getting a runtime error instead of a string:

frames = nuke.tcl('[filename [topnode]]')
print (frames)

returns:

RuntimeError: Z:/Project/Sequence/Shot/renders/comp/v001/Shot_v001/Shot_v001.%05d.exr: Unknown command

So, it returns the result I'm looking for, but then errors out, says it's an unknown command. I've also tried the following but I get the same result

frames = str(nuke.tcl('[filename [topnode]]'))

Upvotes: 0

Views: 740

Answers (1)

user4611642
user4611642

Reputation: 27

okay I figured it out. The following returns the string I wanted. I guess "expr" is similar to "eval" in python.

frames = nuke.tcl('expr','[filename [topnode]]')

Upvotes: 0

Related Questions