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:
authorAlan Odom <clockmender@icloud.com>2020-01-30 20:34:25 +0300
committerRune Morling <ermo.blender.org@spammesenseless.net>2020-02-01 18:44:02 +0300
commit0e4dd304d6e9a7368cbac785ae4128c426777beb (patch)
tree02b5b08ba772000b444502e3b9022e9d23e3bd43 /precision_drawing_tools
parentff37747efcf9292da7169408f3f8299f37866041 (diff)
PDT: Rename more variables for readability
Diffstat (limited to 'precision_drawing_tools')
-rw-r--r--precision_drawing_tools/__init__.py14
-rw-r--r--precision_drawing_tools/pdt_cad_module.py4
-rw-r--r--precision_drawing_tools/pdt_command.py27
-rw-r--r--precision_drawing_tools/pdt_design.py184
-rw-r--r--precision_drawing_tools/pdt_functions.py16
-rw-r--r--precision_drawing_tools/pdt_library.py8
-rw-r--r--precision_drawing_tools/pdt_pivot_point.py14
7 files changed, 133 insertions, 134 deletions
diff --git a/precision_drawing_tools/__init__.py b/precision_drawing_tools/__init__.py
index d3639acd..bb0245dc 100644
--- a/precision_drawing_tools/__init__.py
+++ b/precision_drawing_tools/__init__.py
@@ -142,9 +142,9 @@ def enumlist_objects(self, context):
if path.is_file() and ".blend" in str(path):
with bpy.data.libraries.load(str(path)) as (data_from, _):
if len(pg.object_search_string) == 0:
- object_names = [ob for ob in data_from.objects]
+ object_names = [obj for obj in data_from.objects]
else:
- object_names = [ob for ob in data_from.objects if pg.object_search_string in ob]
+ object_names = [obj for obj in data_from.objects if pg.object_search_string in obj]
for object_name in object_names:
_pdt_obj_items.append((object_name, object_name, ""))
else:
@@ -174,10 +174,10 @@ def enumlist_collections(self, context):
if path.is_file() and ".blend" in str(path):
with bpy.data.libraries.load(str(path)) as (data_from, _):
if len(pg.collection_search_string) == 0:
- object_names = [ob for ob in data_from.collections]
+ object_names = [obj for obj in data_from.collections]
else:
object_names = [
- ob for ob in data_from.collections if pg.collection_search_string in ob
+ obj for obj in data_from.collections if pg.collection_search_string in obj
]
for object_name in object_names:
_pdt_col_items.append((object_name, object_name, ""))
@@ -208,9 +208,11 @@ def enumlist_materials(self, context):
if path.is_file() and ".blend" in str(path):
with bpy.data.libraries.load(str(path)) as (data_from, _):
if len(pg.material_search_string) == 0:
- object_names = [ob for ob in data_from.materials]
+ object_names = [obj for obj in data_from.materials]
else:
- object_names = [ob for ob in data_from.materials if pg.material_search_string in ob]
+ object_names = [
+ obj for obj in data_from.materials if pg.material_search_string in obj
+ ]
for object_name in object_names:
_pdt_mat_items.append((object_name, object_name, ""))
else:
diff --git a/precision_drawing_tools/pdt_cad_module.py b/precision_drawing_tools/pdt_cad_module.py
index 6e6294e6..880cf84d 100644
--- a/precision_drawing_tools/pdt_cad_module.py
+++ b/precision_drawing_tools/pdt_cad_module.py
@@ -166,10 +166,10 @@ def vertex_indices_from_edges_tuple(bm, edge_tuple):
The vertex indices of edge_tuple.
"""
- def k(ind_v, ind_w):
+ def find_verts(ind_v, ind_w):
return bm.edges[edge_tuple[ind_v]].verts[ind_w].index
- return [k(i >> 1, i % 2) for i in range(4)]
+ return [find_verts(i >> 1, i % 2) for i in range(4)]
def get_vert_indices_from_bmedges(edges):
diff --git a/precision_drawing_tools/pdt_command.py b/precision_drawing_tools/pdt_command.py
index 3aa7bafc..cfd0e666 100644
--- a/precision_drawing_tools/pdt_command.py
+++ b/precision_drawing_tools/pdt_command.py
@@ -370,22 +370,22 @@ def command_maths(context, mode, pg, expression, output_target):
context.window_manager.popup_menu(oops, title="Error", icon="ERROR")
raise PDT_MathsError
- val_round = context.preferences.addons[__package__].preferences.pdt_input_round
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
if output_target == "x":
- pg.cartesian_coords.x = round(maths_result, val_round)
+ pg.cartesian_coords.x = round(maths_result, decimal_places)
elif output_target == "y":
- pg.cartesian_coords.y = round(maths_result, val_round)
+ pg.cartesian_coords.y = round(maths_result, decimal_places)
elif output_target == "z":
- pg.cartesian_coords.z = round(maths_result, val_round)
+ pg.cartesian_coords.z = round(maths_result, decimal_places)
elif output_target == "d":
- pg.distance = round(maths_result, val_round)
+ pg.distance = round(maths_result, decimal_places)
elif output_target == "a":
- pg.angle = round(maths_result, val_round)
+ pg.angle = round(maths_result, decimal_places)
elif output_target == "p":
- pg.percent = round(maths_result, val_round)
+ pg.percent = round(maths_result, decimal_places)
else:
# Must be "o"
- pg.maths_output = round(maths_result, val_round)
+ pg.maths_output = round(maths_result, decimal_places)
def command_parse(context):
@@ -414,8 +414,8 @@ def command_parse(context):
values[ind] = "0.0"
ind = ind + 1
# Apply System Rounding
- val_round = context.preferences.addons[__package__].preferences.pdt_input_round
- values_out = [str(round(float(v), val_round)) for v in values]
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
+ values_out = [str(round(float(v), decimal_places)) for v in values]
bm, good = obj_check(obj, scene, operation)
if good:
@@ -474,9 +474,6 @@ def move_cursor_pivot(context, pg, operation, mode, obj, verts, values):
except:
raise PDT_InvalidVector
- if vector_delta is None:
- raise PDT_InvalidVector
-
scene = context.scene
mode_sel = pg.select
obj_loc = obj.matrix_world.decompose()[0]
@@ -787,14 +784,14 @@ def extrude_vertices(context, pg, operation, mode, obj, obj_loc, bm, verts, valu
new_vertex.select_set(True)
# Percent Options
elif mode == "p":
- ext_a = pg.extend
+ extend_all = pg.extend
try:
vector_delta = vector_build(context, pg, obj, operation, values, 1)
except:
raise PDT_InvalidVector
verts = [v for v in bm.verts if v.select].copy()
new_vertex = bm.verts.new(vector_delta)
- if ext_a:
+ if extend_all :
for v in [v for v in bm.verts if v.select]:
bm.edges.new([v, new_vertex])
v.select_set(False)
diff --git a/precision_drawing_tools/pdt_design.py b/precision_drawing_tools/pdt_design.py
index b6a12633..e3f91b1d 100644
--- a/precision_drawing_tools/pdt_design.py
+++ b/precision_drawing_tools/pdt_design.py
@@ -62,53 +62,53 @@ class PDT_OT_PlacementAbs(Operator):
pg = context.scene.pdt_pg
operation = pg.operation
- val_round = context.preferences.addons[__package__].preferences.pdt_input_round
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
if operation == "CU":
# Cursor
pg.command = (
- f"ca{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"ca{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "PP":
# Pivot Point
pg.command = (
- f"pa{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"pa{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "MV":
# Move Entities
pg.command = (
- f"ga{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"ga{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "SE":
# Split Edges
pg.command = (
- f"sa{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"sa{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "NV":
# New Vertex
pg.command = (
- f"na{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"na{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "EV":
# Extrude Vertices
pg.command = (
- f"va{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"va{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
else:
- errmsg = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_ABS}"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_ABS}"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -144,67 +144,67 @@ class PDT_OT_PlacementDelta(Operator):
pg = context.scene.pdt_pg
operation = pg.operation
- val_round = context.preferences.addons[__package__].preferences.pdt_input_round
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
if operation == "CU":
# Cursor
pg.command = (
- f"cd{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"cd{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "PP":
# Pivot Point
pg.command = (
- f"pd{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"pd{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "MV":
# Move Entities
pg.command = (
- f"gd{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"gd{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "SE":
# Split Edges
pg.command = (
- f"sd{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"sd{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "NV":
# New Vertex
pg.command = (
- f"nd{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"nd{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "EV":
# Extrue Vertices
pg.command = (
- f"vd{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"vd{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "DG":
# Duplicate Entities
pg.command = (
- f"dd{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"dd{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
elif operation == "EG":
# Extrue Geometry
pg.command = (
- f"ed{str(round(pg.cartesian_coords.x, val_round))}"
- f",{str(round(pg.cartesian_coords.y, val_round))}"
- f",{str(round(pg.cartesian_coords.z, val_round))}"
+ f"ed{str(round(pg.cartesian_coords.x, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.y, decimal_places))}"
+ f",{str(round(pg.cartesian_coords.z, decimal_places))}"
)
else:
- errmsg = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_DEL}"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_DEL}"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -240,59 +240,59 @@ class PDT_OT_PlacementDis(Operator):
pg = context.scene.pdt_pg
operation = pg.operation
- val_round = context.preferences.addons[__package__].preferences.pdt_input_round
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
if operation == "CU":
# Cursor
pg.command = (
- f"ci{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"ci{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
elif operation == "PP":
# Pivot Point
pg.command = (
- f"pi{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"pi{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
elif operation == "MV":
# Move Entities
pg.command = (
- f"gi{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"gi{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
elif operation == "SE":
# Split Edges
pg.command = (
- f"si{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"si{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
elif operation == "NV":
# New Vertex
pg.command = (
- f"ni{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"ni{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
elif operation == "EV":
# Extrude Vertices
pg.command = (
- f"vi{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"vi{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
elif operation == "DG":
# Duplicate Geometry
pg.command = (
- f"di{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"di{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
elif operation == "EG":
# Extrude Geometry
pg.command = (
- f"ei{str(round(pg.distance, val_round))}"
- f",{str(round(pg.angle, val_round))}"
+ f"ei{str(round(pg.distance, decimal_places))}"
+ f",{str(round(pg.angle, decimal_places))}"
)
else:
- errmsg = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_DIR}"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_DIR}"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -326,29 +326,29 @@ class PDT_OT_PlacementPer(Operator):
pg = context.scene.pdt_pg
operation = pg.operation
- val_round = context.preferences.addons[__package__].preferences.pdt_input_round
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
if operation == "CU":
# Cursor
- pg.command = f"cp{str(round(pg.percent, val_round))}"
+ pg.command = f"cp{str(round(pg.percent, decimal_places))}"
elif operation == "PP":
# Pivot Point
- pg.command = f"pp{str(round(pg.percent, val_round))}"
+ pg.command = f"pp{str(round(pg.percent, decimal_places))}"
elif operation == "MV":
# Move Entities
- pg.command = f"gp{str(round(pg.percent, val_round))}"
+ pg.command = f"gp{str(round(pg.percent, decimal_places))}"
elif operation == "SE":
# Split Edges
- pg.command = f"sp{str(round(pg.percent, val_round))}"
+ pg.command = f"sp{str(round(pg.percent, decimal_places))}"
elif operation == "NV":
# New Vertex
- pg.command = f"np{str(round(pg.percent, val_round))}"
+ pg.command = f"np{str(round(pg.percent, decimal_places))}"
elif operation == "EV":
# Extrude Vertices
- pg.command = f"vp{str(round(pg.percent, val_round))}"
+ pg.command = f"vp{str(round(pg.percent, decimal_places))}"
else:
- errmsg = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_PERCENT}"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_PERCENT}"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -395,8 +395,8 @@ class PDT_OT_PlacementNormal(Operator):
elif operation == "NV":
pg.command = f"nnml"
else:
- errmsg = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_INTERSECT}"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_INTERSECT}"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -439,8 +439,8 @@ class PDT_OT_PlacementCen(Operator):
elif operation == "NV":
pg.command = f"ncen"
else:
- errmsg = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_INTERSECT}"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_INTERSECT}"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -486,8 +486,8 @@ class PDT_OT_PlacementInt(Operator):
elif operation == "NV":
pg.command = f"nint"
else:
- errmsg = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_INTERSECT}"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{operation} {PDT_ERR_NON_VALID} {PDT_LAB_INTERSECT}"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -556,24 +556,24 @@ class PDT_OT_Fillet(Operator):
"""
pg = context.scene.pdt_pg
- val_round = context.preferences.addons[__package__].preferences.pdt_input_round
+ decimal_places = context.preferences.addons[__package__].preferences.pdt_input_round
if pg.fillet_intersect:
pg.command = (
- f"fi{str(round(pg.fillet_radius, val_round))}"
- f",{str(round(pg.fillet_segments, val_round))}"
- f",{str(round(pg.fillet_profile, val_round))}"
+ f"fi{str(round(pg.fillet_radius, decimal_places))}"
+ f",{str(round(pg.fillet_segments, decimal_places))}"
+ f",{str(round(pg.fillet_profile, decimal_places))}"
)
elif pg.fillet_vertices_only:
pg.command = (
- f"fv{str(round(pg.fillet_radius, val_round))}"
- f",{str(round(pg.fillet_segments, val_round))}"
- f",{str(round(pg.fillet_profile, val_round))}"
+ f"fv{str(round(pg.fillet_radius, decimal_places))}"
+ f",{str(round(pg.fillet_segments, decimal_places))}"
+ f",{str(round(pg.fillet_profile, decimal_places))}"
)
else:
pg.command = (
- f"fe{str(round(pg.fillet_radius, val_round))}"
- f",{str(round(pg.fillet_segments, val_round))}"
- f",{str(round(pg.fillet_profile, val_round))}"
+ f"fe{str(round(pg.fillet_radius, decimal_places))}"
+ f",{str(round(pg.fillet_segments, decimal_places))}"
+ f",{str(round(pg.fillet_profile, decimal_places))}"
)
return {"FINISHED"}
diff --git a/precision_drawing_tools/pdt_functions.py b/precision_drawing_tools/pdt_functions.py
index c07611f7..dec3b972 100644
--- a/precision_drawing_tools/pdt_functions.py
+++ b/precision_drawing_tools/pdt_functions.py
@@ -405,7 +405,7 @@ def intersection(vertex_a, vertex_b, vertex_c, vertex_d, plane):
return vector_delta, True
-def get_percent(obj, flip_p, per_v, data, scene):
+def get_percent(obj, flip_percent, per_v, data, scene):
"""Calculates a Percentage Distance between 2 Vectors.
Calculates a point that lies a set percentage between two given points
@@ -416,7 +416,7 @@ def get_percent(obj, flip_p, per_v, data, scene):
Args:
obj: The Object under consideration
- flip_p: Setting this to True measures the percentage starting from the second vector
+ flip_percent: Setting this to True measures the percentage starting from the second vector
per_v: Percentage Input Value
data: pg.flip, pg.percent scene variables & Operational Mode
scene: Context Scene
@@ -466,7 +466,7 @@ def get_percent(obj, flip_p, per_v, data, scene):
coord_c = coord_b - coord_a
coord_d = np.array([0, 0, 0])
_per_v = per_v
- if (flip_p and data != "MV") or data == "MV":
+ if (flip_percent and data != "MV") or data == "MV":
_per_v = 100 - per_v
coord_out = (coord_d+coord_c) * (_per_v / 100) + coord_a
return Vector((coord_out[0], coord_out[1], coord_out[2]))
@@ -683,8 +683,8 @@ def scale_set(self, context):
scene = context.scene
pg = scene.pdt_pg
- sys_dis = pg.distance
- scale_dis = pg.pivot_dis
- if scale_dis > 0:
- scale_fac = scale_dis / sys_dis
- pg.pivot_scale = Vector((scale_fac, scale_fac, scale_fac))
+ sys_distance = pg.distance
+ scale_distance = pg.pivot_dis
+ if scale_distance > 0:
+ scale_factor = scale_distance / sys_distance
+ pg.pivot_scale = Vector((scale_factor, scale_factor, scale_factor))
diff --git a/precision_drawing_tools/pdt_library.py b/precision_drawing_tools/pdt_library.py
index 0620d3f2..0b57ed18 100644
--- a/precision_drawing_tools/pdt_library.py
+++ b/precision_drawing_tools/pdt_library.py
@@ -131,8 +131,8 @@ class PDT_OT_Append(Operator):
)
return {"FINISHED"}
- errmsg = PDT_ERR_NO_LIBRARY
- self.report({"ERROR"}, errmsg)
+ error_message = PDT_ERR_NO_LIBRARY
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
@@ -191,6 +191,6 @@ class PDT_OT_Link(Operator):
)
return {"FINISHED"}
- errmsg = PDT_ERR_NO_LIBRARY
- self.report({"ERROR"}, errmsg)
+ error_message = PDT_ERR_NO_LIBRARY
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
diff --git a/precision_drawing_tools/pdt_pivot_point.py b/precision_drawing_tools/pdt_pivot_point.py
index 76721e91..9b66ae2e 100644
--- a/precision_drawing_tools/pdt_pivot_point.py
+++ b/precision_drawing_tools/pdt_pivot_point.py
@@ -148,8 +148,8 @@ class PDT_OT_ViewPlaneRotate(Operator):
self.report({"ERROR"}, PDT_ERR_NO_ACT_OBJ)
return {"FINISHED"}
if obj.mode != "EDIT":
- errmsg = f"{PDT_ERR_EDIT_MODE} {obj.mode})"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{PDT_ERR_EDIT_MODE} {obj.mode})"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
bm = bmesh.from_edit_mesh(obj.data)
v1 = Vector((0, 0, 0))
@@ -203,8 +203,8 @@ class PDT_OT_ViewPlaneScale(Operator):
self.report({"ERROR"}, PDT_ERR_NO_ACT_OBJ)
return {"FINISHED"}
if obj.mode != "EDIT":
- errmsg = f"{PDT_ERR_EDIT_MODE} {obj.mode})"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{PDT_ERR_EDIT_MODE} {obj.mode})"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
bm = bmesh.from_edit_mesh(obj.data)
verts = verts = [v for v in bm.verts if v.select]
@@ -246,8 +246,8 @@ class PDT_OT_PivotToCursor(Operator):
scene = context.scene
pg = scene.pdt_pg
old_cursor_loc = scene.cursor.location.copy()
- scene.cursor.location = old_cursor_loc
pg.pivot_loc = scene.cursor.location
+ scene.cursor.location = old_cursor_loc
return {"FINISHED"}
@@ -312,8 +312,8 @@ class PDT_OT_PivotSelected(Operator):
self.report({"ERROR"}, PDT_ERR_NO_ACT_OBJ)
return {"FINISHED"}
if obj.mode != "EDIT":
- errmsg = f"{PDT_ERR_EDIT_MODE} {obj.mode})"
- self.report({"ERROR"}, errmsg)
+ error_message = f"{PDT_ERR_EDIT_MODE} {obj.mode})"
+ self.report({"ERROR"}, error_message)
return {"FINISHED"}
bm = bmesh.from_edit_mesh(obj.data)
verts = verts = [v for v in bm.verts if v.select]