gpt4 book ai didi

python - 玛雅/ python : How do I scale multiple selected animation curves each from their own specific pivot point?

转载 作者:行者123 更新时间:2023-11-28 17:34:37 25 4
gpt4 key购买 nike

我正在尝试对多条动画曲线进行缩放操作,每条曲线都使用其最低键作为轴心点。我认为它应该是一个嵌套的 for 循环结构,但未能使其正常工作。

缩放很简单,只是:

mykeys = pm.keyframe( query=True, valueChange=True, absolute=True )
low = min(mykeys)
pm.scaleKey( valuePivot=low, valueScale=1.5 )

我在想它应该类似于什么?

selectedCurves = pm.listConnections( t="animCurve")
for curve in selectedCurves:
mykeys = pm.keyframe( query=True, valueChange=True, absolute=True )
low = min(mykeys)
pm.scaleKey( valuePivot=low, valueScale=1.5 )

提前致谢。

最佳答案

你是对的,你只是没有告诉命令一次只处理一条曲线:

selectedCurves = cmds.listConnections( t="animCurve")
for curve in selectedCurves:
mykeys = cmds.keyframe(curve, query=True, valueChange=True, absolute=True )
low = min(mykeys)
cmds.scaleKey(curve, valuePivot=low, valueScale=1.5 )

关于python - 玛雅/ python : How do I scale multiple selected animation curves each from their own specific pivot point?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31741651/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com