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

    moving tracks spreaded on childobjects

    SDK Help
    0
    3
    266
    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
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 15/07/2008 at 08:18, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   10 
      Platform:      
      Language(s) :     C++  ;

      ---------
      Hi!
      If got a rather complex object, the root is a nullobject, follwed by a bunch of childobjects, which again can have childobjects a lot of them have animationtracks.
      I want to move tese tracks to a startframe, but ofcourse without messing up the whole animation.

      Is there an easy way to do this?
      The root- (null)object doesnt have any tracks 😞

      Or do I have to go through all objects (getdown, getnext), find the first key in the timeline (reference point in time, so the keydistances dont get messed up), then go through all objects/tracks again to move the keys?

      Could GetCTrackRoot() help? What does it do?

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

        THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

        On 15/07/2008 at 12:21, xxxxxxxx wrote:

        As far as I know, yes, you'll have to through each object and get its tracks and move the keys. For getting the objects in a hierarchy, use a recursive function like this (first call with Null object in argument) :

        //*---------------------------------------------------------------------------*
        void ObjectRecurse(BaseObject* obj)
        //*---------------------------------------------------------------------------*
        {
             for (; obj != NULL; obj = obj->GetNext())
             {
                  MoveKeys(obj);
                  if (obj->GetDown())     ObjectRecurse(obj->GetDown());
             }
        }

        For each object, you can simply loop through all of its tracks:

        CCurve* ccv;
        for (CTrack* trk = obj->GetFirstCTrack(); trk != NULL; trk = trk->GetNext())
        {
             // Go through keys on CCurve
             ccv =     trk->GetCurve();
             ...
        }

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

          THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

          On 16/07/2008 at 01:28, xxxxxxxx wrote:

          Thanks Robert, saves me some work 🙂

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