[Bf-extensions-cvs] [1a6900ad] blender-v2.82-release: PDT: Docstring fixes and a small bug fix

Alan Odom noreply at git.blender.org
Tue Feb 4 14:31:10 CET 2020


Commit: 1a6900ade707f3d634f7693e47a7c89c12ab37a8
Author: Alan Odom
Date:   Tue Feb 4 12:51:17 2020 +0000
Branches: blender-v2.82-release
https://developer.blender.org/rBA1a6900ade707f3d634f7693e47a7c89c12ab37a8

PDT: Docstring fixes and a small bug fix

All Docstrings have been examined for typos and format, etc.

Small code change to set Selection Mode to "SEL" if operation is not
"C" or "P" to avoid possible errors when using other operations.

===================================================================

M	precision_drawing_tools/__init__.py
M	precision_drawing_tools/pdt_cad_module.py
M	precision_drawing_tools/pdt_command.py
M	precision_drawing_tools/pdt_command_functions.py
M	precision_drawing_tools/pdt_design.py
M	precision_drawing_tools/pdt_etof.py
M	precision_drawing_tools/pdt_functions.py
M	precision_drawing_tools/pdt_library.py
M	precision_drawing_tools/pdt_msg_strings.py
M	precision_drawing_tools/pdt_pivot_point.py
M	precision_drawing_tools/pdt_view.py
M	precision_drawing_tools/pdt_xall.py

===================================================================

diff --git a/precision_drawing_tools/__init__.py b/precision_drawing_tools/__init__.py
index bb0245dc..7adb7c1a 100644
--- a/precision_drawing_tools/__init__.py
+++ b/precision_drawing_tools/__init__.py
@@ -359,9 +359,9 @@ class PDTSceneProperties(PropertyGroup):
         name="Pivot Factor", min=0.4, max=10, default=2, precision=1, description=PDT_DES_PPSIZE
     )
     pivot_width: IntProperty(name="Width", min=1, max=5, default=2, description=PDT_DES_PPWIDTH)
-    # FIXME: might as well become pivot_angle
+
     pivot_ang: FloatProperty(name="Pivot Angle", min=-180, max=180, default=0.0)
-    # FIXME: pivot_dist for consistency?
+
     pivot_dis: FloatProperty(
         name="Pivot Dist", default=0.0, min=0, update=scale_set, description=PDT_DES_PIVOTDIS,
     )
diff --git a/precision_drawing_tools/pdt_cad_module.py b/precision_drawing_tools/pdt_cad_module.py
index 74153a1d..fc1d4633 100644
--- a/precision_drawing_tools/pdt_cad_module.py
+++ b/precision_drawing_tools/pdt_cad_module.py
@@ -37,7 +37,7 @@ def point_on_edge(point, edge):
         edge:     tuple containing 2 vectors.
 
     Returns:
-        True if point p happens to lie on the edge, False otherwise.
+        True if point happens to lie on the edge, False otherwise.
     """
 
     intersect_point, _percent = intersect_point_line(point, *edge)
@@ -48,7 +48,8 @@ def point_on_edge(point, edge):
 def line_from_edge_intersect(edge1, edge2):
     """Get New Line from Intersections.
 
-    Prepares input for sending to intersect_line_line
+    Note:
+        Prepares input for sending to intersect_line_line
 
     Args:
         edge1, edge2: tuples containing 2 vectors.
@@ -82,9 +83,10 @@ def get_intersection(edge1, edge2):
 def test_coplanar(edge1, edge2):
     """Test 2 Edges are Co-planar.
 
-    The line that describes the shortest line between the two edges would be short if the
-    lines intersect mathematically. If this line is longer than 1.0e-5 then they are either
-    coplanar or parallel
+    Note:
+        The line that describes the shortest line between the two edges would be short if the
+        lines intersect mathematically. If this line is longer than 1.0e-5 then they are either
+        coplanar or parallel
 
     Args:
         edge1, edge2: tuples containing 2 vectors.
@@ -102,7 +104,8 @@ def test_coplanar(edge1, edge2):
 def closest_idx(intersect_point, edge):
     """Get Closest Vertex to input point.
 
-    If both points in edge are equally far from intersect_point, then v1 is returned.
+    Note:
+        If both points in edge are equally far from intersect_point, then v1 is returned.
 
     Args:
         intersect_point:       vector
@@ -126,7 +129,8 @@ def closest_idx(intersect_point, edge):
 def closest_vector(intersect_point, edge):
     """Return Closest Vector to input Point.
 
-    If both points in e are equally far from intersect_point, then v1 is returned.
+    Note:
+        If both points in e are equally far from intersect_point, then v1 is returned.
 
     Args:
         intersect_point:       vector
@@ -177,7 +181,7 @@ def vertex_indices_from_edges_tuple(bm, edge_tuple):
     """Return List of vertices.
 
     Args:
-        bm:           is a bmesh representation
+        bm:           Active object's Bmesh
         edge_tuple:   contains 2 edge indices.
 
     Returns:
@@ -228,7 +232,7 @@ def find_intersecting_edges(bm, intersect_point, idx1, idx2):
 
     Args:
         intersect_point: Vector describing 3D coordinates of intersection point
-        idx1, ix2:    edge indices
+        idx1, idx2:    edge indices
 
     Returns:
         The list of edge indices where intersect_point is on those edges.
@@ -245,8 +249,8 @@ def vert_idxs_from_edge_idx(bm, idx):
     """Find Vertex Indices form Edge Indices.
 
     Args:
-        Object Bmesh as bm
-        Selection Index as idx
+        bm: Object's Bmesh
+        idx: Selection Index
 
     Returns:
         Vertex Indices of Edge.
diff --git a/precision_drawing_tools/pdt_command.py b/precision_drawing_tools/pdt_command.py
index ad0f3528..2ed6d57d 100644
--- a/precision_drawing_tools/pdt_command.py
+++ b/precision_drawing_tools/pdt_command.py
@@ -99,9 +99,6 @@ class PDT_OT_CommandReRun(Operator):
 def command_run(self, context):
     """Run Command String as input into Command Line.
 
-    Args:
-        context: Blender bpy.context instance.
-
     Note:
         Uses pg.command, pg.error & many other 'pg.' variables to set PDT menu items,
         or alter functions
@@ -124,7 +121,7 @@ def command_run(self, context):
 
             A = Absolute XYZ, D = Delta XYZ, I = Distance at Angle, P = Percent
             X = X Delta, Y = Y, Delta Z, = Z Delta, O = Output (Maths Operation only)
-            V = Vertex Bevel, E = Edge Bevel
+            V = Vertex Bevel, E = Edge Bevel, I = Intersect then Bevel
 
             Capitals and lower case letters are both allowed
 
@@ -134,11 +131,14 @@ def command_run(self, context):
 
             Example; CA,,3 - Cursor to Absolute, is re-interpreted as CA0,0,3
 
-            Exception for Maths Operation, Values section is evaluated as Maths command
+            Exception for Maths Operation, Values section is evaluated as Maths expression
 
             Example; madegrees(atan(3/4)) - sets PDT Angle to smallest angle of 3,4,5 Triangle;
             (36.8699 degrees)
 
+    Args:
+        context: Blender bpy.context instance.
+
     Returns:
         Nothing.
     """
@@ -308,7 +308,6 @@ def pdt_help(self, context):
     """Display PDT Command Line help in a pop-up.
 
     Args:
-        Self: Itself as a reference for action
         context: Blender bpy.context instance
 
     Returns:
@@ -410,8 +409,8 @@ def command_parse(context):
         pg: PDT Parameters Group - our variables
         values_out: The Output Values as a list of numbers
         obj: The Active Object
-        obj_loc: The objects location in 3D space
-        bm: The objects Bmesh
+        obj_loc: The object's location in 3D space
+        bm: The object's Bmesh
         verts: The object's selected vertices, or selected history vertices.
     """
     scene = context.scene
@@ -433,10 +432,13 @@ def command_parse(context):
     # Apply System Rounding
     decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
     values_out = [str(round(float(v), decimal_places)) for v in values]
-    bm = "None"
+    bm = "No Bmesh"
     obj_loc = Vector((0,0,0))
     verts = []
 
+    if mode_sel == 'REL' and operation not in {"C", "P"}:
+        pg.select = 'SEL'
+
     if mode_sel == 'SEL' and mode not in {"a"}:
         bm, good = obj_check(obj, scene, operation)
         if good and obj.mode == 'EDIT':
@@ -466,7 +468,7 @@ def move_cursor_pivot(context, pg, operation, mode, obj, verts, values):
         mode: The Operation Mode, e.g. a for Absolute
         obj: The Active Object
         verts: The object's selected vertices, or selected history vertices
-        values: The paramters passed e.g. 1,4,3 for Catrtesan Coordinates
+        values: The parameters passed e.g. 1,4,3 for Cartesian Coordinates
 
     Returns:
         Nothing.
@@ -543,9 +545,9 @@ def move_entities(context, pg, operation, mode, obj, bm, verts, values):
         operation: The Operation e.g. Create New Vertex
         mode: The Operation Mode, e.g. a for Absolute
         obj: The Active Object
-        bm: The objects Bmesh
+        bm: The object's Bmesh
         verts: The object's selected vertices, or selected history vertices
-        values: The paramters passed e.g. 1,4,3 for Catrtesan Coordinates
+        values: The parameters passed e.g. 1,4,3 for Cartesian Coordinates
 
     Returns:
         Nothing.
@@ -666,10 +668,10 @@ def split_edges(context, pg, operation, mode, obj, obj_loc, bm, values):
         operation: The Operation e.g. Create New Vertex
         mode: The Operation Mode, e.g. a for Absolute
         obj: The Active Object
-        obj_loc: The objects location in 3D space
-        bm: The objects Bmesh
+        obj_loc: The object's location in 3D space
+        bm: The object's Bmesh
         verts: The object's selected vertices, or selected history vertices
-        values: The paramters passed e.g. 1,4,3 for Catrtesan Coordinates
+        values: The parameters passed e.g. 1,4,3 for Cartesian Coordinates
 
     Returns:
         Nothing.
@@ -770,10 +772,10 @@ def extrude_vertices(context, pg, operation, mode, obj, obj_loc, bm, verts, valu
         operation: The Operation e.g. Create New Vertex
         mode: The Operation Mode, e.g. a for Absolute
         obj: The Active Object
-        obj_loc: The objects location in 3D space
-        bm: The objects Bmesh
+        obj_loc: The object's location in 3D space
+        bm: The object's Bmesh
         verts: The object's selected vertices, or selected history vertices
-        values: The paramters passed e.g. 1,4,3 for Catrtesan Coordinates
+        values: The parameters passed e.g. 1,4,3 for Cartesian Coordinates
 
     Returns:
         Nothing.
@@ -852,8 +854,8 @@ def extrude_geometry(context, pg, operation, mode, obj, bm, values):
         operation: The Operation e.g. Create New Vertex
         mode: The Operation Mode, e.g. a for Absolute
         obj: The Active Object
-        bm: The objects Bmesh
-        values: The paramters passed e.g. 1,4,3 for Catrtesan Coordinates
+        bm: The object's Bmesh
+        values: The parameters passed e.g. 1,4,3 for Cartesian Coordinates
 
     Returns:
         Nothing.
@@ -905,8 +907,8 @@ def duplicate_geometry(context, pg, operation, mode, obj, bm, values):
         operation: The Operation e.g. Create New Vertex
         mode: The Operation Mode, e.g. a for Absolute
         obj: The Active Object
-        bm: The objects Bmesh
-        values: The paramters passed e.g. 1,4,3 for Catrtesan Coordinates
+        bm: The object's Bmesh
+        values: The parameters passed e.g. 1,4,3 for Cartesian Coordinates
 
     Returns:
         Nothing.
@@ -958,9 +960,9 @@ def fillet_geometry(context, pg, mode, obj, bm, verts, values):
         operation: The Operation e.g. Create New Vertex
         mode: The Operation Mode, e.g. a for Absolute
         o

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list