Fix T55231: Setting bone.select from RNA didn't tag for copy on write

This was causing problems with addons such as the Selection Sets addon used
in studio by the animators.
This commit is contained in:
Joshua Leung 2018-05-28 18:51:56 +02:00
parent e9cf3b5347
commit e63fbc992d
Notes: blender-bot 2023-02-14 05:48:59 +01:00
Referenced by issue #55231, Selection sets addon - Missing Updates (Needs COW tagging)
1 changed files with 8 additions and 2 deletions

View File

@ -168,8 +168,10 @@ static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
{
ID *id = ptr->id.data;
/* special updates for cases where rigs try to hook into armature drawing stuff
* e.g. Mask Modifier - 'Armature' option
/* 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-write, so that selection status (set by addons)
* will update properly, like standard tools do already
*/
if (id) {
if (GS(id->name) == ID_AR) {
@ -178,6 +180,8 @@ static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
if (arm->flag & ARM_HAS_VIZ_DEPS) {
DEG_id_tag_update(id, OB_RECALC_DATA);
}
DEG_id_tag_update(id, DEG_TAG_COPY_ON_WRITE);
}
else if (GS(id->name) == ID_OB) {
Object *ob = (Object *)id;
@ -186,6 +190,8 @@ static void rna_Bone_select_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Po
if (arm->flag & ARM_HAS_VIZ_DEPS) {
DEG_id_tag_update(id, OB_RECALC_DATA);
}
DEG_id_tag_update(&arm->id, DEG_TAG_COPY_ON_WRITE);
}
}