1

I have a scenario, where I need to snap an Object B over the vertices of a selected edge of Object A. I need to know, how to list all the vertices of a selected polyObject edge in a sequence, so that I can duplicate and snap the objects to required vertices based on my requirement. Like snap to every alternate vertex.

Your suggestions are so valuable to me.

Thanks in advance.

0

1 Answer 1

1

This is a MEL version:

polyCube -sx 1 -sy 1 -sz 1 ;
select -r pCube1.e[7] ;
PolySelectConvert 3 ;
select -d pCube1.e[7] ;
$allComponents = `ls -selection` ;
print ( $allComponents ) ;

// print ( $allComponents[0] ) ;
// print ( $allComponents[1] ) ;

This is a Python version:

import maya.cmds as mc

mc.polyCube( sx=1, sy=1, sz=1 )
mc.select( 'pCube1.e[7]' )
mc.select( mc.polyListComponentConversion( tv=True ) ) 
allComponents = mc.ls( sl=True )
print( allComponents )

# print( allComponents[0] )
# print( allComponents[1] )
0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.