Page MenuHome

Fix T92256: Rotate instances node scaling bug
AbandonedPublic

Authored by Erik Abrahamsson (erik85) on Oct 14 2021, 9:35 PM.

Details

Summary

This patch applies the inverse scale transformation before rotation to fix T92256.

Before:


After:

Diff Detail

Repository
rB Blender
Branch
rotate-instances-fix (branched from master)
Build Status
Buildable 17844
Build 17844: arc lint + arc unit

Event Timeline

Erik Abrahamsson (erik85) requested review of this revision.Oct 14 2021, 9:35 PM
Erik Abrahamsson (erik85) created this revision.
Erik Abrahamsson (erik85) retitled this revision from Fix: Rotate instances scaling bug to Fix: Rotate instances node scaling bug.Oct 14 2021, 9:38 PM
Erik Abrahamsson (erik85) edited the summary of this revision. (Show Details)
Hans Goudey (HooglyBoogly) requested changes to this revision.Oct 14 2021, 10:26 PM

Regardless of the code here, a problem like this is not obvious and should have a report with a proper example file. That can make it much easier to figure out code in the future.

This revision now requires changes to proceed.Oct 14 2021, 10:26 PM
Erik Abrahamsson (erik85) retitled this revision from Fix: Rotate instances node scaling bug to Fix T92256: Rotate instances node scaling bug.Oct 16 2021, 4:15 AM
Erik Abrahamsson (erik85) edited the summary of this revision. (Show Details)

I'm unsure if this is a good fix. It feels a bit brittle and it does not seem guaranteed that this never change the scaling in some way. I tried a different fix that I'll upload in a bit.

source/blender/nodes/geometry/nodes/node_geo_rotate_instances.cc
64

Inverting a 4x4 matrix is an expensive operation that should not be done if not really necessary. Often (like in this case) you have additional information about the matrix that makes inverting it much more efficient: Inverting a scale matrix just means taking the inverse of the elements on the diagonal.