Brendan Abel
Brendan Abel

Reputation: 37549

Detect when a keyframe is set on an attribute in Maya?

I'm trying to trigger a script to run when a keyframe is set in Maya. I'm currently using scriptJob's to trigger scripts on the timeChanged event and when certain attributes change, but I've not found an event for when a keyframe is set.

Is there a way to detect when a keyframe is set in maya and trigger a script to run when this happens?

Upvotes: 1

Views: 656

Answers (1)

Achayan
Achayan

Reputation: 5895

You can relay on MAnimMessage Docs .This callback can help you to find the keyframe action and plug a callback eg :

OpenMayaAnim.MAnimMessage.addAnimKeyframeEditedCallback( obj.addKeyframeDelta, None)

Upvotes: 3

Related Questions