Anim: Remove selection rna properties of Bone

With #146102 the selection state of pose bones was moved to
the pose bone itself and syncing code was introduced that
ensures the selection state between pose- and edit mode matches.

While the syncing happens via the `Bone` struct, the flag is
always overridden from either the `EditBone` or the `bPoseChannel`.
Since the selection state of the `Bone` is not  used for  operations anymore
there is no point in keeping it.

In a way this doesn't break backwards compatibility more than
it already was. It's just more visible now because it will actually error.

Pull Request: https://projects.blender.org/blender/blender/pulls/147597
This commit is contained in:
Christoph Lendenfeld
2025-10-08 09:41:51 +02:00
committed by Christoph Lendenfeld
parent 7b7b5a5fcd
commit aef8a05701

View File

@@ -740,37 +740,6 @@ static void rna_Bone_update_renamed(Main * /*bmain*/, Scene * /*scene*/, Pointer
WM_main_add_notifier(NC_ANIMATION | ND_ANIMCHAN, id);
}
static void rna_Bone_select_update(Main * /*bmain*/, Scene * /*scene*/, PointerRNA *ptr)
{
ID *id = ptr->owner_id;
/* 1) special updates for cases where rigs try to hook into armature drawing stuff
* e.g. Mask Modifier - 'Armature' option
* 2) tag armature for copy-on-evaluation, so that selection status (set by addons)
* will update properly, like standard tools do already
*/
if (id) {
if (GS(id->name) == ID_AR) {
bArmature *arm = (bArmature *)id;
if (arm->flag & ARM_HAS_VIZ_DEPS) {
DEG_id_tag_update(id, ID_RECALC_GEOMETRY);
}
DEG_id_tag_update(id, ID_RECALC_SYNC_TO_EVAL);
}
else if (GS(id->name) == ID_OB) {
/* This should be handled by the pose bone. */
BLI_assert_unreachable();
}
}
WM_main_add_notifier(NC_GEOM | ND_DATA, id);
/* spaces that show animation data of the selected bone need updating */
WM_main_add_notifier(NC_ANIMATION | ND_ANIMCHAN, id);
}
static std::optional<std::string> rna_Bone_path(const PointerRNA *ptr)
{
const ID *id = ptr->owner_id;
@@ -1777,26 +1746,6 @@ static void rna_def_bone(BlenderRNA *brna)
RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
RNA_def_property_update(prop, 0, "rna_Bone_hide_update");
prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "flag", BONE_SELECTED);
RNA_def_property_ui_text(prop, "Select", "");
RNA_def_property_clear_flag(
prop,
PROP_ANIMATABLE); /* XXX: review whether this could be used for interesting effects... */
RNA_def_property_update(prop, 0, "rna_Bone_select_update");
prop = RNA_def_property(srna, "select_head", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "flag", BONE_ROOTSEL);
RNA_def_property_ui_text(prop, "Select Head", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
prop = RNA_def_property(srna, "select_tail", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, nullptr, "flag", BONE_TIPSEL);
RNA_def_property_ui_text(prop, "Select Tail", "");
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_update(prop, 0, "rna_Armature_redraw_data");
/* XXX better matrix descriptions possible (Arystan) */
prop = RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
RNA_def_property_float_sdna(prop, nullptr, "bone_mat");