def setAnimValue(plug, value, tangentType=None):
'''
Sets key if the channel is keyed, otherwise setAttr
'''
if mc.keyframe(plug, query=True, name=True):
mc.setKeyframe(plug, value=value)
if tangentType:
time = mc.currentTime(query=True)
itt = tangentType
ott = tangentType
if tangentType == 'step':
itt = 'linear'
mc.keyTangent(plug, time=(time,), edit=True, itt=itt, ott=ott)
mc.setAttr(plug, value)
评论列表
文章目录