Feedback

What's your question?

By: [ Editor ] Asked from Ventura, United States of America

How to access poly shells in Maya through Mel?

I want to access poly uv shells easily. I can find out how many shells I have with “polyEvaluate”. And I can select my shell with “polySelect”. But I don’t want to interactively select anything. I want to be able to access components of a shell without having to select it.

Is there a way to return the faces of a particular shell through mel?

There is “polySelect -extendToShell”. In the documentation, it says:

“In query mode, this flag needs a value.”

When I give it a face index, it returns nothing.

“polySelect -q -ets 10 mesh”

I was hoping this would return the faces in the shell.

Thanks

Add comment viewed 147 times Latest activity 7 months ago

or Cancel

2 answers

  • 0

shydo

Another approach is to store your selection with ls -sl then call the -polySelect extendToShell store that selection as the result you are after, then select the selection that you’d stored originally.

It’s not graceful, but then again, MEL isn’t graceful.

or Cancel
  • 0

shydo from Ghaziabad (गाज़ियाबाद), भारत गणराज्य India

Maybe there’s a ‘graceful’ way in Mel but I don’t know of it. Hopefully someone else does.

Your best bet is a simple plugin command. You’d give a recursive function a face, it looks up the edges of that face, then the contiguous faces of those edges, then the edges of those faces etc. at each step you’d need to add your new components into a container like an std::set, if the components were already in the container then you stop that particular instance of your function. Once your last instance is complete your set will contain all the faces in a particular shell.

The problem is that MEL doesn’t have efficient containers like std::set, you’d have to store your faces in a array. This algorithm has an exponential time complexity so if your mesh contained more than a few douzen or hundred faces your MEL script would grind to a halt and freeze maya.

But I’ve been away from maya so I might be wrong, there might be an easy way.

or Cancel