Last active
September 24, 2018 19:29
-
-
Save Regnareb/bbc07e33333e6384a632 to your computer and use it in GitHub Desktop.
Disconnect at particle creation with evalDeferred
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
emetteur = cmds.emitter(type='surface', rate=10, scaleRateByObjectSize=False, needParentUV=True, | |
cycleEmission='none', speed=1, speedRandom=0, normalSpeed=1, tangentSpeed=0, | |
maxDistance=0, minDistance=0, dx=1, dy=0, dz=0, spread=0) | |
particules = cmds.nParticle() | |
cmds.evalDeferred(lambda: cmds.disconnectAttr(particules[1] + ".internalOpacityRamp", particules[1] + ".opacityPP"), lowestPriority=True) | |
# Meme chose que la ligne precedente mais passe par une string au lieu d'un lambda. | |
# cmds.evalDeferred('cmds.disconnectAttr("{}.internalOpacityRamp","{}.opacityPP")'.format(particules[1], particules[1]), lowestPriority=True) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment