I try to write a code with python API for some purposes.
I can add keyframe with python API below breifly.
apiAttr = MPlug() ## I skipped getting work
arr = api.MObjectArray()
if apiAnim.MAnimUtil.findAnimation(apiAttr, arr):
animCrv.setObject(arr[0])
else:
animCrv.create(apiAttr)
animCrv.addKeyframe(api.MTime(time), value)
It works, so I can keyframe rightly.
But, I think that there is something more to do.
The code can't send "KEYFRAMED" message, it means that MAnimMessage.addAnimKeyframeEditedCallback doesn't works.
And, it's doesn't care about undo and redo queue.
I don't know how to do, so I continously research for that, but I can't find till now.
Is there a common way to send "Animation Message" and add in "Undo Queue"?