From 06fc55648012d133451469f584c9cadd34852552 Mon Sep 17 00:00:00 2001 From: Ryan Inch Date: Sat, 2 May 2020 02:37:52 -0400 Subject: Collection Manager: Fix exclude bug. Task: T69577 Fixes the exclude operator changing the active collection in some cases. --- object_collection_manager/__init__.py | 2 +- object_collection_manager/operators.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/object_collection_manager/__init__.py b/object_collection_manager/__init__.py index 2c950c84..2caf6bc7 100644 --- a/object_collection_manager/__init__.py +++ b/object_collection_manager/__init__.py @@ -22,7 +22,7 @@ bl_info = { "name": "Collection Manager", "description": "Manage collections and their objects", "author": "Ryan Inch", - "version": (2, 7, 17), + "version": (2, 7, 18), "blender": (2, 80, 0), "location": "View3D - Object Mode (Shortcut - M)", "warning": '', # used for warning icon and text in addons panel diff --git a/object_collection_manager/operators.py b/object_collection_manager/operators.py index 3fe19660..1d60d60c 100644 --- a/object_collection_manager/operators.py +++ b/object_collection_manager/operators.py @@ -340,6 +340,7 @@ class CMExcludeOperator(Operator): modifiers = get_modifiers(event) view_layer = context.view_layer.name + orig_active_collection = context.view_layer.active_layer_collection laycol_ptr = layer_collections[self.name]["ptr"] if not view_layer in rto_history["exclude"]: @@ -386,6 +387,9 @@ class CMExcludeOperator(Operator): cls.isolated = False + # reset active collection + context.view_layer.active_layer_collection = orig_active_collection + # reset exclude all history if view_layer in rto_history["exclude_all"]: del rto_history["exclude_all"][view_layer] -- cgit v1.2.3