Page MenuHome

Prevent changing to sculptmode on faceless mesh objects
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on Apr 13 2021, 1:41 PM.

Details

Summary

Sculpting faceless meshes is not supported and since a lot of operators
/ API functions are accessing face sets, this would also lead to crashes
(this was reported for the color filter, but was also true for the cloth
and mesh filter for example).

This is an alternative to D10851 [which was a more localized solution
only preventing the crash in relation to face sets]. But after talking
to @Pablo Dobarro (pablodp606), it was suggested to prevent sculpt mode in a much more
general scope, and do so for face(or vertex-)less meshes.

So now prevent sculptmode via operator poll, but also cover a couple of
more cases (e.g. loading a file with a mesh like this in sculptmode).

Dont see a specific check like this for other mode-switching cases, so
unsure if this the way to go, not replacing D10851, but putting this up
as an alternative.

Fixes T86940: sculpt automasking facesets option crashes on meshes
without faces

Diff Detail

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

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Apr 13 2021, 1:41 PM
Philipp Oeser (lichtwerk) created this revision.

I'd prefer if the operators handle this case, as it's possible any sculpt mode tools that remove faces also cause this situation.

To list some off hand:

  • dyntopo can remove faces.
  • trim tools remove faces.
  • remesh.

To continue enforcing this rule those tools would need to exit sculpt mode which wouldn't be so nice from the user perspective.

Yes, that makes sense.
In that case, this should be checked per operator. As an initial fix, this could be added to the main sculpt_mode_poll function that is used for most of the tools. Then tools that can create geometry (trim, for example), can have a separate poll function that does the same as the current one.

OK, makes sense, this would be handled in a different patch then, thx checking.

I need to go over D10851: Fix T86940: sculpt automasking facesets option crashes on meshes without faces again to see if this covers the mentioned operators, but will abandon this one.