Selecting vertices from a variable object

Anonymous

Selecting vertices from a variable object

Anonymous
Not applicable

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 

0 Likes
Reply
441 Views
1 Reply
Reply (1)

saihtam
Collaborator
Collaborator

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
0 Likes