Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware 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

    Xpresso python tag issue

    Cinema 4D SDK
    2025 python
    2
    5
    728
    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
      arjo
      last edited by

      This script in the xpresso python tag works fine in Cinema 4D R19 but it doesn't work in higher versions. When I click on compile it says "no errors". The script should write spline data that I use in a range mapper node. But when I connect the output ports to the range mapper spline input port both the python and the range mapper turn yellow. Does anybody have an idea why this works in older versions of Cinema 4D but not in 2025?

      import c4d
      import math
      
      def main():
          global steps #number of steps
          global stepsize #size of each step
          global skidstep #spline data for range mapper
          global returnstep #spline data for range mapper
      
          points = steps * 2
          Xstep = 1 / points
          Ystep = 1 / steps
      
          points = points + 1
          skidstep = c4d.SplineData()
          skidstep.MakePointBuffer(points)
          returnstep = c4d.SplineData()
          returnstep.MakePointBuffer(points)
      
          X = 0
          Ya = 0
          Yb = 1
          step = 0
      
          while step < points:
              vec_A = c4d.Vector(X, Ya, 0)
              vec_B = c4d.Vector(X, Yb, 0)
              skidstep.SetKnot(step, vec_A)
              returnstep.SetKnot(step, vec_B)
              X = X + Xstep
              step = step + 1
              if step % 2 != 0:
                  Ya = Ya + Ystep
                  Yb = 0
              else:
                  Yb = 1
      
      
      
      
      ferdinandF 1 Reply Last reply Reply Quote 0
      • ferdinandF
        ferdinand @arjo
        last edited by

        Hello @arjo,

        Thank you for reaching out to us. Without your scene file there is not much what we can do for you. That code, at a glance, is correct.

        Cheers,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        A 1 Reply Last reply Reply Quote 0
        • A
          arjo @ferdinand
          last edited by

          @ferdinand skidding.c4d

          ferdinandF 1 Reply Last reply Reply Quote 0
          • ferdinandF
            ferdinand @arjo
            last edited by ferdinand

            Hey @arjo,

            There are errors in your console, and they tell you exactly what the issue is. Your steps variable is not an integer and MakePointBuffer expects an integer for its number of points.

            Cheers,
            Ferdinand

            Before
            Screenshot 2025-04-10 at 10.16.26.png

            and after, I just cast points to int:
            Screenshot 2025-04-10 at 10.18.55.png

            MAXON SDK Specialist
            developers.maxon.net

            1 Reply Last reply Reply Quote 0
            • A
              arjo
              last edited by

              Ah, super! thank you.

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