【发布时间】:2016-06-28 22:54:25
【问题描述】:
我正在尝试使用 python 在 Maya 中创建一个工具,该工具根据对象关键帧位置创建曲线。最终目标是创建对象可以混合的不同动画曲线,以便对主动画进行调整。这是我到目前为止所拥有的。它创建一条跟随运动路径的曲线,但它不是基于关键帧位置。任何帮助将不胜感激。
import maya.cmds as cmds
def createAnimCurve( startFrame, endFrame, numCV, object ):
curveCVstep = ((endFrame - startFrame)+startFrame)/numCV
points = []
for step in range( startFrame, endFrame, int(curveCVstep)):
# Moves throughout the specified timeline to find point results
cmds.currentTime( step )
# Queries the pivot position to draw the curve relative to the controller
xpos = cmds.xform( object,q=1,ws=1,rp=1 )
# convert the tuple (vector) to a string
points.append(xpos)
cmds.curve(d=3, ws=True, p=points, n=object+'_xPath')
createAnimCurve(1,24,12,"L_hand_CTL")
【问题讨论】:
标签: python animation maya curve keyframe