title: python maya: Loop through curve vertex and fillet each
body: <p>All I'm wanting to do is create a spline using random points, then pass through the spline adding fillers to the available curve vertex. </p>
  
  <p>Just doing a basic fillet in maya seems pretty setup heavy so I'd like to do it through code just looping through the selected splines vertex.</p>
  
  <pre><code>import maya.cmds as cmds
  path = cmds.curve(d=1, p=[(0, 0, 0), (0, 0, 6), (5, 0, 6), (9, 0, 9)] )
  </code></pre>
  
  <p>I know that you can fillet a corner based on a radius by doing the following..
  1. Create a curve 
  2. Select 2 'Curve Points' with each one being on a different segment
  3. Run the Curve Fillet with 'Trim' and 'Join' on with the desired radius size.</p>
  
  <p>What I'm wondering is if there is to possibly apply this approach and fillet all segments of a spline.</p>
  
  <p><img src="https://i.stack.imgur.com/gKRhL.png" alt="enter image description here"></p>
  
  <p>UPDATED:
  This is what I have so far and it doesn't want to fillet more than once why is that?</p>
  
  <pre><code>#maya has a shape node for every transform object
  #cmds.ls(sl=True, t="transform")
  
  import maya.cmds as cmds
  import random
  
  a = cmds.spaceLocator(n='pipeCtrl_00')
  b = cmds.spaceLocator(n='pipeCtrl_00')
  c = cmds.spaceLocator(n='pipeCtrl_00')
  d = cmds.spaceLocator(n='pipeCtrl_00')
  cmds.xform(a, t=(0,0,0) )
  cmds.xform(b, t=(0,0,-6) )
  cmds.xform(c, t=(6,0,-6) )
  cmds.xform(d, t=(6,0,-12) )
  
  
  #select all the locators you want to make curves on
  items = cmds.ls(type='locator') #cmds.ls(sl = True)
  locList = maya.cmds.listRelatives(items, type='transform', parent=True)
  sorted(locList)
  crvList = []
  
  #run locators through a loop and make a curve segment from 1 to another.
  for index in range(0,len(locList)-1):
   crvName = "myCurve"+str(index) 
   aLocPos = cmds.xform(locList[index], q = True, t = True)
   bLocPos = cmds.xform(locList[index+1], q = True, t = True)
   cmds.curve(d=1,n=crvName, p=[(aLocPos[0], aLocPos[1], aLocPos[2]), (bLocPos[0], bLocPos[1], bLocPos[2])] )
  cmds.select("myCurve*")
  crvList=cmds.ls(sl=True)
  
  #Curve fillet each segment section with random radius.
  #for index in range(0,len(crvList)-1):
   #aCrv = crvList[index] 
   #bCrv = crvList[index+1]
   #randRadius = random.randrange(1, 3)
   #cmds.filletCurve(aCrv, bCrv, r=randRadius)
   #aCrv=cmds.ls(sl=True)
  
  #Curve fillet each segment section with random radius
  for idx in range(0,len(crvList)-1):
   curveA = crvList[idx]
   curveB = crvList[idx+1]
   randRadius = random.uniform(0.5, 1.5)
  
   m = cmds.filletCurve(curveA, curveB, r=1.5 , cir=True, t=True, jn=True)
  </code></pre>