Page MenuHome

Fix T96294: Crash and error with shape key normal calculation (Option 2)
AbandonedPublic

Authored by Hans Goudey (HooglyBoogly) on Mar 11 2022, 8:31 PM.

Details

Reviewers
None
Summary

A mistake in the mesh normal refactor caused the wrong mesh to
be used when calculating normals with a shape key's deformation.

This commit fixes the normal calculation by making a few changes
in the area.

  • The function doesn't make a local copy of the mesh anymore.
  • Instead of using the mesh normal API, calculate the normals directly.
  • Split the function into three, one for each mesh element.

This required changing a function to apply shape keys to take mesh
vertices instead of the whole mesh. The downside is the lower-level
access to mesh normals, the upside is that they don't have to be copied,
and no temporary mesh is created.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Mar 11 2022, 8:31 PM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) retitled this revision from Fix T96294: Crash and error with shape key normal calculation to Fix T96294: Crash and error with shape key normal calculation (Option 2).Mar 11 2022, 8:35 PM

Compared with D14317, I don't think this option is worth pursuing actually.