From 9b0ef34534f66b048210410740ab13831cf0364f Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 27 Aug 2020 16:40:56 +0200 Subject: Fix Outliner allowing to enter Pose Mode on linked armature If a different object was active, clicking on a linked armature's pose in the Outliner would enter Pose Mode for it. This would actually cause a failed assert, but in release builds the armature would just enter pose mode. Steps to reproduce were: * Link in armature object * Activate a different object * In the Outliner, un-collapse the armature object * Activate Pose Mode by clicking on its pose there --- source/blender/editors/space_outliner/outliner_select.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_outliner') diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 3c7e4506e5d..23aa2979e86 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -46,6 +46,7 @@ #include "BKE_main.h" #include "BKE_object.h" #include "BKE_paint.h" +#include "BKE_report.h" #include "BKE_scene.h" #include "BKE_sequencer.h" #include "BKE_workspace.h" @@ -193,12 +194,17 @@ static void do_outliner_item_posemode_toggle( } else { bool ok = false; - if (ob->mode & OB_MODE_POSE) { + + if (ID_IS_LINKED(ob)) { + BKE_report(CTX_wm_reports(C), RPT_WARNING, "Cannot pose libdata"); + } + else if (ob->mode & OB_MODE_POSE) { ok = ED_object_posemode_exit_ex(bmain, ob); } else { ok = ED_object_posemode_enter_ex(bmain, ob); } + if (ok) { ED_object_base_select(base, (ob->mode & OB_MODE_POSE) ? BA_SELECT : BA_DESELECT); -- cgit v1.2.3