def minimizeRotationCurves(obj):
rotateCurves = mc.keyframe(obj, attribute=('rotateX','rotateY', 'rotateZ'), query=True, name=True)
if not rotateCurves or len(rotateCurves) < 3: return
keyTimes = mc.keyframe(rotateCurves, query=True, timeChange=True)
tempFrame = sorted(keyTimes)[0] - 1
mc.setKeyframe(rotateCurves, time=(tempFrame,), value=0)
mc.filterCurve(rotateCurves)
mc.cutKey(rotateCurves, time=(tempFrame,))
curve_transforms = [cmds.listRelatives(i, p=1, type='transform')[0] for i in cmds.ls(type='nurbsCurve', o=1, r=1, ni=1)]
for curve in curve_transforms:
minimizeRotationCurves(curve)
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme