Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Maya Programming
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya SDK topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selecting vertices from a variable object

1 REPLY 1
Reply
Message 1 of 2
Anonymous
430 Views, 1 Reply

Selecting vertices from a variable object

Hello all,

I'm reasonably new to Maya, and I'm working on a fairly specific project.

For the project, I need to select the vertices of objects individually. Typically, this is fairly easy using something like `select -r pCube.vtx[3]`.
But, the names of these objects are variable and stored in array I obtain using the command: 
string $dataset[] = `ls data_*`;

I can still select the whole object using `select -r $dataset[1]`, but I'm running into an issue when I try to select the individual vertices.

So far, I have tried `select -r $dataset[1].vtx[3]`, but obviously that brings up a syntax error. 

Is there any way to do this? Or perhaps a workaround?

Thanks 

1 REPLY 1
Message 2 of 2
saihtam
in reply to: Anonymous

You have to remember that MEL is not object oriented, but string based. So to select components etc you need to create a string that is built up of the mesh name and the component.

 

This should give you what you're looking for.

 

select -r ($dataset[1]+".vtx[3]");
- Mathias

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report