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

    CCurve.GetValue() with Track Before & After Functions

    Cinema 4D SDK
    python s22 sdk
    2
    3
    438
    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.
    • ?
      A Former User
      last edited by A Former User

      Hi,
      I'm using CCurve.GetValue(), but it only seems to work when there is an actual curve, not when there is a Track Before or After Function. Is there a way to get the value of the attribute with CCurve.GetValue() when using these functions?

      Track_Before_After.png

      Thank you!

      1 Reply Last reply Reply Quote 0
      • ManuelM
        Manuel
        last edited by

        hi,

        i create a simple example and it's working here. Just some precision issue (39.99999 instead of 40) but nothing too strange.
        There's also this thread that could help you.
        If you need to use the curve, you have to use the Remap function.

        import c4d
        from c4d import gui
        
        
        # Main function
        def main():
            tracks = op.GetCTracks()
            fps = doc.GetFps()
            time  =  c4d.BaseTime(20, fps)
            for track in tracks:
                print track.GetValue(doc, time, fps)
                curve = track.GetCurve(c4d.CCURVE_CURVE)
                if curve:
                    newTime = track.Remap(time.Get())['ret_time']
                    newTime = c4d.BaseTime(newTime)
                    print curve.GetValue( newTime, fps)
                
                
            
        
        # Execute main()
        if __name__=='__main__':
            main()
        

        Cheers,
        Manuel

        MAXON SDK Specialist

        MAXON Registered Developer

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @Manuel
          last edited by

          @m_magalhaes Remap did the trick! Thanks for the help, Manuel 😃

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