Fixes T68521.
The Problem described there is that object are not properly mirrored in object mode. It was assumed that there is no way to mirror an object about an arbitrary axis. But clearly there must be a way, since no scew happens during the mirror operation and the mirrored state preserves all angles of the object.
For mirroring an object that has an arbitrary rotation along the X axis this is the procedure:
- mirror x location.
- negate x scale of the
- negate y and z component of the rotation (independent of which rotation mode is used).
This patch applies this knowledge for all angles and axes to finally make the mirror operation work in object mode. Since the mirror operator now uses different code specifically for mirror, it is also faster than previous versions, but that is obviously neglegtible. The new mirror function has the downside, that it can not (in this form) be used with proportional editing. This is no problem since the old behavior can still be replicated by scaling with -1 along any axis. The solution to get perfect mirrors can not work for scaling in general, because in that case there could be scew created.
I didn't test every use-case, as I currently don't have the time, so testing of this patch is highly encouraged. I am almost certain there are some unhandled cases left in this initial state.