ValueY on Fcurve at time T



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

    On 06/06/2005 at 12:03, xxxxxxxx wrote:

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

    ---------
    Hi!  I study SDKV8. I want to get "value Y" on Fcurve at" time T(or parameterT for Path)".
    Now, I made Tag Parameter Track"ALIGNTOSPLINETAG_POSITION".
    key1_Value=(t=0,y=0),key2_Value=(t=1,y=1).(range 0<t<1,0<y<1).
    Several key knot handle moved,Fcurve is curved  Spline.I want to value Y at time t(interpolation key1and key2).
    BaseTag   *tag  =((BaseObject* )op)->GetTag(Taligntospline);
    BaseTrack *track= tag-> FindTrack(DescLevel(ALIGNTOSPLINETAG_POSITION));
    Please teach me some sentenses from here.



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

    On 06/06/2005 at 13:35, xxxxxxxx wrote:

    You need to animate the document to the time, and then it's just a matter of getting the value from the object as you would get it normally.

    This code fragment is used to do value checks on an animation using an "indexLimits" structure. So, you'll want to get the id's from the Track instead. Here, 'direct' means that it's a Position/Scale/Rotation Track. Otherwise, it's an XPresso track. This is just to give you an idea on how it's done - not exact for your situation.

      
    BaseDocument* doc;  
    BaseObject* obj;  
    BaseTime currentTime; // Set to time T at current FPS  
      
                   doc->AnimateObject(obj, currentTime, 0);  
                   // Get values  
                   if (indexLimits->direct)  
                   {  
                        if (indexLimits->id[0].id == ID_BASEOBJECT_POSITION)  
                        {  
                             if (indexLimits->id[1].id == VECTOR_X)          value = obj->GetPos().x;  
                             else if (indexLimits->id[1].id == VECTOR_Y)     value = obj->GetPos().y;  
                             else if (indexLimits->id[1].id == VECTOR_Z)     value = obj->GetPos().z;  
                        }  
                        // Angular values in Degrees  
                        else if (indexLimits->id[0].id == ID_BASEOBJECT_ROTATION)  
                        {  
                             if (indexLimits->id[1].id == VECTOR_X)          value = Deg(obj->GetRot().x);  
                             else if (indexLimits->id[1].id == VECTOR_Y)     value = Deg(obj->GetRot().y);  
                             else if (indexLimits->id[1].id == VECTOR_Z)     value = Deg(obj->GetRot().z);  
                        }  
                   }  
                   else  
                   {  
                        obj->GetParameter(indexLimits->id, data, 0);  
                        // Keep all angular values in Degrees  
                        if (indexLimits->angular) value = Deg(data.GetReal());  
                        else value = data.GetReal();  
                   }  
    


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

    On 07/06/2005 at 12:41, xxxxxxxx wrote:

    Thanks Your Idea!! I'm glad to 'ƒ''''''…'"'''Ž'"'…'Ž'ƒ'… rapidly  for my question.
    What I want to do is following .
    There are Two objects("my  obj"and "spline")in the scene. "my obj" align to "spline" with  Tag(aligntospline).
      "my obj" rotate in one axis  in moving. I want give Degree Rotate to"my obj". I'm going to give The degree from Tag Animation Value(
    It's Fcurve Y axis at T(time) in Track(ALIGNTOSPLINETAG_POSITION)  ).
     The Fcurve Y is parametric value  for path.  I want to know Y,this question is difficult ? How to '…'˜'"''''ƒ'"  Fcurve Y at Time.

    -------------
    pierre



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

    On 07/06/2005 at 15:36, xxxxxxxx wrote:

    First of all, ALIGNTOSPLINETAG_POSITION is not a vector, it's a Real value. If that is what is being animated, then the value represents the Y displacement along the F-Curve. The F-Curve X axis is always time.

    No, it isn't difficult. You just have to understand the example that I showed has all of the pertinent information. Here is how it should be done directly:

      
    // These three are being passed as function arguments, right?  
    BaseDocument* doc;  
    BaseList2D* op;  
    BaseTime time;  
      
    Bool Function(BaseDocument* doc, BaseList2D* op, BaseTime time)  
    {  
         // Function-scope variables  
         BaseTag* tag;  
         BaseTrack* track;  
         GeData data;  
         Real value;  
           
         if (!(tag = ((BaseObject* )op)->GetTag(Taligntospline))) { GePrint("No such Tag on Object"); return FALSE; }  
         if (!(track = tag->FindTrack(DescLevel(ALIGNTOSPLINETAG_POSITION)))) { GePrint("No such Track on Tag"); return FALSE; }  
      
         // Animate Document to get values with respect to 'time'  
         doc->AnimateObject(op, time, 0);  
         tag->GetParameter(DescLevel(ALIGNTOSPLINETAG_POSITION), data, 0);  
         // This is the Fcurve Y 'value' for ALIGNTOSPLINETAG_POSITION at time 'time'  
         value = data.GetReal();  
         // Do your thing using 'value'  
         //...  
         return TRUE;  
    }  
    

    Does this make more sense?



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

    On 08/06/2005 at 13:55, xxxxxxxx wrote:

    Thanks Robert!! I understand for the most part  that your explain and example this time. I feel like doing it the way.
    I explored one sentence prepared C4DSDK for valueY from Fcurve side  until now.
    I appreciate advice and detailed explanations.
    Thanks very much Robert!
    -------------
    Pierre


Log in to reply