Page MenuHome

Fix T83863: Changing vertex proximity modifier property affects others
AbandonedPublic

Authored by Hans Goudey (HooglyBoogly) on Dec 16 2020, 10:32 PM.

Details

Summary

This happened because the properties used the same flag variable. Switching
to RNA_def_property_enum_bitflag_sdna fixed this. However, I'm making
a patch for this because I don't properly understand the comments for
PROP_ENUM_FLAG and how they relate to the comment on enumbitflags.

The comment on the latter says "this only allows one of the flags to be set
at a time, clearing all others". To me that doesn't make sense if making
this "true" fixes the problem in this report.

Side note: I'd like to change the type of enumbitflags to bool,
it's only used that way.

Diff Detail

Repository
rB Blender
Branch
fix-proximity-modifier-flag-rna (branched from master)
Build Status
Buildable 11786
Build 11786: arc lint + arc unit

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Dec 16 2020, 10:32 PM
Campbell Barton (campbellbarton) requested changes to this revision.EditedJan 27 2021, 5:00 AM

Looking into this, there is a few ways we could go.

  • While this fixes the common case, it allows multiple geometry types to be enabled at once (holding shift), as it happens this is supported internally.

    The only issue with this is it allows none of the buttons to be pressed too (that could be fixed using a set callback to ensure the value can't have all the geometry bits cleared).
  • If we just want to keep behavior as-is (while fixing the bug).

    We could have get/set functions for this enum which mask out the bits we don't want to change.

    This would be an acceptable fix.
  • We could support limiting the bits with RNA enums more generally, by adding (e.g. RNA_def_property_enum_bitmask).

    This way the fix would be a one liner:

    RNA_def_property_enum_bitmask(prop, MOD_WVG_PROXIMITY_GEOM_VERTS | MOD_WVG_PROXIMITY_GEOM_EDGES | MOD_WVG_PROXIMITY_GEOM_FACES);

    This removes the need for rna_UserDef_studiolight_type_get, rna_ShrinkwrapModifier_face_cull_get, rna_SoftBodySettings_new_aero_get... (and their set counter parts).

Note, enumbitflags comment is currently misleading and needs to be updated.

This revision now requires changes to proceed.Jan 27 2021, 5:00 AM