Plugin Cafe Homepage
Forum Home Forum Home > Plugin Cafe > Plugin Requests
  New Posts New Posts
  FAQ FAQ  Forum Search   Register Register  Login Login

Sweep a spline (pipe script)

 Post Reply Post Reply
Author
Message
geepee View Drop Down
Member
Member


Joined: 2016 Nov 07
Online Status: Offline
Posts: 5
Post Options Post Options   Quote geepee Quote  Post ReplyReply Direct Link To This Post Topic: Sweep a spline (pipe script)
    Posted: 2017 Feb 04 at 8:53am
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




Edited by geepee - 2017 Feb 04 at 9:11am
Back to Top
gr4ph0s View Drop Down
Member
Member


Joined: 2015 Jul 07
Location: Nantes
Online Status: Offline
Posts: 143
Post Options Post Options   Quote gr4ph0s Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Feb 06 at 4:07pm
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()


Edited by gr4ph0s - 2017 Feb 07 at 8:37am
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1215
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Feb 06 at 11:25pm
I think, there's a small bug when adding the last undo step. There it probably should be circle instead of sweep.

Cheers,
Andreas
SDK Support Engineer
Back to Top
gr4ph0s View Drop Down
Member
Member


Joined: 2015 Jul 07
Location: Nantes
Online Status: Offline
Posts: 143
Post Options Post Options   Quote gr4ph0s Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Feb 07 at 8:37am
Thanks I corrected it :)
Back to Top
geepee View Drop Down
Member
Member


Joined: 2016 Nov 07
Online Status: Offline
Posts: 5
Post Options Post Options   Quote geepee Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Feb 07 at 6:22pm
gr4ph0s!!!! Thank you so much!!! You are awesome for doing that so quickly. Works great!
Back to Top
geepee View Drop Down
Member
Member


Joined: 2016 Nov 07
Online Status: Offline
Posts: 5
Post Options Post Options   Quote geepee Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Feb 07 at 6:23pm
Andreas Block, thank you for your help as well!
Back to Top
Andreas Block View Drop Down
Forum Moderator
Forum Moderator
Avatar

Joined: 2014 Oct 01
Location: Hannover
Online Status: Offline
Posts: 1215
Post Options Post Options   Quote Andreas Block Quote  Post ReplyReply Direct Link To This Post Posted: 2017 Feb 07 at 11:42pm
Hi Greg,
I've not done much here. But, please, just Andreas is enough.

Cheers,
Andreas
SDK Support Engineer
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.61 [Free Express Edition]
Copyright ©2001-2009 Web Wiz

This page was generated in 0.109 seconds.