[QUOTE=R.White;31108]The image you attached is to small for me to read.
also cmds.ls() doesn’t select anything, it lists items. cmds.select() is what you’d use to actually select something.
From the code snippet that you’ve pasted though, where does motionPath1 come from? If that is supposed to be the name of your motionpath try
from maya import cmds
locName = 'userSet'
locator = cmds.spaceLocator(n=locName)
motionPath = cmds.pathAnimation(locName, c='curve1')
cmds.discconectAttr(motionPath + '.u')
[/QUOTE]
Here’s a “flow chart” of the script:
Mind you, there are some things that are just filler code until I figure out how I really want to code it, or learn to code it :).
’’’
Setup for facial curve with joint controls
setup window with:
Options:
1) how many locators which determine loop number
2) base name for curves, joints, etc.
3) loops
‘’’
import maya.cmds as mc
locNam=“userSet”
#create window UI
Create locator
mc.spaceLocator(n=locName)
Attach locator to motion path c=userCurve created by user, perhaps force user to select the curve
mc.pathAnimation(locName,c= “userCurve”)
No need to disconnect rotates, as they aren’t connected this way
Instead, break connections of uValue in the input channel of the motionPath(1)
mc.disconnectAttr()
Set value of uValue for each time of loop. index[0,.50,1.0] for 3 points on curve, index [0,.25,.50,.75,1.0]for 5 points
mc.setAttr()
create joint (Offset)
mc.joint()
Parent offset joint to locator
mc.parent(‘child’,‘parent’)
Zero out offset joint’s transforms 0,0,0
mc.setAttr(.tx = 0)
mc.setAttr(.ty = 0)
mc.setAttr(.tz = 0)
Create joint (Control)
mc.joint()
Parent control joint under offset joint
mc.Parent(‘child’, ‘parent’)
Create Nurbs curve(circle, sphere, whatever)
mc.sphere(ax =[0,1,0])
Parent sphere’s shape node under control joint created.
mc.Parent(‘nurbsSphereShape1’,‘joint’)
#commands
‘’’
pathAnimation( [objects] , [bank=boolean], [bankScale=float], [bankThreshold=angle], [curve=string], [endTimeU=time], [endU=float], [follow=boolean], [followAxis=string], [fractionMode=boolean], [inverseFront=boolean], [inverseUp=boolean], [name=string], [startTimeU=time], [startU=float], [upAxis=string], [useNormal=boolean], [worldUpObject=name], [worldUpType=string], [worldUpVector=[float, float, float]])
‘’’