Re: [Maya-Python] creating a curve from points

2015-03-05 Thread e9554564
Oh by the way Chris, as a side note, if i then was going to use the positions stored through this list method, to move other items to this location with xform. how can, for example, element two in the list be isolated and then seperated further int x,y,z eg: postList = [cmds.pointPosition('pSp

Re: [Maya-Python] creating a curve from points

2015-03-05 Thread e9554564
wow thanks guys for all your help. Yep these look far neater than mine. Thanks muchly. Sam -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [Maya-Python] creating a curve from points

2015-03-04 Thread Chris Lesage
Whoops, if you are working with selection, us os=True, instead of sl=True. Otherwise your point order won't necessarily be in order: selPoints = cmds.ls(flatten=True, orderedSelection=True) postList = [cmds.pointPosition(x) for x in selPoints] cmds.curve(n='curve1', d=1, p=postList) Cheers, Chris

Re: [Maya-Python] creating a curve from points

2015-03-04 Thread Chris Lesage
Hi Sam, How are you getting the list of vertices in the first place? If you are selecting points, see my 3rd example. 1. You can also use list comprehension to shorten this a bit more. vertexList = [330, 136, 58] postList = [cmds.pointPosition('pSphere1.vtx[%s]'%x) for x in vertexList] cmds.curv

Re: [Maya-Python] creating a curve from points

2015-03-03 Thread Kurian O.S
What about this ? vertexList = [330, 136, 58] postList = [] for eachVer in vertexList: postList.append(cmds.pointPosition('pSphere1.vtx[%s]' % eachVer)) cmds.curve(n='curve1', d=1, p=postList) On Tue, Mar 3, 2015 at 5:50 PM, wrote: > Yo, > > if you want to create a curve from a set of point

[Maya-Python] creating a curve from points

2015-03-03 Thread e9554564
Yo, if you want to create a curve from a set of points that already exist. eg you want to create a curve from points on a mesh. Is this the cleanest way to do it?: Pnt1=cmds.pointPosition('geo.vtx[330]') Pnt2=cmds.pointPosition('geo.vtx[136]') Pnt3=cmds.pointPosition('geo.vtx[58]') cmds.curve