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

Add comment viewed 142 times Latest activity 5 months ago

NN comments
manny
-

Might it be a function of vertex order? For instance, if the vertex at one end of the edge is a lower number than the other end, then that end is the start? Is it as simple as that?

shyalb
-

I’m stuck on exactly the same problem.. it doesn’t seem to be based on vertex numbers.. need to check if it’s based on the face-relative indices.

or Cancel

1 answer

  • 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