Page MenuHome

Fix T95479: Geometry nodes crash with cage display.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Mar 2 2022, 2:21 PM.

Details

Summary

Since the geometry nodes modifier has the eModifierTypeFlag_SupportsMapping flag, it is assumed that its output contains the CD_ORIGINDEX layers. A non-existant layer means that there is a 1:1 mapping, which is generally not the case.

How can we check whether these layers are actually needed? Should we check if the object is in edit mode with the cage option enabled or is there some utility?

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Mar 2 2022, 2:21 PM
Jacques Lucke (JacquesLucke) created this revision.

How can we check whether these layers are actually needed?

A modifier is expected to preserve custom data, interpolating it when possible.
So in a way you can check input mesh, and only create CD_ORIGINDEX in the output when it is present in the input.

Should we check if the object is in edit mode with the cage option enabled or is there some utility?

Is not only used for cage and edit mode, but also by things like vertex parent which averages vertex positions which maps back to a specific original vertex index.

This revision is now accepted and ready to land.Mar 2 2022, 3:11 PM

It's too bad this is necessary, but it's the simplest fix for now, so it seems fine to me.

  • check if layers existed on the input mesh
  • Merge branch 'blender-v3.1-release' into missing-orig-index-layer

Logic here looks good to me still, an improvement. Since the modifier stack should have added the orig index layers to the input if they're necessary.