Request: A shortcut key to toggle the motion blur in roto node between, 16 and 2

I want a script to toggle the motion blur in roto node to toggle between 16 and 2. Also I want to assign a shortcut to it.

Can someone help, please?

This snippet which overrides the current “Toggle Motion Blur” bind will do it. You can paste this into your Preferences->Scripting->Startup Script box.

def toggleNodeMotionBlur():
	n = activeNode()
	if n:
		p = n.property("motionBlur.samples")
		if p:
			beginUndo("Toggle Motion Blur Samples")
			if p.value < 16:
				p.value = 16
			else:
				p.value = 2
			endUndo()

bind("ctrl+shift+m", toggleNodeMotionBlur)
2 Likes

You are awesome, thanks!