From ee577f162df26669b9851be64a2a9ace44917496 Mon Sep 17 00:00:00 2001 From: Alan Odom <clockmender@icloud.com> Date: Sat, 14 Mar 2020 11:22:00 +0000 Subject: [PATCH] PDT: Allow User to Move Empties (enhancement) This enhancement allows users to move Empties, so they can be used as a parent object for other objects. Allows movement by Delta, Direction and Absolute. --- precision_drawing_tools/pdt_command.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/precision_drawing_tools/pdt_command.py b/precision_drawing_tools/pdt_command.py index 5b4b30c1e..fa7d43bf4 100644 --- a/precision_drawing_tools/pdt_command.py +++ b/precision_drawing_tools/pdt_command.py @@ -156,7 +156,7 @@ def command_run(self, context): # Check Object Type & Mode First obj = context.view_layer.objects.active if obj is not None and command[0].upper() not in {"M", "?", "HELP"}: - if obj.mode not in {"OBJECT", "EDIT"} or obj.type != "MESH": + if obj.mode not in {"OBJECT", "EDIT"} or obj.type not in {"MESH", "EMPTY"}: pg.error = PDT_OBJ_MODE_ERROR context.window_manager.popup_menu(oops, title="Error", icon="ERROR") raise PDT_ObjectModeError @@ -460,9 +460,10 @@ def command_parse(context): obj_loc = obj.matrix_world.decompose()[0] verts = [] else: - pg.error = PDT_OBJ_MODE_ERROR - context.window_manager.popup_menu(oops, title="Error", icon="ERROR") - raise PDT_ObjectModeError + if operation not in {"G"}: + pg.error = PDT_OBJ_MODE_ERROR + context.window_manager.popup_menu(oops, title="Error", icon="ERROR") + raise PDT_ObjectModeError else: pg.error = PDT_ERR_NO_ACT_OBJ context.window_manager.popup_menu(oops, title="Error", icon="ERROR") -- GitLab