pipeMaker

Small script for simplifying making pipes. Make a curve, select it and execute the script. Saves the trouble of going through the menus and settings.

##
## pipeMaker
## -------------
## 14 jul 2009
## Jan-Erik "Jonne" Östman (jonne@jonne.net)
##
## www.jonne.net
##
##
## Instructions:
## -------------
## Create a cv or ep curve and select it.
## Change circle diameter in the popup after your liking or scale the circle
## after the pipe has finished. Either way works fine
##
## ---------------------------------------------------------------------------


import maya.cmds as cmds


# popup dialogue
result = cmds.promptDialog(
		title='Pipemaker',
		text='0.5',
		message='Enter dimension:',
		button=['OK', 'Cancel'],
		defaultButton='OK',
		cancelButton='Cancel',
		dismissString='Cancel')

if result == 'OK':
	circleRadius = cmds.promptDialog(query=True, text=True)
else:
	circleRadius = 0.5


sel = cmds.ls(sl=1)
profileShape = cmds.circle( nr=(0, 1, 0), c=(0, 0, 0), r=circleRadius )

cmds.extrude(profileShape[0], sel, ch=1, rn=0, po=0, et=2, ucp=1, fpt=1, upn=1, ro=0, sc=1, rsp=1)



I wish to do something Great and Wonderful, but I must start by doing the little things like they were Great and Wonderful”
~ Albert Einstein