Skip to content

Instantly share code, notes, and snippets.

@tokejepsen
Created January 23, 2015 12:29
Show Gist options
  • Save tokejepsen/e7107f4c610e91214cfd to your computer and use it in GitHub Desktop.
Save tokejepsen/e7107f4c610e91214cfd to your computer and use it in GitHub Desktop.
Maya: Paint Effects
import pymel.core as pm
import maya.mel as mel
for node in pm.ls(type='stroke'):
cmd = 'applyPresetToNode "%s" "" "" "ghost" 1;' % node
mel.eval(cmd)
for node in pm.ls(type='brush'):
cmd = 'applyPresetToNode "%s" "" "" "ghost" 1;' % node
mel.eval(cmd)
import random
for node in pm.ls(type='brush'):
node.gapSize.set(random.uniform(0.1, 0.5))
node.gapSpacing.set(random.uniform(0.5, 1.0))
node.gapRand.set(random.uniform(0.1, 0.5))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment