In Shake you used to be able to disable all motion blur that was being added in your script. It was super useful as it meant you could turn the motion blur off to do colour work etc and then turn it back on when it came time to render. Sadly Nuke does not have this function. However you can run the following piece of code from the Script Editor and it will set all motion blur in your Transform nodes to ‘0’.
Be careful with this however… as when you come to turn the motion blur back on it will set ‘1’ in ALL your Transform nodes that have a motion blur setting… which you possibly didn’t want!
To turn all motion blur off…
x=nuke.allNodes() for n in x: try: n['motionblur'].setExpression(&quot;0&quot;) except: pass
To turn all motion blur on…
x=nuke.allNodes() for n in x: try: n['motionblur'].setExpression(&quot;1&quot;) except: pass
Thinking on this a little further I feel I’ve come up with a better solution and most importantly a much simpler one.
Create a Switch node and then expression link it to the motion blur knob in your Transform nodes (Switch1.which for example). Just change the Switch from ‘0’ to ‘1’ to turn the motion blur on and vice versa to turn it off. That way you can be a lot more selective about which motion blur settings your changing.
Today I came up with an even simpler way to achieve this. Link the motion blur knob to the disable knob in the Switch. Just disabling the Switch in the gui will turn the motion blur off. Place the following in the motion blur expression window…
The ‘!’ is needed to invert the result as ‘1’ is returned when the Switch is disabled.
2 thoughts on “Nuke – Disabling All Motion Blur in Your Script”
Check my script for that if you like it https://www.youtube.com/watch?v=Dmm7NmxhnoQ
LikeLiked by 1 person
Amazing! Many thanks ASDF. I will give it a go.