Page MenuHome

Fix T50103: Transform not working if scale is zero
AbandonedPublic

Authored by Falk David (filedescriptor) on Mar 31 2021, 4:55 PM.

Details

Summary

If any axis of the scale of an object was zero, the transformations would
not longer work. This was because td->smtx was set to a zero matrix.

The fix makes sure that td->smtx is never a zero matrix
(by setting it to the unit matrix if it is zero).

Diff Detail

Repository
rB Blender
Branch
T50103 (branched from master)
Build Status
Buildable 13844
Build 13844: arc lint + arc unit

Event Timeline

Falk David (filedescriptor) requested review of this revision.Mar 31 2021, 4:55 PM
Falk David (filedescriptor) created this revision.

It may work, but just to make sure this is the only solution, did you check out these functions?:

  • pseudoinverse_m3_m3,
  • invert_m3_m3_safe_ortho and
  • invert_m3_m3_ex

I don't know exactly which one, but one of them seems to be used in these cases.

Oh I don't think the invert operation is the problem. The issue is mostly this line: mul_m3_m3m3(td->smtx, obmtx, obinv);. Becasue it will look like [[1, 0, 0], [0, 1, 0], [0, 0, 0]] x [[0, 0, 0], [0, 0, 0], [0, 0, 1]] which is a zero m3.

Thanks for looking into this, committed an alternate fix which makes use of the non-zeroed matrix, otherwise the result wasn't tracking the mouse at all.

rB8a144b73c011: BLI_math: add orthogonalize_m#_zero_axes, rBd5cefc1844cf: Fix T50103: Transform not working if scale is zero