Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Mute Object Animation

    Cinema 4D SDK
    r21 python
    3
    5
    453
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bentraje
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • M
        m_adam
        last edited by

        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.

        MAXON SDK Specialist

        Development Blog, MAXON Registered Developer

        1 Reply Last reply Reply Quote 1
        • B
          bentraje
          last edited by

          @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()
          
          ferdinandF 1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand @bentraje
            last edited by

            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

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 1
            • B
              bentraje
              last edited by

              @zipit

              Gotcha. Thanks for the reminder 🙂

              1 Reply Last reply Reply Quote 0
              • First post
                Last post