Skip to content

Instantly share code, notes, and snippets.

@MitchellKehn
Created January 6, 2021 01:17
Show Gist options
  • Save MitchellKehn/d97840a70851bf0c14049e5484b06677 to your computer and use it in GitHub Desktop.
Save MitchellKehn/d97840a70851bf0c14049e5484b06677 to your computer and use it in GitHub Desktop.
[random rotoshape fill color] sets the fill color of all roto shapes to be a random RGB something. viewer needs a kick in the pants sometimes
import random
rp = nuke.selectedNode()
for element in rp['curves'].rootLayer:
if isinstance(element, nuke.rotopaint.Stroke) or isinstance(element, nuke.rotopaint.Shape):
attrs = element.getAttributes()
attrs.set("r", random.random())
attrs.set("g", random.random())
attrs.set("b", random.random())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment