Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRune Morling <ermo.blender.org@spammesenseless.net>2021-05-17 20:30:35 +0300
committerRune Morling <ermo.blender.org@spammesenseless.net>2021-05-17 20:43:36 +0300
commite2516bfae6d05f060017a9940614ad83dc533f29 (patch)
treea4cfc608102816bb5b3fcbc06e43d0245a446d3b /precision_drawing_tools/pdt_design.py
parent26d3cfb04ec0a7f14d2a6ff607cbec574e8dcef7 (diff)
PDT: Add "View Normal" Operation enhancement
This enhancement enables the user to work always Normal to the View as defined by "Working Plane" in PDT Design Functions Section. For example: If the working plane is set to Front and the Operation is "Extrude Geometry" the system will extrude along the Y axis by the amount specified in the "Distance" Entry Box. Specifying Working Plane as "View" cause the system to work always Normal to the current view orientation, i.e. into, or out of your screen. This enhancement is only available for Blender 2.9x builds.
Diffstat (limited to 'precision_drawing_tools/pdt_design.py')
-rw-r--r--precision_drawing_tools/pdt_design.py82
1 files changed, 82 insertions, 0 deletions
diff --git a/precision_drawing_tools/pdt_design.py b/precision_drawing_tools/pdt_design.py
index 8a5e1234..f1505353 100644
--- a/precision_drawing_tools/pdt_design.py
+++ b/precision_drawing_tools/pdt_design.py
@@ -299,6 +299,82 @@ class PDT_OT_PlacementDis(Operator):
return {"FINISHED"}
+class PDT_OT_PlacementView(Operator):
+ """Use Distance Input for View Normal Axis Operations"""
+
+ bl_idname = "pdt.view_axis"
+ bl_label = "View Normal Axis Mode"
+ bl_options = {"REGISTER", "UNDO"}
+
+ def execute(self, context):
+ """Manipulates Geometry, or Objects by View Normal Axis Offset (Increment).
+
+ Note:
+ - Reads pg.operation from Operation Mode Selector as 'operation'
+ - Reads pg.select, pg.plane, pg.cartesian_coords scene variables to:
+ -- set position of CUrsor (CU)
+ -- set position of Pivot Point (PP)
+ -- MoVe geometry/objects (MV)
+ -- Extrude Vertices (EV)
+ -- Split Edges (SE)
+ -- add a New Vertex (NV)
+ -- Duplicate Geometry (DG)
+ -- Extrude Geometry (EG)
+
+ Invalid Options result in self.report Error.
+
+ Args:
+ context: Blender bpy.context instance.
+
+ Returns:
+ Status Set.
+ """
+
+ pg = context.scene.pdt_pg
+ operation = pg.operation
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
+
+ if operation == "CU":
+ # Cursor
+ pg.command = (
+ f"cv{str(round(pg.distance, decimal_places))}"
+ )
+ elif operation == "PP":
+ # Pivot Point
+ pg.command = (
+ f"pv{str(round(pg.distance, decimal_places))}"
+ )
+ elif operation == "MV":
+ # Move Entities
+ pg.command = (
+ f"gv{str(round(pg.distance, decimal_places))}"
+ )
+ elif operation == "NV":
+ # New Vertex
+ pg.command = (
+ f"nv{str(round(pg.distance, decimal_places))}"
+ )
+ elif operation == "EV":
+ # Extrue Vertices
+ pg.command = (
+ f"vv{str(round(pg.distance, decimal_places))}"
+ )
+ elif operation == "DG":
+ # Duplicate Entities
+ pg.command = (
+ f"dv{str(round(pg.distance, decimal_places))}"
+ )
+ elif operation == "EG":
+ # Extrue Geometry
+ pg.command = (
+ f"ev{str(round(pg.distance, decimal_places))}"
+ )
+ else:
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_DEL}"
+ self.report({"ERROR"}, error_message)
+ return {"FINISHED"}
+
+
class PDT_OT_PlacementPer(Operator):
"""Use Percentage Placement"""
@@ -703,3 +779,9 @@ class PDT_OT_Taper(Operator):
pg = context.scene.pdt_pg
pg.command = f"tap"
return {"FINISHED"}
+
+#class PDT_Extrude_Modal(Operator):
+# """Extrude Modal Plane Along Normal Axis"""
+# bl_idname = "pdt.extrude_modal"
+# bl_label = "Extrude Modal Normal"
+# bl_options = {"REGISTER", "UNDO"}