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
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Sweep a spline (pipe script)

    Plugin Requests
    0
    7
    1.7k
    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
      Helper
      last edited by

      On 04/02/2017 at 08:53, xxxxxxxx wrote:

      Hello -

      I'm in need of a script that can instantly sweep a spline with a circle. This is something like a script I found a long time ago called pipoficator. For some reason it won't work right with the new R18. Any chance I can get help with this? Thanks so much.

      Greg

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

        On 06/02/2017 at 16:07, xxxxxxxx wrote:

        Coded in 5 min and I guess the code it's self explanatory but if you want more information feel free to ask 😉

        import c4d
          
        def main() :
            spline = op
            
            test_spline = spline.GetRealSpline()
            if not test_spline:
                return
            
            doc.StartUndo()
            sweep = c4d.BaseObject(c4d.Osweep)
            
            doc.AddUndo(c4d.UNDOTYPE_NEW, sweep)
            sweep.InsertAfter(spline)
            
            doc.AddUndo(c4d.UNDOTYPE_HIERARCHY_PSR, spline)
            spline.InsertUnder(sweep)
            
            circle = c4d.BaseObject(c4d.Osplinecircle)
            circle[c4d.PRIM_CIRCLE_RADIUS] = 10 #change the radius of the circle here
          
            doc.AddUndo(c4d.UNDOTYPE_NEW, circle)
            circle.InsertUnder(sweep)
            
            doc.EndUndo()
            c4d.EventAdd()
            
        if __name__=='__main__':
            main()
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 06/02/2017 at 23:25, xxxxxxxx wrote:

          I think, there's a small bug when adding the last undo step. There it probably should be circle instead of sweep.

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

            On 07/02/2017 at 08:37, xxxxxxxx wrote:

            Thanks I corrected it 🙂

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

              On 07/02/2017 at 18:22, xxxxxxxx wrote:

              gr4ph0s!!!! Thank you so much!!! You are awesome for doing that so quickly. Works great!

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

                On 07/02/2017 at 18:23, xxxxxxxx wrote:

                Andreas Block, thank you for your help as well!

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

                  On 07/02/2017 at 23:42, xxxxxxxx wrote:

                  Hi Greg,
                  I've not done much here. But, please, just Andreas is enough.

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