Maxon Developers
    • Downloads
      • All Downloads
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
      • Cinema 4D Python Examples
      • Cinema 4D C++ Examples
      • Project Tool
      • SDK Database
    • Documentation
      • Cinema 4D Python SDK
      • Cinema 4D C++ SDK
      • Cineware SDK
      • ZBrush GoZ SDK
    • Forum
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Forums
      • Overview
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • News & Information
      • Downloads
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Register
    • Login

    exporting keyframes / using animateobject

    SDK Help
    0
    2
    45
    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 31/01/2006 at 02:32, xxxxxxxx wrote:

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

      ---------
      hi there...

      i'm very new to the cinema api...started just 2 days ago to work with it... hmm but the api description is sometimes a bit confusing to me...

      yes... i hear you cry 😉 not again animateobject/keyframes... of course
      i used the search function of the forum...i read all forum posts about this more than once... and searched the net.. but somehow it did't help me...

      what i'm working on a small export filterplugin into a
      custom format...
      so far it works to export polys/points and uv data...
      my goal was to export the animation key frames too...

      1. try to get the animation stuff:

      first of all i tried to do it in coffee... with iterating
      via GetFirstTrack->GetFirstSequence->GetFirstKey and stuff...
      that worked so far... but i could not figure out what kind of
      keys i've got...hm

      beside this i updated to a newer cinema version (9.1) and my the script was overwritten by the installer... very cool feature... so all my work was lost 😕

      anyway so i skipped coffee and tried to do it in c++...i was hoping maybe i can get more infos about the key i get back from the BaseSequence...

      2. try
      now using the c++ api... exporting polys/points/uv are working so far... no problem because of the stl plugin help ;9

      but always i get a NULL pointer from GetFirstTrack...(from object or document doesn't matter)
      of course there is an animation in the document i can see the keys in the
      timeline window... the scene has only one object with a movement and rotation...

      so i gave up iterating the keys and tried to do it via animateobject...

      3. try

      (pseudo code... unfortunately i don't have the source here so i'm writing it just from my mind i did not compile it...maybe some typos in it... but this is just to illustrate what i tried)

      variable i goes from... pDoc->GetMinTime()*pDoc->Fps() to pDoc->GetMaxTime()*pDoc->Fps()

      BaseTime time( i/pDoc->GetFps() );
      pDoc->AnimateObject( pObj, time, ANIMATE_NO_PARTICLES );

      when i access for example..
      pObj->GetPos() / pObj->GetRot()
      also tried pObj->GetMl() or pObj->GetMg()
      there is no change... ok maybe correct...

      then i tried to get the data via GetAnimatedParameter... very like the example in the docu...

      GetAnimatedParameter(DescLevel(ID_OBJECT_POSTION),s1,s2,mix,0);

      Vector pos1 = s1.GetVector();
      Vector pos2 = s2.GetVector();

      that vectors are looking good... but mix is always 0 ? this is what i can't see...

      i checked the time and it looks good too... my sequence has 90 frames so it runs from 0 to 3 (30 fps)...

      so now my questions...

      a) is it correct that i always get a NULL pointer from getfirsttrack ? i remember i read in the forum getfirsttrack doesn't work anymore
      with version x.x of cinema ? if so is there another way to get the keys ?

      or was it just for c.o.f.f.e.e ?

      b) is it correct how it tried to animate the object ?
      why is mix always 0 ?
      or is there a better way to get the animated stuff from the object... ?

      of course i would like to export keys... but if this don't work i would use animateobject... however just want to get it to run somehow 😉

      thanks in advance... ops got a bit long the post...sorry 😉

      ultra 😉

      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 31/01/2006 at 09:09, xxxxxxxx wrote:

        hu...

        hm... thanks for reading... or not 😉

        already found the problem... as i said i copied the stl exporter example source...

        the example does in the save method:
        doc->Polygonize();

        Polygonize has a default parameter keepanimation = FALSE
        so it gave me a doc back without animation...

        hell... what a stupid bug...so finally it works and even how i though it works 😉

        anyway maybe this helps someone out...

        *(/ &%/&%/§(Q$%* 😉

        ultra

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