I'm making a custom modal rotation operator which raps around a standard bpy.ops.transform.rotate() operator. The purpose is to create a pause when the object being rotated by the user gets close enough to a base of 30 degrees (visual auto contextual snapping).
Would like to do this without completely writing a new rotation operator. Or losing the visual bgl elements provided with the existing transform.rotate operator. I'm currently invoking transform.rotate from within my modal operator. I'm aware I could not invoke transform.rotate and instead feed it incremented values from my modal operator and mouse screen data, but I'd lose the bgl elements from the standard rotate operator (dashed lines, arrow icons etc). Would also turn this into a much more complicated project...
The issue lies in trying to monitor and affect the main modal operator (my custom rotation operator) while running transform.rotate within it. I've discovered this can be overcome with a scene_update_post app handler during initial execution of my modal operator. In this way, I'm able to retrieve live data about object rotation (or anything else I want) while running transform.rotate (itself a modal operator) from within my modal operator which is awesome!
Now that I have access to the rotation data as it's being performed via scene_update_post is there any way I can use that to finish or interrupt transform.rotate? Is there a better way to monitor modal operators like transform.rotate from within your own modal operator (while being used, not post or pre)? Sorry, for not having a code example, the overall system's pretty verbose. Don't fret to much over this one. Just curious if any experts know of some fancy tricks.