Open Enverex opened 4 years ago
Where is the mirroring applied? Is it at the root of the model? Generally negative or non-uniform scaling is strongly discouraged, because it produces skewed or otherwise messed up matrices and breaks a lot of the math. If you need to use it, I recommend only applying it deeper in the hierarchy.
For the baking meshes, are you baking regular static meshes?
Sorry, I thought I replied to this back when you first posted.
The mirroring (2 to -2 on the X axis) is applied on the top level of the object (as it has several parts). Everything looks fine when it's in world, but if you pick it up, it'll flip back until you put it down again.
Regarding baking, yes, this was a group of several static meshes all being baked. A small set were mirrored and unmirrored when baking.
The mirroring at the top level of the object is not really fixable unfortunately, I'd strongly recommend using negative scaling deeper in the object. The root should always have uniform non-negative scaling, otherwise transformation calculations will get messed up as the object is transformed between spaces.
Do you have any example you could send me for the baked meshes that I could use for testing? That can potentially be fixed.
I actually have a third object that exhibits a third type of behaviour (but similar to the first). It'll mirror as requested when editing the hierarchy, it will flip when grabbing it (same as case 1), but then differently than the others, it will remain unmirrored when dropped, so -2 becomes 2. This can't really be done lower in the hierarchy in this example because it's a set of objects (and the door is supposed to be hinged, so it can't be baked into just one mesh).
Regarding the baking issue (case 2) - I'll try and put something together for you that exhibits the same behaviour (it was part of a friend's MMC entry and is already baked now and not really in a sendable state).
Video of the grab-flip in action so you can see the values on the top level invert as it happens - https://neos.xnode.org/tmp/2020-10-17%2014-27-19.mp4
It looks like the inversion when grabbing comes from the reparenting; If you move a negatively scaled object to another parent, it seems to ABS the scaling value, so if it's -5 it'll become 5 and physically flip (i.e the change isn't just visual, the object actually does flip back so it'll now be the wrong way around).
Sometimes you want to "mirror" a model, you can normally do this by using a negative value for the scale, so 1.95 X becomes -1.95 X and the model is essentially mirrored.
This normally looks fine, but if you grab one of these meshes/models with a negative scale, the model will "flip" for the duration it's grabbed and flip back when it's dropped.
The second issue is that if you then try and bake one of these negative scaled meshes/models into a group, the baked result will actually have the mesh back at a positive value, so it'll be unmirrored (or back to front) compared to how it was pre-bake.