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

    Find animation associated with a take

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 482 Views
    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 Offline
      Helper
      last edited by

      On 03/01/2018 at 09:19, xxxxxxxx wrote:

      Hey, 
      is there a way to find the corresponding animation of data that is overriden in a certain take ? 
      From the documentation i know, that a BaseTake inherits from BaseList2D , so i should theoretically be able to use GetCTracks() on a Take. Since i get no result, i assume i am searching at the wrong place.

      I think my basic problem is the wrong understanding of how the overrides are actually saved. So here are a few question i have:
      1. when i invoke GetSceneNode() on an override, is this the actual reference to the object in the scene or to a copy ?
      2. How does the **DescriptionID  **of an override work, so that it finds the actual overriden parameter when i invoke GetParameter() ?
      3. Where do i have to search for the animation data of an overriden parameter ?

      I know these are many questions, but i hope that i have a better understanding when these are answered!

      Update 1: Until now the only way to achieve my goal is to set each respective take as the currently active take, get the scene node for each overriden param, and check if there are any animations occuring on this parameter. I hope there is a better way to achieve this.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 04/01/2018 at 07:42, xxxxxxxx wrote:

        Hi,

        BaseOverride.GetSceneNode() returns a reference to the scene node.

        The overridden parameters settings is stored in a BaseOverride. So the animation data for overridden parameters has to be retrieved on this kind of object.
        The following script prints all the override DescIDs and associated tracks (if parameter is animated) for the current take and selected object:

        import c4d
          
          
        def main() :
            if op is None:
                return
          
            takeData = doc.GetTakeData()
            if takeData is None:
                return
          
            take = takeData.GetCurrentTake()
            if take is None:
                return
          
            override = take.FindOverride(takeData, op)
            if override is None:
                return
          
            overridenIDs = override.GetAllOverrideDescID()
            for descid in overridenIDs:
                print descid
                print override.FindCTrack(descid)
          
          
        if __name__=='__main__':
            main()
        

        See Take System Overview in the C++ SDK docs. The Takes API is mostly the same in both C++ and Python.

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 05/01/2018 at 07:29, xxxxxxxx wrote:

          Thanks for the input, this approach make sense to me.
          ~~A last question on this concern: If i want to reassign the ctrack to the override again, is there a way to do it ?  ~~
          At the moment i perform objectToAllocateTackTo.InsertTrackSorted(ctrack).
          This does not seem to be the right way, since the ctrack is visible in the dope sheet, even in the main take
          ~~
          ~~
          Okay i found a solution just after posting this. Obviously i need to insert the track to the override, and not to the scene node.

          Thanks for the help, everything is sorted now!

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