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

    Moving a group of spline points

    Cinema 4D SDK
    python sdk
    2
    3
    507
    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.
    • mfersaouiM
      mfersaoui
      last edited by

      Hello,

      I want to moving group of spline points by just moving one another point as parent controller.
      In my example (see screenshot below), I want to control the Y position of all the point after the point 1by just moving the point 1 (using the point 1 like as a parent object)

      moving-group-points.jpg

      def main():
          pline_object = op
          height = 800
          # set the points
          spline_object.SetPoint(0, c4d.Vector(0,0, 0))
          spline_object.SetPoint(1, c4d.Vector(0,height,0))
      
          obj_pnts = spline_object.GetAllPoints()
          for i in xrange(len(obj_pnts)):
              if i > 1 :
                  # What do I make on: obj_pnts[i].y
                  spline_object.SetPoint(i, c4d.Vector(obj_pnts[i].x, obj_pnts[i].y, obj_pnts[i].z))
      

      Thank you.

      mfersaouiM 1 Reply Last reply Reply Quote 0
      • mfersaouiM
        mfersaoui @mfersaoui
        last edited by mfersaoui

        I found the solution :

        def main():
            pline_object = op
            height = 800
        
            # set the points
            spline_object.SetPoint(0, c4d.Vector(0,0, 0))
            #spline_object.SetPoint(1, c4d.Vector(0,height,0))
        
            obj_pnts = spline_object.GetAllPoints()
            for i in xrange(len(obj_pnts)):
                if i > 0 :
                    interval = height - obj_pnts[1].y          
                    spline_object.SetPoint(i, c4d.Vector(obj_pnts[i].x,obj_pnts[1].y+(obj_pnts[i].y-obj_pnts[1].y)+interval, obj_pnts[i].z))
                                
        
        1 Reply Last reply Reply Quote 0
        • ManuelM
          Manuel
          last edited by

          hello,

          happy you found your solution, and thanks for the feedback 🙂

          Cheers
          Manuel

          MAXON SDK Specialist

          MAXON Registered Developer

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