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
    • Login

    Xpresso COFFEE keyframe trouble

    Scheduled Pinned Locked Moved SDK Help
    2 Posts 0 Posters 191 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 20/11/2008 at 17:43, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11 
      Platform:      Mac OSX  ; 
      Language(s) :   C.O.F.F.E.E  ;   XPRESSO  ;

      ---------
      Hi,

      I've had success moving keyframes with both a COFFEE tag and also a COFFEE Xpresso node, in both the editor and renderer (picture viewer), with animation tracks, using this code:

      main()
      {
           var doc = Input1->GetDocument(); // when in Xpresso
           var obj = doc->FindObject("Cube");
           var track = obj->GetFirstCTrack();
           var myKey = track->GetCurve()->GetKey(0); // key 0 is first key
           var time = new(BaseTime);
           time->SetFrame(5,doc->GetFps()); // move to frame 5...
           myKey->SetTime(track->GetCurve(),time);
      }

      However, when it comes to moving a keyframe on a Tag, the code works in a COFFEE tag in both the editor and renderer, but only in the editor with a COFFEE Xpresso node:

      main()
      {
           var doc = Input1->GetDocument(); //when in Xpresso
           var obj = doc->FindObject("Cube")->GetFirstTag();
           var track = obj->GetFirstCTrack();
           var myKey = track->GetCurve()->GetKey(0); // key 0 is first key
           var time = new(BaseTime);
           time->SetFrame(5,doc->GetFps()); // move to frame 5...
           myKey->SetTime(track->GetCurve(),time);
      }

      ... when rendering and using Xpresso the line 'var myKey...' throws the error (5) Incompatible values... NIL / OBJECT

      Can anyone please shed any light on this?

      Thanks

      Jon

      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 21/11/2008 at 03:24, xxxxxxxx wrote:

        OK, I eventually figured the tag wasn't being recognised at all, and with a bit of hunting learnt that when rendering in the picture viewer an invisible tag is placed as the first tag (pretty obvious huh!?!?)

        Here's a way around it:

        main()
        {
             var doc = Input1->GetDocument(); // when in Xpresso
             var obj = doc->FindObject("Cube");
             var tagb = obj->GetFirstTag();
             if(doc!=GetActiveDocument()){ // if rendering...
                  tagb = tagb->GetNext();     // skip invisible tag
             };
             var track = tagb->GetFirstCTrack();
             var myKey = track->GetCurve()->GetKey(0); // key 0 is first key
             var time = new(BaseTime);
             time->SetFrame(5,doc->GetFps()); // move to frame 5...
             myKey->SetTime(track->GetCurve(),time);
        }

        Ta

        Jon

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