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
    • Recent
    • Tags
    • Users
    • Register
    • Login

    Dealing with AnimateObject and child objs

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 233 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

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

      On 16/01/2006 at 14:00, xxxxxxxx wrote:

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

      ---------
      Hi,

      I am trying to find the position of an object at any given frame from within a tag.

      So I am doing this

      BaseObject *copy = (BaseObject* )op->GetClone(0,NULL);
      ... calculate new time
      doc->AnimateObject(copy, newTime, ANIMATE_NO_PARTICLES);

      and using the global matrix of the copy object to get the position.

      Now the problem is, op might be a child that has no keyframes, and being animated by its parent.
      The AnimateObject command wont actually tell me where that child object is- because essential the chlid object is not being animated.

      Any solutions for this?

      I have tried Animating the document, and just getting the   objects global position. That worked except, the tag was animating the document and wouldnt let me animate generally in c4d

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

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

        On 16/01/2006 at 14:38, xxxxxxxx wrote:

        My first reaction would be to say that if op is a child of an animated object and has no keyframes on its own, you should check for this and get the 'parent' animated object (if any). AnimateObject() that object.

        Simply set up a loop:

        BaseObject* parent;  
        for (parent = op; parent && !parent->GetFirstTrack(); parent = parent->GetUp());  
        if (parent) // child or parent is animated  
        

        You may want to check further inside the loop to verify the existence of a Sequence and at least one Key.

        There are two possible outcomes:

        1. You need to apply the appropriate matrix set to the child (considering hierarchical parentage from child to animated object).

        2. The child will have been updated and the updated position will be available through the child.

        (2) is the quicker approach (no matrix multiplying) if it works this way.

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