-
-
Save jonntd/db89ab99f0778c7f419a69270b37270e to your computer and use it in GitHub Desktop.
A test for Maya's falloffCurveAttr control and attribute.
This file contains hidden or 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 | |
| import maya.mel as mel | |
| cmds.group(em=True) | |
| cmds.addAttr(at='float2', ln='testFCurve', m=True) | |
| cmds.addAttr(at='float', ln='testFCurvePosition', p='testFCurve', dv=-1) | |
| cmds.addAttr(at='float', ln='testFCurveValue', p='testFCurve', dv=-1) | |
| cmds.setAttr('.testFCurve[0]', 0, 0) | |
| cmds.setAttr('.testFCurve[1]', .5, 0) | |
| cmds.setAttr('.testFCurve[2]', .5, 1) | |
| cmds.setAttr('.testFCurve[3]', 1, 1) | |
| cmds.window(t='falloffCurve') | |
| f = cmds.formLayout() | |
| c = cmds.falloffCurveAttr(at='.testFCurve') | |
| cmds.formLayout(f, e=True, af=((c, 'top', 0), (c, 'bottom', 0), (c, 'left', 0), (c, 'right', 0))) | |
| cmds.showWindow() | |
| cmds.addAttr(ln='testRamp', at='compound', nc=3, m=True) | |
| cmds.addAttr(ln='testRamp_Position', at='float', p='testRamp', dv=-1) | |
| cmds.addAttr(ln='testRamp_FloatValue', at='float', p='testRamp', dv=-1) | |
| cmds.addAttr(ln='testRamp_Interp', at='enum', en='None:Linear:Smooth:Spline', dv=1, min=0, max=3, p='testRamp') | |
| cmds.setAttr('.testRamp[0]', 0, 0, 2) | |
| cmds.setAttr('.testRamp[1]', 1, 1, 2) | |
| cmds.window(t='ramp') | |
| cmds.columnLayout() | |
| mel.eval('if (! exists("AEmakeLargeRamp")) source AEaddRampControl') | |
| mel.eval('AEmakeLargeRamp("%s.testRamp", 0, 0, 0, 0, 0)' % cmds.ls(sl=True)[0]) | |
| cmds.showWindow() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment