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

    using spline graph user data in python for remap

    Scheduled Pinned Locked Moved PYTHON Development
    2 Posts 0 Posters 272 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 05/05/2016 at 08:33, xxxxxxxx wrote:

      I'm trying to find different methods for remapping values in python, like the range mapper in xpresso.
      I'd like to make a python xpresso node which accepts "spline" user data for remapping data coming into its other inlets.

      I know if I'm using xpresso its seems pointless to do this since I can just make an xpresso range mapper node and plug my spline data into that, but I'd like to learn if its possible to it using python only, and see what different approaches there might be.

      At the moment it looks like I should use "c4d.utils.Smoothstep(a, b, x)", but I don't think its possible to define the curve?
      It says 
      The mapping is smoothed using an ease-in/ease-out curve.
      Parameters:|

      • a  (float) – The float value.
      • b  (float) – The float value.
      • x  (float) – The float value.
      Return type:

      float

      Returns:|
      The smoothed value.

      _<_t_>_

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

        On 06/05/2016 at 01:57, xxxxxxxx wrote:

        Hi,

        The Python function similar to the XPresso RangeMapper node is c4d.utils.RangeMap().
        The curve optional argument defines the spline to use and it accepts a SplineData object.

        Note RangeMap() currently gives wrong results when clamping the output value if clampval argument is True. This issue will be fixed soon.

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