Whoops. Like I said...holiday weekend. Just fixed a typo:
https://gist.github.com/1398060



On Nov 27, 2011, at 12:05 PM, Justin Israel wrote:

> Thanks. I am quite lovely aren't I? LOL
> 
> Here is a rough example that I thought of, using python commands and assuming 
> a start and end selection
> https://gist.github.com/1398060
> 
> I don't really check the original selection to see if its only two vertices 
> or faces, but this should give you an idea. Hopefully I didn't over-think 
> your problem.
> I used a regex to get the int vert/face number instead of using the maya api 
> since that approach seems like too much code just to get the index from the 
> selection:
> 
> import maya.OpenMaya as api
> 
> sel = api.MSelectionList()
> api.MGlobal.getActiveSelectionList(sel)
> compIter = api.MItSelectionList(sel, api.MFn.kMeshVertComponent)
> 
> component = api.MObject()
> meshDagPath = api.MDagPath()
> 
> vList = []
> while not compIter.isDone():
>       compIter.getDagPath(meshDagPath, component)
>       if not component.isNull():
>               vertIter = api.MItMeshVertex(meshDagPath, component)
>               while not vertIter.isDone():
>                       vList.append(vertIter.index())
>                       vertIter.next()
>       compIter.next()
> 
> I may be a little slow from the holiday weekend and overlooked some easier 
> way to do it. But thats as much as I can do with a bunch of turkey in my 
> stomach :-)
> 
> -- justin
> 
> 
> On Nov 27, 2011, at 4:57 AM, Reza Shahsavary wrote:
> 
>> thx Justin
>> ur Lovely
>> but 2 questions if u don't mind!
>> 1.what should i do if want to select my component mesh without typing 
>> surface name i.g :p.sphere..i`d like to do that with selection mesh
>> 2.i just need to select my components in one direction(horizontal or 
>> vertical)
>> thx
>> P.M:i just uploaded a photo from maya.i need to selection like that.actually 
>> its selected by hand :)
>> 
>> 
>> -- 
>> view archives: http://groups.google.com/group/python_inside_maya
>> change your subscription settings: 
>> http://groups.google.com/group/python_inside_maya/subscribe
>> <my selection.jpg>
> 

-- 
view archives: http://groups.google.com/group/python_inside_maya
change your subscription settings: 
http://groups.google.com/group/python_inside_maya/subscribe

Reply via email to