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

    Python-Generated Splines are not recognized by Cloner Object

    Cinema 4D SDK
    python 2023
    2
    3
    575
    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.
    • K
      kng_ito
      last edited by

      Hi,

      I have a Python Generator Object that returns a Spline Object. I want to use this spline for the distribution of a Cloner Object, but it does not generate any clones on the spline.
      The spline works fine when used for Generators such as Sweep, Extrude, Loft etc.

      The Python Generator Code:

      import c4d
      
      def main():
          spline = c4d.SplineObject(pcnt=4, type=c4d.SPLINETYPE_LINEAR)
      
          spline.ResizeObject(pcnt=4, scnt=1)
      
          spline.SetPoint(id=0, pos=c4d.Vector(0, 0, 0))
          spline.SetPoint(id=1, pos=c4d.Vector(100, 100, 100))
          spline.SetPoint(id=2, pos=c4d.Vector(200, 200, 200))
          spline.SetPoint(id=3, pos=c4d.Vector(300, 300, 300))
      
          spline.SetSegment(id=0, cnt=4, closed=False)
      
          spline.Message(type=c4d.MSG_UPDATE)
      
          return spline
      

      The Scene File:
      PyGenSplineAndCloner.c4d

      I would appriciate it if you could check to see if it is a bug or I am missing somthing in the code.

      1 Reply Last reply Reply Quote 0
      • i_mazlovI
        i_mazlov
        last edited by

        Hi @kng_ito,

        Thanks for reaching out to us. In general one doesn't expect Python Generator behaving the same way as native c4d generators, hence such issues are more or less expected.

        If you really like to make it work, as a direction for your further investigation, you can try inserting spline into the document and execute passes.

        Let me know if you have any further questions.

        Cheers,
        Ilia

        MAXON SDK Specialist
        developers.maxon.net

        K 1 Reply Last reply Reply Quote 0
        • K
          kng_ito @i_mazlov
          last edited by

          hi @i_mazlov ,

          I understand that it is not supported, so I will use Scene Nodes to generate the spline this time.
          No other questions, thank you very much.

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