import maya.cmds as cmds

#list selected vertices, only works if you dont lasso select them.

selVerts = cmds.ls(sl=True)

#create empty list to store positions
selPositions = []


#loop to look up every vertex position and store it in selPositions
for vertex in selVerts:
    #query the position
    pos = cmds.xform(vertex, query = True , t = True)
    #append to list
    selPositions.append(pos)


# loop to create locators
for position in selPositions:
    #create a locator
    locator = cmds.spaceLocator()
    #move it into the position
    cmds.xform(locator, t= position)


On 22 September 2014 16:59, Ricardo Viana <[email protected]> wrote:

> This might help.
> I've commented so you can follow.
>
>
> On 22 September 2014 09:57, Mahmoodreza Aarabi <[email protected]> wrote:
>
>> You can write plugin with Maya Python API too.
>> but i think you get good result with maya commands too with mel and
>> python script.
>>
>> On Mon, Sep 22, 2014 at 12:26 PM, <[email protected]> wrote:
>>
>>> i guess plugins are c++ right. way over my head, but ill look into it.
>>> thanks,
>>>
>>> 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 to [email protected].
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/python_inside_maya/d82cd654-520a-4085-a752-dd9db7607ef5%40googlegroups.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>>
>> Bests,
>> madoodia
>>
>> --
>> 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 to [email protected].
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/python_inside_maya/CADvbQwK%3D5pjZ-%3DRLOJfToRqRP_QvsSJ5t5PEVtT3MHoh8ZAi5w%40mail.gmail.com
>> <https://groups.google.com/d/msgid/python_inside_maya/CADvbQwK%3D5pjZ-%3DRLOJfToRqRP_QvsSJ5t5PEVtT3MHoh8ZAi5w%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAK%2Bp0%3DZvqWXZ8DzQJjF0ndLsPPz30XQSP%3D1sfBWYnz0WjWGX%3DQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to