[Python] Scripting Multi-Cut tool?

[Python] Scripting Multi-Cut tool?

Jiloc
Participant Participant
2,534 Views
2 Replies
Message 1 of 3

[Python] Scripting Multi-Cut tool?

Jiloc
Participant
Participant

Hello everyone,
Here is my problem: I need to programmatically create a line starting from 2 vertices that create another vertex for every edge it encounters.
Something like this:



I know that I can use the multi-cut tool (and it's was I did for the image) but I find that I can't (or at least I don't know how) reproduce the same procedure in a script. I saw that Maya uses polyCut command, but to use it you must know all the edges (and where) that the line I would like to draw will intersecate.

Hope it was clear.. Does anyone have an idea?

0 Likes
2,535 Views
2 Replies
Replies (2)
Message 2 of 3

Jiloc
Participant
Participant
To be a little bit cleaner: I use OpenMaya.MItMeshEdge to iterate over all edges of the Mesh until i find the 2 vertices I am looking for. Starting from those vertices (for what I know) I can access only their position and their linked edges. From those informations I'd like to create a direct path like in the photo that I posted.
0 Likes
Message 3 of 3

Jiloc
Participant
Participant

I resigned with multi-cut tool and started thinking about using Project Curve on Mesh and Split Mesh Projected Curved, but I found another problem (it's probably a simple thing that I am missing): when I use "project line on mesh" the projection doesn't stop on the first surface it encounters, instead the line is projected on all polygon's surfaces that the projection encounters, an example:

Schermata 2015-07-13 alle 13.04.59.png


Is there a way to stop the projection at the first surface encountered?

0 Likes