Created
June 24, 2018 18:27
-
-
Save kanishk2391/f58d0784055547d492e2210e2bbd7dd8 to your computer and use it in GitHub Desktop.
Maya Script to extrude Multiple Curves at once with Properties
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import maya.cmds as cmds | |
#Thickness of the pipe | |
circleRadius=5 | |
#Length Spans | |
lengthSpans=10 | |
#Radial Spans of the Pipe | |
radialSpans=6 | |
r=cmds.ls(sl=True) | |
for i in r: | |
arcLength=cmds.arclen(i) | |
rebuildAmt=int(arcLength/lengthSpans) | |
cmds.rebuildCurve(i,d=3,s=rebuildAmt,ch=1) | |
circleMesh=cmds.circle(nr=(0,1,0),r=circleRadius) | |
cmds.rebuildCurve(circleMesh,d=3,s=radialSpans,ch=1) | |
motionPathID=cmds.pathAnimation( circleMesh, c=i,followAxis="y",upAxis="x",worldUpVector=(0,1,0),inverseUp=False,inverseFront=False,bank=False ) | |
nurbsTube=cmds.extrude(circleMesh[0] ,i, et=2,po=0 ) | |
polyMesh=cmds.nurbsToPoly(nurbsTube[0], mnd=1,ch=1,f=2,pt=1,ut=3,un=1,vt=3,vn=1,uch=0,ucr=0 ) | |
cmds.delete(motionPathID) | |
cmds.delete(circleMesh) | |
cmds.select(polyMesh) | |
cmds.DeleteHistory() | |
cmds.select(None) | |
cmds.delete(nurbsTube[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment