Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    HOW TO Turn off the auto tangent checkbox on keyframes using python API

    Cinema 4D SDK
    python windows 2023 2024
    3
    4
    712
    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.
    • H
      heytraile
      last edited by

      Hi, I'd like to know how to turn off the Auto Tangents and Remove Overshooting checkbox on keys in C4D using the python API. I wrote a tool to bring keyframe data from C4D to other applications but with Auto Tangents and Remove Overshooting on, I'm getting differences in my tangents. Once I turn them off and run my tool again, I'm getting the correct results.

      There is the

      CKey.SetAutomaticTangentMode
      

      but it does nothing for me. Is there a way to do this with the API? I've attached an image to show the checkboxes I'm referring to.
      90a6b688-ce43-41fe-abf8-9797a46b3ba6-image.png

      Thanks in advance.

      i_mazlovI 1 Reply Last reply Reply Quote 0
      • K
        kng_ito
        last edited by kng_ito

        Hi,
        These can be used for doing so.

        CKey.ChangeNBit(c4d.NBIT_CKEY_AUTO, False)
        CKey.ChangeNBit(c4d.NBIT_CKEY_REMOVEOVERSHOOT, False)
        

        By the way, if you want to get correct value of tangents, CCurve.GetTangents() should work correctly, instead of using CKey.GetTimeLeft, etc.

        1 Reply Last reply Reply Quote 1
        • i_mazlovI
          i_mazlov @heytraile
          last edited by

          Hi @heytraile ,

          Welcome to the Maxon developers forum and its community, it is great to have you with us!

          Getting Started

          Before creating your next postings, we would recommend making yourself accustomed with our forum and support procedures. You did not do anything wrong, we point all new users to these rules.

          • Forum Overview: Provides a broad overview of the fundamental structure and rules of this forum, such as the purpose of the different sub-forums or the fact that we will ban users who engage in hate speech or harassment.
          • Support Procedures: Provides a more in detail overview of how we provide technical support for APIs here. This topic will tell you how to ask good questions and limits of our technical support.
          • Forum Features: Provides an overview of the technical features of this forum, such as Markdown markup or file uploads.

          It is strongly recommended to read the first two topics carefully, especially the section Support Procedures: Asking Questions.

          About your First Question

          Function c4d.SetAutomaticTangentMode() is meant to change the value of the "Angle" attribute and in my opinion is just poorly named.

          What you actually need to do is to execute function ChangeNBit() (@kng_ito, thank you for providing fast answer). However, the usage kng_ito showed above is not 100% correct. Namely, you'd need to use one of the NBITCONTROL values. In case you want to remove these checkboxes, the code would be:

          key.ChangeNBit(c4d.NBIT_CKEY_AUTO, c4d.NBITCONTROL_CLEAR)
          key.ChangeNBit(c4d.NBIT_CKEY_REMOVEOVERSHOOT, c4d.NBITCONTROL_CLEAR)
          

          You can also find some code examples on how to work with animation related data in our repository, e.g. CTrack Create Keys

          Cheers,
          Ilia

          MAXON SDK Specialist
          developers.maxon.net

          H 1 Reply Last reply Reply Quote 0
          • H
            heytraile @i_mazlov
            last edited by

            @i_mazlov Thanks much for explanation.

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