[Bf-extensions-cvs] [ba2aed9e] master: Collection Manager: Fix exclude bug. Task: T69577

Ryan Inch noreply at git.blender.org
Sat May 2 08:43:47 CEST 2020


Commit: ba2aed9efbdbbd1d6b06124fefa914cc588a6eec
Author: Ryan Inch
Date:   Sat May 2 02:37:52 2020 -0400
Branches: master
https://developer.blender.org/rBAba2aed9efbdbbd1d6b06124fefa914cc588a6eec

Collection Manager: Fix exclude bug. Task: T69577

Fixes the exclude operator changing the active collection in some cases.

===================================================================

M	object_collection_manager/__init__.py
M	object_collection_manager/operators.py

===================================================================

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]



More information about the Bf-extensions-cvs mailing list