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

    Reading The Spline User Data - How?

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 376 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 27/06/2012 at 17:23, xxxxxxxx wrote:

      Hi, I am almost new to scripting in C4D, but not new to programming. I want to use the User Data Spline interface, and wonder how I can read out the values. I have added a null object to my project. To this object I added an xpresso tag. In the xpresso I added a Python operator.
      The Python operator has one user data value, with a Spline interface.

      Now - how do I read out the values from this interface? I guess C4D does the math behind the scenes for me? So that I can get the Y value for any given X value between 0 (min) and 1 (max).

      Any help much appreciated!

      -Ingvar
      Spline user data

      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 27/06/2012 at 17:50, xxxxxxxx wrote:

        For simplicity, add your position controller and the Spline as Userdata on the xpresso tag.
        The nodes already have a SplineData input (I called "curve" in the example).

        Cheers
        Lennart

        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 27/06/2012 at 18:28, xxxxxxxx wrote:

          Hej Lennart, tack söta bror!!!!
          Just great. Having searched for this several hours, you came up with the solution in minutes!
          As a matter of fact, I want to wrap everything in a Python script, and not use xpresso operators at all. So I use this code:
           
              foo = op[c4d.ID_USERDATA,1]
              somePosition = 0.6
              print int(foo.GetPoint(somePosition).y * 100)
           
          This gives me the percentage at position 0.6, where the spline user data scale is Max 1 on the X-axis and Max 1 on the Y axis. Precisely what I am after. The Spline User Data control is invaluable, and now I know how to use it !Approve[URL-REMOVED]
          Thanks again for your help!
           
          -Ingvar


          [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

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