SOLVED Mute Object Animation

Hi,

Is there a way to mute object animation using python?

Here's how to do it manually through the timeline editor:
https://www.dropbox.com/s/mact0ls02mq7mh4/c4d277_mute_object_animation_python.mp4?dl=0

Regards,
Ben

Hi @bentraje this is the parameter ID_CTRACK_ANIMOFF.

So here ho to disable the first track of an animated object.

track = op.GetFirstCTrack()
track[c4d.ID_CTRACK_ANIMOFF] = False
c4d.EventAdd()

Cheers,
Maxime.

@m_adam

Thanks for your response. Works as expected.

    for track in op.GetCTracks(): # Just to get all tracks at once. 
        track[c4d.ID_CTRACK_ANIMOFF] = 0
        
    c4d.EventAdd()

Hi,

@bentraje said in Mute Object Animation:

 track[c4d.ID_CTRACK_ANIMOFF] = 0

one could consider this nitpicky, but you should be careful with GeListNode.__setitem__ and your input types. Here it probably will not matter, but ID_CTRACK_ANIMOFF is a boolean parameter and you rely on the fact that GeListNode.__setitem__ is interpreting the passed integer literal as the correct boolean literal. If one is not using the specific function on the data container, i.e. SetBool, I would always make sure to be as precise as possible with my data types, having all the oopsies in mind that can happen with filename and string parameters in containers and mixing them up.

Cheers,
zipit

@zipit

Gotcha. Thanks for the reminder 🙂