From 929aa3a49b60f2aa79314de4b10bad7f00fbe4f5 Mon Sep 17 00:00:00 2001 From: Bruno Postle Date: Sun, 28 May 2023 11:22:01 +0100 Subject: [PATCH] Select new/changed objects in visual diff (#3096) When visualising differences between current/selected revision, new/changed objects are selected as well as colourised --- src/blenderbim/blenderbim/tool/ifcgit.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/blenderbim/blenderbim/tool/ifcgit.py b/src/blenderbim/blenderbim/tool/ifcgit.py index aa9cede3c8..e72d58a5b7 100644 --- a/src/blenderbim/blenderbim/tool/ifcgit.py +++ b/src/blenderbim/blenderbim/tool/ifcgit.py @@ -192,6 +192,7 @@ class IfcGit: bpy.data.orphans_purge(do_recursive=True) bpy.ops.bim.load_project(filepath=path_ifc) + bpy.ops.object.select_all(action='DESELECT') @classmethod def branches_by_hexsha(cls, repo): @@ -311,6 +312,7 @@ class IfcGit: def colourise(cls, step_ids): area = next(area for area in bpy.context.screen.areas if area.type == "VIEW_3D") area.spaces[0].shading.color_type = "OBJECT" + bpy.ops.object.select_all(action='DESELECT') for obj in bpy.context.visible_objects: if not obj.BIMObjectProperties.ifc_definition_id: @@ -318,10 +320,13 @@ class IfcGit: step_id = obj.BIMObjectProperties.ifc_definition_id if step_id in step_ids["modified"]: obj.color = (0.3, 0.3, 1.0, 1) + obj.select_set(True) elif step_id in step_ids["added"]: obj.color = (0.2, 0.8, 0.2, 1) + obj.select_set(True) elif step_id in step_ids["removed"]: obj.color = (1.0, 0.2, 0.2, 1) + obj.select_set(True) else: obj.color = (1.0, 1.0, 1.0, 0.5)