Hey guys,
Fairly new to creating tools using python, but I'm trying to brute force my way
into learning. I've got this multiline python expression and it works when
applied directly to the knob, but when trying to create the node and apply the
python code as an expression it gives me an EOL string literal error. Can
anyone provide some insight? Sorry for sloppy naming :]
Python Button on node (which does not work):
amt = nuke.thisNode().knob('amt').value()
x = int(amt)
for i in range(x):
t = nuke.nodes.TimeOffset()
k = nuke.WH_Knob("ripLink" , "Ripple Link" )
t.addKnob(k)
k.setExpression("parent.delay")
t.knob('time_offset').setExpression("[python -exec {
de = t.knob('ripLink').value()
a = nuke.thisNode().name()
x = a[10:]
ret = float(x)*de}]")
EOL while scanning string literal. Arrow is right after setExpression.
Python directly applied as expression to knob (which works):
d = nuke.thisNode()
de = d.knob('ripLink').value()
a = nuke.thisNode().name()
x = a[10:]
ret = float(x)*de
Thanks for the help!
--
Nick_______________________________________________
Nuke-users mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-users