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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    py node get animated value by frame

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 845 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

      On 24/06/2018 at 08:29, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :

      ---------
      Hi There,

      I right now am setting up a car rig. and there are always problems with the memory node in xpresso, as it is dependent on the framerate in the editor.
      It fluctuates a lot.

      I need to calculate speed and acceleration.

      I was wondering, If there is a posibility to read out the values of an animated value (f.e. Userdata) by frame or time.

      something like:
      read_fcurve_value(frame)

      then I could read the value for the actual frame and the frame before and should get stable values.

      Unfortunately my python skills are not exceptional good (that means they are quite bad 🙂

      maybe someone could give me a hint or a code snipped. that would be very appreciated.

      thanks a lot
      Jops

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 26/06/2018 at 02:22, xxxxxxxx wrote:

        Hi Jops,

        First of all SDK Help category is more about C++, while you question is more pythonic if I'm right, then please next time use the correct category (Python Development). 🙂

        About your question, to get value from Fcurve you have to get the correct Ctrack, then the Ccurve and finally you can have the value.

            cTrack = op.GetFirstCTrack()
            cCurve = cTrack.GetCurve()
            value = cCurve.GetValue(doc.GetTime())
        

        For more information, you can read the C++ manual about Animation. Even if it's in C++ you can find some valuable information for python.
        Please note that using this method you will only get value from Keyframe, no dynamic.

        Hope it's helpful, and if you have any other question please let me know.
        Cheers,
        Maxime

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