Skip to content

Commit

Permalink
3D-Print: Cleanup convert docstrings to bl_description
Browse files Browse the repository at this point in the history
  • Loading branch information
mrachinskiy committed Oct 8, 2019
1 parent 4d3b1dc commit b25958d
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions object_print3d_utils/operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ def clean_float(text):
# Mesh Info

class MESH_OT_print3d_info_volume(Operator):
"""Report the volume of the active mesh"""
bl_idname = "mesh.print3d_info_volume"
bl_label = "3D-Print Info Volume"
bl_description = "Report the volume of the active mesh"

def execute(self, context):
scene = context.scene
Expand All @@ -78,9 +78,9 @@ def execute(self, context):


class MESH_OT_print3d_info_area(Operator):
"""Report the surface area of the active mesh"""
bl_idname = "mesh.print3d_info_area"
bl_label = "3D-Print Info Area"
bl_description = "Report the surface area of the active mesh"

def execute(self, context):
scene = context.scene
Expand Down Expand Up @@ -127,9 +127,9 @@ def multiple_obj_warning(self, context):


class MESH_OT_print3d_check_solid(Operator):
"""Check for geometry is solid (has valid inside/outside) and correct normals"""
bl_idname = "mesh.print3d_check_solid"
bl_label = "3D-Print Check Solid"
bl_description = "Check for geometry is solid (has valid inside/outside) and correct normals"

@staticmethod
def main_check(obj, info):
Expand All @@ -153,9 +153,9 @@ def execute(self, context):


class MESH_OT_print3d_check_intersections(Operator):
"""Check geometry for self intersections"""
bl_idname = "mesh.print3d_check_intersect"
bl_label = "3D-Print Check Intersections"
bl_description = "Check geometry for self intersections"

@staticmethod
def main_check(obj, info):
Expand All @@ -167,10 +167,12 @@ def execute(self, context):


class MESH_OT_print3d_check_degenerate(Operator):
"""Check for degenerate geometry that may not print properly """ \
"""(zero area faces, zero length edges)"""
bl_idname = "mesh.print3d_check_degenerate"
bl_label = "3D-Print Check Degenerate"
bl_description = (
"Check for degenerate geometry that may not print properly "
"(zero area faces, zero length edges)"
)

@staticmethod
def main_check(obj, info):
Expand All @@ -195,9 +197,9 @@ def execute(self, context):


class MESH_OT_print3d_check_distorted(Operator):
"""Check for non-flat faces """
bl_idname = "mesh.print3d_check_distort"
bl_label = "3D-Print Check Distorted Faces"
bl_description = "Check for non-flat faces "

@staticmethod
def main_check(obj, info):
Expand All @@ -224,10 +226,12 @@ def execute(self, context):


class MESH_OT_print3d_check_thick(Operator):
"""Check geometry is above the minimum thickness preference """ \
"""(relies on correct normals)"""
bl_idname = "mesh.print3d_check_thick"
bl_label = "3D-Print Check Thickness"
bl_description = (
"Check geometry is above the minimum thickness preference "
"(relies on correct normals)"
)

@staticmethod
def main_check(obj, info):
Expand All @@ -242,9 +246,9 @@ def execute(self, context):


class MESH_OT_print3d_check_sharp(Operator):
"""Check edges are below the sharpness preference"""
bl_idname = "mesh.print3d_check_sharp"
bl_label = "3D-Print Check Sharp"
bl_description = "Check edges are below the sharpness preference"

@staticmethod
def main_check(obj, info):
Expand All @@ -268,9 +272,9 @@ def execute(self, context):


class MESH_OT_print3d_check_overhang(Operator):
"""Check faces don't overhang past a certain angle"""
bl_idname = "mesh.print3d_check_overhang"
bl_label = "3D-Print Check Overhang"
bl_description = "Check faces don't overhang past a certain angle"

@staticmethod
def main_check(obj, info):
Expand Down Expand Up @@ -305,9 +309,9 @@ def execute(self, context):


class MESH_OT_print3d_check_all(Operator):
"""Run all checks"""
bl_idname = "mesh.print3d_check_all"
bl_label = "3D-Print Check All"
bl_description = "Run all checks"

check_cls = (
MESH_OT_print3d_check_solid,
Expand All @@ -334,9 +338,9 @@ def execute(self, context):


class MESH_OT_print3d_clean_isolated(Operator):
"""Cleanup isolated vertices and edges"""
bl_idname = "mesh.print3d_clean_isolated"
bl_label = "3D-Print Clean Isolated "
bl_label = "3D-Print Clean Isolated"
bl_description = "Cleanup isolated vertices and edges"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
Expand Down Expand Up @@ -396,9 +400,9 @@ def vert_is_isolated(ele):


class MESH_OT_print3d_clean_distorted(Operator):
"""Tessellate distorted faces"""
bl_idname = "mesh.print3d_clean_distorted"
bl_label = "3D-Print Clean Distorted"
bl_description = "Tessellate distorted faces"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
Expand All @@ -422,9 +426,9 @@ def execute(self, context):


class MESH_OT_print3d_clean_non_manifold(Operator):
"""Cleanup problems, like holes, non-manifold vertices, and inverted normals"""
bl_idname = "mesh.print3d_clean_non_manifold"
bl_label = "3D-Print Clean Non-Manifold and Inverted"
bl_description = "Cleanup problems, like holes, non-manifold vertices, and inverted normals"
bl_options = {'REGISTER', 'UNDO'}

threshold: bpy.props.FloatProperty(
Expand Down Expand Up @@ -550,7 +554,7 @@ def count_non_manifold_verts(cls, context):

@classmethod
def fill_non_manifold(cls, sides):
"""fill holes and then fill in any remnant non-manifolds"""
"""fill in any remnant non-manifolds"""
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.fill_holes(sides=sides)

Expand All @@ -562,9 +566,9 @@ def delete_newly_generated_non_manifold_verts(cls):


class MESH_OT_print3d_clean_thin(Operator):
"""Ensure minimum thickness"""
bl_idname = "mesh.print3d_clean_thin"
bl_label = "3D-Print Clean Thin"
bl_description = "Ensure minimum thickness"
bl_options = {'REGISTER', 'UNDO'}

def execute(self, context):
Expand All @@ -578,9 +582,9 @@ def execute(self, context):
# ... helper function for info UI

class MESH_OT_print3d_select_report(Operator):
"""Select the data associated with this report"""
bl_idname = "mesh.print3d_select_report"
bl_label = "3D-Print Select Report"
bl_description = "Select the data associated with this report"
bl_options = {'INTERNAL'}

index: IntProperty()
Expand Down Expand Up @@ -632,9 +636,9 @@ def _scale(scale, report=None, report_suffix=""):


class MESH_OT_print3d_scale_to_volume(Operator):
"""Scale edit-mesh or selected-objects to a set volume"""
bl_idname = "mesh.print3d_scale_to_volume"
bl_label = "Scale to Volume"
bl_description = "Scale edit-mesh or selected-objects to a set volume"
bl_options = {'REGISTER', 'UNDO'}

volume_init: FloatProperty(
Expand Down Expand Up @@ -679,9 +683,9 @@ def calc_volume(obj):


class MESH_OT_print3d_scale_to_bounds(Operator):
"""Scale edit-mesh or selected-objects to fit within a maximum length"""
bl_idname = "mesh.print3d_scale_to_bounds"
bl_label = "Scale to Bounds"
bl_description = "Scale edit-mesh or selected-objects to fit within a maximum length"
bl_options = {'REGISTER', 'UNDO'}

length_init: FloatProperty(
Expand Down Expand Up @@ -737,9 +741,9 @@ def calc_length(vecs):
# Export

class MESH_OT_print3d_export(Operator):
"""Export active object using print3d settings"""
bl_idname = "mesh.print3d_export"
bl_label = "3D-Print Export"
bl_description = "Export active object using 3D-Print settings"

def execute(self, context):
from . import export
Expand Down

0 comments on commit b25958d

Please sign in to comment.