I'm trying to get the index of a selected polygon from a model (from the viewport) in a modal operator. I am using an event type to return the selected index. Whenever I run the script and select the modal operator it gives me the correct index the first time. But, any other time, I have to re-run my script and the modal…
For anyone who has read this or will read this, I've managed to find a solution to my problem - though it's quite unconventional; it works for my custom purposes. I've decided to ditch getting a triangle index from an object in edit mode. The reason for this is that I'm drawing a duplicate of the selected object in Blender…
I'm getting closer in figuring out how to solve the above problem. One way I have managed to progress is by checking the dot product of the viewport's camera position and the currently highlighted triangle - which clears up some things. I just need to fix the drawing order of the triangles (probably using the distance from…