keyframing PLA ?



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

    On 20/10/2003 at 13:02, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.207 
    Platform:   Windows  ;   
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    I'm beginner - and this is my first coffee project. Fort the sake of learning, I'm trying to put together an expression that will generate a PLE track and sequence for a "master" object and then generate PLA keyframes using point data from a sequence of "morph" objects - one for every keyframe.
    As for the first part - I managed to put it together without problems - my expression generates a PLA track, sequence and keyframes. The only problem is that the generates keyframes don't work. When I start the expression, the "master" object start changing rapidly (according to the "morph" data, received by the expression) and then it keeps the form, given to it by the last "morph" object in the sequence. It looks like the different in-between forms don't get recorded in the keyframes. When I hit PLAY button - the keyframes are there but the object doesn't change its shape...
    My expression, after creating track and sequence and inserting them into an object, starts a loop. In the loop, it
    (1) finds tha right "morph" object for the frame,
    (2)extracts point data from it using GetPoints() and stores it into an array
    (3)writes the array to the "master" object using SetPoints(array)
    (4) creates a new PLA key
    (5) creates a Time Object and sets the time into it
    (6) inserts time into the PLA Key using SetTime(t)
    (7) inserts the PLA key into the sequence using InsertKey()
    Then it loops to next keyframe
    What am I doing wrong?
     
    Thanks for your patience,



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

    On 20/10/2003 at 15:33, xxxxxxxx wrote:

    here's what it looks like for now:
    // The number of keys created ranges from
    const var START_KEY=0, END_KEY=29;
    const var OBJECT="RefFigure";
    > main(doc,op)
    > {
    >  // Find the object the user has specified
    >  var obj=doc->FindObject("_"+OBJECT);
    >  if (!obj) { println("Can't find the object"); return; }
    >
    >  // Get document frame rate
    >  var fps=doc->GetFps();
    >  if (!fps) { println("Can't retrieve the frame rate of the document"); return; }
    >
    >  // Create a new PLA track
    >  var pt=new(PLATrack);
    >  if (!pt) { println("Can't create a new PLA track"); return; }
    >  
    > // Create a new sequence
    >  var seq=new(PLASequence);
    >  if (!seq) { println("Can't create a new sequence"); return; }
    >  
    >  // Create time keys for the start and end of the sequence
    >  var start=new(BaseTime);
    >  if (!start) { println("Couldn't allocate a start time"); return; }
    >  start->SetFrame(START_KEY,fps);
    >
    >  var end=new(BaseTime);
    >  if (!end) { println("Couldn't allocate an end time"); return; }
    >  end->SetFrame(END_KEY,fps);
    >  
    >  // use them to set the length of the sequence
    >  seq->SetT1(start);
    >  seq->SetT2(end);
    >  
    >  // Insert the sequence into the track
    >  if ( !(pt->InsertSequence(seq)) ) { println("Couldn't insert sequence into track"); return; }
    >
    >  // insert the track into the object
    >  if ( !(obj->InsertTrack(pt,NULL)) ) { println("Couldn't insert track into object"); return; }
    >
    >  // Here's the loop for creating the keys :-)
    >  var n;
    >  for (n=START_KEY; n<=END_KEY; n++) {
    >
    >
    >   // Find the morph object
    >   var mobj=doc->FindObject("Bejba"+tostring(n));
    >   if (!obj) { println("Can't find the morph object"); return; }
    >
    >   if (!instanceof(mobj,PointObject)) { println("not a point object"); return; }; // not a point object
    >
    >   var i,cnt = mobj->GetPointCount(); if (!cnt) { println("no points, nothing to do"); return; }; // no points, nothing to do
    >
    >   var arr = mobj->GetPoints(); if (!arr) { println("no data"); return; }; // get original points
    >
    >
    >   obj->SetPoints(arr); // write extracted points to Reference Figure
    >   obj->Message(MSG_UPDATE); // notify object of change  
    >
    >
    >  
    >   // Create a new PLA key
    >   var pk=new(PLAKey);
    >   if (!pk) { println("Couldn't get a new PLA key"); return; }
    >  
    >   // Create a time object and set the time into it
    >   var t=new(BaseTime);
    >   if (!t) { println("Couldn't create a time object"); return; }
    >   t->SetFrame(n,fps);
    >  
    >  
    >  
    >   // Put the values back into the new PLA Key
    >   pk->SetTime(t);
    >
    >   // Next, insert the PLA key
    >   if ( !(seq->InsertKey(pk)) ) { println("Couldn't insert the PLA Target Key"); return; }
    >   }
    >
    > //stop the execution of the expression by changing name
    >  obj->SetName(OBJECT);
    > }



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

    On 20/10/2003 at 16:41, xxxxxxxx wrote:

    After a couple of hours of studying the SDK I came to the conclusion that instead of filling the "master" object with extracted points data, it might be a better idea to fill the PLA Key with it, using SetPointTag() and SetData.
    so, here's what the loop part looks like now:
    ..... 
    // Here's the loop for creating the keys :-)
     var n;
     for (n=START_KEY; n<=END_KEY; n++) {

    >
    > _   // Find the morph object
    >   var mobj=doc->FindObject("Bejba"+tostring(n));
    >   if (!obj) { println("Can't find the morph object"); return; }_
    >
    > _   if (!instanceof(mobj,PointObject)) { println("not a point object"); return; }; // not a point object_
    >
    > _   var i,cnt = mobj->GetPointCount(); if (!cnt) { println("no points, nothing to do"); return; }; // no points, nothing to do_
    >
    > _   var arr = mobj->GetPoints(); if (!arr) { println("no data"); return; }; // get original points
    >   
    >  
    >   // Create a new PLA key
    >   var pk=new(PLAKey);
    >   if (!pk) { println("Couldn't get a new PLA key"); return; }
    >  
    >   // Create a time object and set the time into it
    >   var t=new(BaseTime);
    >   if (!t) { println("Couldn't create a time object"); return; }
    >   t->SetFrame(n,fps);
    >   
    >   // Create a Point Tag
    >   var ptg = new(PointTag);
    >   ptg->SetData(arr); 
    >  
    >  
    >   // Put the values back into our new PLA Key
    >   pk->SetTime(t);
    >   pk->SetPointTag(ptg);_
    >
    > _   // Now insert the PLA key
    >   if ( !(seq->InsertKey(pk)) ) { println("Couldn't insert the PLA Target Key"); return; }
    >   }_
    ....
    **** 
    BUT NO IMPROVEMENT!
    (hm, this is beginning to look like a monologue. Is anybody -except me- reading and following  this?)



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

    On 21/10/2003 at 15:05, xxxxxxxx wrote:

    take a look here:

    http://www.plugincafe.com/forum/display_topic_threads.asp?ForumID=4&TopicID;=242&SearchPagePosition;=1&search;=PLA&searchMode;=allwords&searchIn;=Topic&forum;=4&searchSort;=dateDESC&ReturnPage;=Search

    you can find this thread also with the forum search ("PLA")



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

    On 22/10/2003 at 01:18, xxxxxxxx wrote:

    Klaus thanks,
    Next time I'll search the forum more throughly first


Log in to reply