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

    ValueY on Fcurve at time T

    Scheduled Pinned Locked Moved SDK Help
    5 Posts 0 Posters 373 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 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.

      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 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();  
                       }  
        
        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 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

          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 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?

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

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