From 45feaeaec4de83beb340fc336003ffa2dd60092a Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Sat, 9 Sep 2023 18:04:35 +0500 Subject: [PATCH] Spatial Manager - try to preserve the selection on loading the manager Also noticed in Sigma Dimensions video that every time user deletes a storey or applies new elevation the selection was jumping to the first storey. Now it's going to be more natural. Before - https://imgur.com/a/gbn7ryQ After - https://imgur.com/a/QX2RulF --- src/blenderbim/blenderbim/tool/spatial.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blenderbim/blenderbim/tool/spatial.py b/src/blenderbim/blenderbim/tool/spatial.py index 1309232183..5c3b6b895a 100644 --- a/src/blenderbim/blenderbim/tool/spatial.py +++ b/src/blenderbim/blenderbim/tool/spatial.py @@ -198,6 +198,7 @@ class Spatial(blenderbim.core.tool.Spatial): @classmethod def load_container_manager(cls): cls.props = bpy.context.scene.BIMSpatialManagerProperties + previous_container_index = cls.props.active_container_index cls.props.containers.clear() cls.contracted_containers = json.loads(cls.props.contracted_containers) cls.props.is_container_update_enabled = False @@ -208,7 +209,7 @@ class Spatial(blenderbim.core.tool.Spatial): cls.create_new_storey_li(object, 0) cls.props.is_container_update_enabled = True # triggers spatial manager props setup - cls.props.active_container_index = 0 + cls.props.active_container_index = min(previous_container_index, len(cls.props.containers) - 1) @classmethod def create_new_storey_li(cls, element, level_index):