From 2b96acf2bc6724f1b6bf6dbbfcf5c8c3422f1864 Mon Sep 17 00:00:00 2001 From: Swann Martinez Date: Thu, 18 Apr 2019 16:50:04 +0200 Subject: [PATCH] feat(rcf): added support for multi object select --- operators.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/operators.py b/operators.py index cb7e8ca..ca442ab 100644 --- a/operators.py +++ b/operators.py @@ -87,14 +87,12 @@ def update_selected_object(context): username = bpy.context.scene.session_settings.username client_key = "Client/{}".format(username) client_data = client_instance.get(client_key) - + selected_objects = helpers.get_selected_objects(context.scene) # Active object bounding box - if len(context.selected_objects) > 0: - - + if len(selected_objects) > 0: for obj in context.selected_objects: if obj.name not in client_data[0][1]['active_objects']: - client_data[0][1]['active_objects'] = helpers.get_selected_objects(context.scene) + client_data[0][1]['active_objects'] = selected_objects client_instance.set(client_key,client_data[0][1]) break @@ -473,10 +471,11 @@ def depsgraph_update(scene): elif update[1] in SUPPORTED_TYPES: client_instance.set("{}/{}".format(update[1], update[2])) - if hasattr(bpy.context, 'selected_objects'): - if len(bpy.context.selected_objects) > 0: - updated_data = updates[0] - if updated_data.id.name == bpy.context.selected_objects[0].name: + # if hasattr(bpy.context, 'selected_objects'): + selected_objects = helpers.get_selected_objects(scene) + if len(selected_objects) > 0: + for updated_data in updates: + if updated_data.id.name in selected_objects: if updated_data.is_updated_transform or updated_data.is_updated_geometry: client_instance.set( "{}/{}".format(updated_data.id.bl_rna.name, updated_data.id.name))