diff options
author | Julian Eisel <julian@blender.org> | 2020-08-27 17:40:56 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-09-02 15:57:41 +0300 |
commit | 521ae3d458adcce73e5f9832fd6e7197721e9df0 (patch) | |
tree | a966e8f6220bda8b156e0cf8417db2a86ee332cc | |
parent | cbb5201f09bd88a5c7e58fe74ee4178fb2aec27f (diff) |
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
-rw-r--r-- | source/blender/editors/space_outliner/outliner_select.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index fa8422573ab..36bcef22838 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_activate_pose( } 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); |