Feedback

What's your question?

By: [ Editor ] Asked from United States of America

How to find Maya poly edge percentage?

I'm trying to script a tool that uses the "polySplit" command. According to the docs, I can use either "ep", "fp" or "ip". But if I use either "fp" or "ip", Maya complains. It seems only "ep" works. If someone has gotten "fp" or "ip" to work, then this question is unnecessary.

If I'm forced to use "ep", then how do I get the percentage of an edge? How do I know which end is the start vs. the end? I could write a test loop into my script but that seems so stupid. There's gotta be a Maya command that deals with edge percentages. NE1?

Thanks

  • 1

shyalb from Mumbai, भारत गणराज्य India

Edges are composed of two vertices.. say that your edge (e.g edge number 10) is composed vertices number 3 and 9, then in the API calling:

MFnMesh mesh(path); int vertexList[2]; mesh.getEdgeVertices(edgeNumber, vertexList);

vertexList now contains {3,9}. Say you want your split to happen at 0.1 (as a fraction of the length of edge 10) from vertex 3 then vertex 3 == vertexList[0] at which point you can just call:

polySplit -ep 10 0.1;

but if (!3 == vertex[0]) then you’ll want to call:

polySplit -ep 10 0.9;

Let me know if this is not clear enough and I’ll provide you with some basic working API code.

NN comments
manny
-

I’m trying to do this through MEL. But thanks.

or Cancel