diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-01-29 05:47:19 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-01-29 05:47:19 +0300 |
commit | b85840836438856c0a296bb8281aa459e076d129 (patch) | |
tree | 124dc56bbdcd1b8344dd10f707378f9bfea87e0b /add_curve_extra_objects | |
parent | 711829f2cd8b247bf0e17380684e3718dc202e65 (diff) |
Cleanup: trailing space
Diffstat (limited to 'add_curve_extra_objects')
-rw-r--r-- | add_curve_extra_objects/__init__.py | 8 | ||||
-rw-r--r-- | add_curve_extra_objects/add_curve_braid.py | 8 | ||||
-rw-r--r-- | add_curve_extra_objects/add_curve_celtic_links.py | 6 | ||||
-rw-r--r-- | add_curve_extra_objects/add_curve_curly.py | 26 | ||||
-rw-r--r-- | add_curve_extra_objects/add_curve_simple.py | 56 | ||||
-rw-r--r-- | add_curve_extra_objects/add_curve_spirals.py | 30 | ||||
-rw-r--r-- | add_curve_extra_objects/add_curve_torus_knots.py | 8 | ||||
-rw-r--r-- | add_curve_extra_objects/beveltaper_curve.py | 6 |
8 files changed, 74 insertions, 74 deletions
diff --git a/add_curve_extra_objects/__init__.py b/add_curve_extra_objects/__init__.py index e64944fe..1e63e812 100644 --- a/add_curve_extra_objects/__init__.py +++ b/add_curve_extra_objects/__init__.py @@ -276,7 +276,7 @@ def register(): from bpy.utils import register_class for cls in classes: register_class(cls) - + add_curve_simple.register() add_curve_spirals.register() add_curve_aceous_galore.register() @@ -287,7 +287,7 @@ def register(): add_curve_spirofit_bouncespline.register() add_surface_plane_cone.register() beveltaper_curve.register() - + # Add "Extras" menu to the "Add Curve" menu bpy.types.VIEW3D_MT_curve_add.append(menu_func) # Add "Extras" menu to the "Add Surface" menu @@ -299,7 +299,7 @@ def unregister(): bpy.types.VIEW3D_MT_curve_add.remove(menu_func) # Remove "Extras" menu from the "Add Surface" menu. bpy.types.VIEW3D_MT_surface_add.remove(menu_surface) - + add_surface_plane_cone.unregister() add_curve_spirofit_bouncespline.unregister() add_curve_curly.unregister() @@ -310,7 +310,7 @@ def unregister(): add_curve_spirals.unregister() add_curve_simple.unregister() beveltaper_curve.unregister() - + from bpy.utils import unregister_class for cls in reversed(classes): unregister_class(cls) diff --git a/add_curve_extra_objects/add_curve_braid.py b/add_curve_extra_objects/add_curve_braid.py index ae250682..8041b4bf 100644 --- a/add_curve_extra_objects/add_curve_braid.py +++ b/add_curve_extra_objects/add_curve_braid.py @@ -232,7 +232,7 @@ class Braid(Operator): col.label(text="Geometry Options:") col.prop(self, "strandsize") col.prop(self, "resolution") - + col = layout.column() col.row().prop(self, "edit_mode", expand=True) @@ -240,7 +240,7 @@ class Braid(Operator): # turn off 'Enter Edit Mode' use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode bpy.context.preferences.edit.use_enter_edit_mode = False - + circle = defaultCircle(self.strandsize) context.scene.collection.objects.link(circle) braid = awesome_braid( @@ -258,10 +258,10 @@ class Braid(Operator): ob.select_set(False) braid.select_set(True) bpy.context.view_layer.objects.active = braid - + if use_enter_edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') - + # restore pre operator state bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode diff --git a/add_curve_extra_objects/add_curve_celtic_links.py b/add_curve_extra_objects/add_curve_celtic_links.py index 87b778fe..d3136bdb 100644 --- a/add_curve_extra_objects/add_curve_celtic_links.py +++ b/add_curve_extra_objects/add_curve_celtic_links.py @@ -125,7 +125,7 @@ class CelticKnotOperator(Operator): # turn off 'Enter Edit Mode' use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode bpy.context.preferences.edit.use_enter_edit_mode = False - + # Cache some values s = sin(self.crossing_angle) * self.crossing_strength c = cos(self.crossing_angle) * self.crossing_strength @@ -271,9 +271,9 @@ class CelticKnotOperator(Operator): curve_obj.data.bevel_depth = self.geo_bDepth except: pass - + bpy.context.view_layer.objects.active = orig_obj - + # restore pre operator state bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode diff --git a/add_curve_extra_objects/add_curve_curly.py b/add_curve_extra_objects/add_curve_curly.py index 65990ee2..637269b5 100644 --- a/add_curve_extra_objects/add_curve_curly.py +++ b/add_curve_extra_objects/add_curve_curly.py @@ -388,7 +388,7 @@ def make_curve(self, context, verts, lh, rh): # create object if bpy.context.mode == 'EDIT_CURVE': Curve = context.active_object - + for spline in Curve.data.splines: if spline.type == 'BEZIER': for point in spline.bezier_points: @@ -417,7 +417,7 @@ def make_curve(self, context, verts, lh, rh): # something weird with this one if types == 1 or types == 2 or types == 3: newSpline.bezier_points[3].handle_left.xyz = lh[p][3] - + else: # create curve dataCurve = bpy.data.curves.new(name='CurlyCurve', type='CURVE') # curvedatablock @@ -438,8 +438,8 @@ def make_curve(self, context, verts, lh, rh): c += 1 # something weird with this one if types == 1 or types == 2 or types == 3: - newSpline.bezier_points[3].handle_left.xyz = lh[p][3] - + newSpline.bezier_points[3].handle_left.xyz = lh[p][3] + # create object with newCurve Curve = object_data_add(context, dataCurve, operator=self) # place in active scene Curve.select_set(True) @@ -451,7 +451,7 @@ def make_curve(self, context, verts, lh, rh): Curve.data.fill_mode = 'FULL' else: Curve.data.fill_mode = 'BOTH' - + # move and rotate spline in edit mode if bpy.context.mode == 'EDIT_CURVE': if self.align == "WORLD": @@ -460,7 +460,7 @@ def make_curve(self, context, verts, lh, rh): bpy.ops.transform.rotate(value = self.rotation[0], orient_axis = 'X', orient_type='GLOBAL') bpy.ops.transform.rotate(value = self.rotation[1], orient_axis = 'Y', orient_type='GLOBAL') bpy.ops.transform.rotate(value = self.rotation[2], orient_axis = 'Z', orient_type='GLOBAL') - + elif self.align == "VIEW": bpy.ops.transform.translate(value = self.location) bpy.ops.transform.rotate(value = self.rotation[0], orient_axis = 'X') @@ -508,7 +508,7 @@ class add_curlycurve(Operator, AddObjectHelper): ('3D', "3D", "3D") ] ) - + edit_mode : BoolProperty( name="Show in edit mode", default=True, @@ -526,13 +526,13 @@ class add_curlycurve(Operator, AddObjectHelper): col.label(text = "Resize:") col.prop(self, "scale_x") col.prop(self, "scale_y") - + row = layout.row() row.prop(self, "shape", expand=True) - + col = layout.column(align=True) col.row().prop(self, "edit_mode", expand=True) - + col = layout.column(align=True) # AddObjectHelper props col.prop(self, "align") @@ -543,7 +543,7 @@ class add_curlycurve(Operator, AddObjectHelper): # turn off 'Enter Edit Mode' use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode bpy.context.preferences.edit.use_enter_edit_mode = False - + if self.types == 1: add_type1(self, context) if self.types == 2: @@ -564,10 +564,10 @@ class add_curlycurve(Operator, AddObjectHelper): add_type9(self, context) if self.types == 10: add_type10(self, context) - + if use_enter_edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') - + # restore pre operator state bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode diff --git a/add_curve_extra_objects/add_curve_simple.py b/add_curve_extra_objects/add_curve_simple.py index 0e92c652..af055589 100644 --- a/add_curve_extra_objects/add_curve_simple.py +++ b/add_curve_extra_objects/add_curve_simple.py @@ -408,7 +408,7 @@ def vertsToPoints(Verts, splineType): def main(context, self, use_enter_edit_mode): # output splineType 'POLY' 'NURBS' 'BEZIER' splineType = self.outputType - + sides = abs(int((self.Simple_endangle - self.Simple_startangle) / 90)) # get verts @@ -499,25 +499,25 @@ def main(context, self, use_enter_edit_mode): verts = SimpleTrapezoid( self.Simple_a, self.Simple_b, self.Simple_h, self.Simple_center ) - + # turn verts into array vertArray = vertsToPoints(verts, splineType) - + # create object if bpy.context.mode == 'EDIT_CURVE': - + Curve = context.active_object newSpline = Curve.data.splines.new(type=splineType) # spline else: name = self.Simple_Type # Type as name - + dataCurve = bpy.data.curves.new(name, type='CURVE') # curve data block newSpline = dataCurve.splines.new(type=splineType) # spline # create object with new Curve Curve = object_utils.object_data_add(context, dataCurve, operator=self) # place in active scene Curve.select_set(True) - + for spline in Curve.data.splines: if spline.type == 'BEZIER': for point in spline.bezier_points: @@ -527,7 +527,7 @@ def main(context, self, use_enter_edit_mode): else: for point in spline.points: point.select = False - + # create spline from vertarray all_points = [] if splineType == 'BEZIER': @@ -547,7 +547,7 @@ def main(context, self, use_enter_edit_mode): for point in newSpline.points: all_points.append(point) point.select = True - + n = len(all_points) d = 2 * 0.27606262 @@ -613,7 +613,7 @@ def main(context, self, use_enter_edit_mode): p1.handle_right = v1 p2.handle_left = v2 i += 1 - + if self.Simple_Type == 'Ellipse': all_points[0].handle_right = Vector((self.Simple_a, self.Simple_b * d, 0)) all_points[0].handle_left = Vector((self.Simple_a, -self.Simple_b * d, 0)) @@ -623,7 +623,7 @@ def main(context, self, use_enter_edit_mode): all_points[2].handle_left = Vector((-self.Simple_a, self.Simple_b * d, 0)) all_points[3].handle_right = Vector((self.Simple_a * d, -self.Simple_b, 0)) all_points[3].handle_left = Vector((-self.Simple_a * d, -self.Simple_b, 0)) - + if self.Simple_Type == 'Arc': i = 0 for p1 in all_points: @@ -660,7 +660,7 @@ def main(context, self, use_enter_edit_mode): i += 1 all_points[0].handle_left_type = 'VECTOR' all_points[-1].handle_right_type = 'VECTOR' - + if self.Simple_Type == 'Sector': i = 0 for p1 in all_points: @@ -702,7 +702,7 @@ def main(context, self, use_enter_edit_mode): all_points[0].handle_right_type = 'VECTOR' all_points[1].handle_left_type = 'VECTOR' all_points[-1].handle_right_type = 'VECTOR' - + if self.Simple_Type == 'Segment': i = 0 if self.Simple_a > self.Simple_b: @@ -772,7 +772,7 @@ def main(context, self, use_enter_edit_mode): v2 = Vector((p2.co.x, p2.co.y, 0)) - vh2 p1.handle_right = v1 p2.handle_left = v2 - + i += 1 all_points[0].handle_left_type = 'VECTOR' all_points[n - 1].handle_right_type = 'VECTOR' @@ -783,7 +783,7 @@ def main(context, self, use_enter_edit_mode): newSpline.use_cyclic_u = self.use_cyclic_u newSpline.use_endpoint_u = self.endp_u newSpline.order_u = self.order_u - + # set curve Options Curve.data.dimensions = self.shape Curve.data.use_path = True @@ -791,7 +791,7 @@ def main(context, self, use_enter_edit_mode): Curve.data.fill_mode = 'FULL' else: Curve.data.fill_mode = 'BOTH' - + # move and rotate spline in edit mode if bpy.context.mode == 'EDIT_CURVE': if self.align == "WORLD": @@ -800,7 +800,7 @@ def main(context, self, use_enter_edit_mode): bpy.ops.transform.rotate(value = self.rotation[0], orient_axis = 'X', orient_type='GLOBAL') bpy.ops.transform.rotate(value = self.rotation[1], orient_axis = 'Y', orient_type='GLOBAL') bpy.ops.transform.rotate(value = self.rotation[2], orient_axis = 'Z', orient_type='GLOBAL') - + elif self.align == "VIEW": bpy.ops.transform.translate(value = self.location) bpy.ops.transform.rotate(value = self.rotation[0], orient_axis = 'X') @@ -875,7 +875,7 @@ def menu(self, context): oper14 = self.layout.operator(Simple.bl_idname, text="Trapezoid", icon="MOD_EDGESPLIT") oper14.Simple_Type = "Trapezoid" oper14.use_cyclic_u = True - + # ------------------------------------------------------------ # Simple operator @@ -1236,12 +1236,12 @@ class Simple(Operator, object_utils.AddObjectHelper): row = layout.row() row.prop(self, "shape", expand=True) - + # output options col = layout.column() col.label(text="Output Curve Type:") col.row().prop(self, "outputType", expand=True) - + if self.outputType == 'NURBS': col.prop(self, "order_u") elif self.outputType == 'BEZIER': @@ -1249,10 +1249,10 @@ class Simple(Operator, object_utils.AddObjectHelper): col = layout.column() col.row().prop(self, "use_cyclic_u", expand=True) - + col = layout.column() col.row().prop(self, "edit_mode", expand=True) - + col = layout.column() # AddObjectHelper props col.prop(self, "align") @@ -1274,29 +1274,29 @@ class Simple(Operator, object_utils.AddObjectHelper): return context.scene is not None def execute(self, context): - + # turn off 'Enter Edit Mode' use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode bpy.context.preferences.edit.use_enter_edit_mode = False - + # main function main(context, self, use_enter_edit_mode) - + if use_enter_edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') - + # restore pre operator state bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode - + if self.edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') else: bpy.ops.object.mode_set(mode = 'OBJECT') return {'FINISHED'} - + def invoke(self, context, event): - + self.execute(context) return {'FINISHED'} diff --git a/add_curve_extra_objects/add_curve_spirals.py b/add_curve_extra_objects/add_curve_spirals.py index e916fbe5..55495ddf 100644 --- a/add_curve_extra_objects/add_curve_spirals.py +++ b/add_curve_extra_objects/add_curve_spirals.py @@ -220,7 +220,7 @@ def vertsToPoints(Verts, splineType): def draw_curve(props, context, align_matrix): # output splineType 'POLY' 'NURBS' 'BEZIER' splineType = props.curve_type - + if props.spiral_type == 'ARCH': verts = make_spiral(props, context) if props.spiral_type == 'LOG': @@ -238,13 +238,13 @@ def draw_curve(props, context, align_matrix): # create curve dataCurve = bpy.data.curves.new(name='Spiral', type='CURVE') # curvedatablock newSpline = dataCurve.splines.new(type=splineType) # spline - + # create object with newCurve Curve = object_data_add(context, dataCurve) # place in active scene Curve.matrix_world = align_matrix # apply matrix Curve.rotation_euler = props.rotation_euler Curve.select_set(True) - + # set curveOptions Curve.data.dimensions = props.shape Curve.data.use_path = True @@ -252,15 +252,15 @@ def draw_curve(props, context, align_matrix): Curve.data.fill_mode = 'FULL' else: Curve.data.fill_mode = 'BOTH' - + # set curveOptions newSpline.use_cyclic_u = props.use_cyclic_u newSpline.use_endpoint_u = props.endp_u newSpline.order_u = props.order_u - + # turn verts into array vertArray = vertsToPoints(verts, splineType) - + for spline in Curve.data.splines: if spline.type == 'BEZIER': for point in spline.bezier_points: @@ -270,7 +270,7 @@ def draw_curve(props, context, align_matrix): else: for point in spline.points: point.select = False - + # create newSpline from vertarray if splineType == 'BEZIER': newSpline.bezier_points.add(int(len(vertArray) * 0.33)) @@ -303,7 +303,7 @@ class CURVE_OT_spirals(Operator): # align_matrix for the invoke align_matrix : Matrix() - + spiral_type : EnumProperty( items=[('ARCH', "Archemedian", "Archemedian"), ("LOG", "Logarithmic", "Logarithmic"), @@ -513,12 +513,12 @@ class CURVE_OT_spirals(Operator): row = layout.row() row.prop(self, "shape", expand=True) - + # output options col = layout.column() col.label(text="Output Curve Type:") col.row().prop(self, "curve_type", expand=True) - + if self.curve_type == 'NURBS': col.prop(self, "order_u") elif self.curve_type == 'BEZIER': @@ -529,7 +529,7 @@ class CURVE_OT_spirals(Operator): col = layout.column() col.row().prop(self, "edit_mode", expand=True) - + box = layout.box() box.label(text="Location:") box.prop(self, "startlocation") @@ -545,17 +545,17 @@ class CURVE_OT_spirals(Operator): # turn off 'Enter Edit Mode' use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode bpy.context.preferences.edit.use_enter_edit_mode = False - + time_start = time.time() self.align_matrix = align_matrix(context, self.startlocation) draw_curve(self, context, self.align_matrix) - + if use_enter_edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') - + # restore pre operator state bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode - + if self.edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') else: diff --git a/add_curve_extra_objects/add_curve_torus_knots.py b/add_curve_extra_objects/add_curve_torus_knots.py index 95207493..427aaf4a 100644 --- a/add_curve_extra_objects/add_curve_torus_knots.py +++ b/add_curve_extra_objects/add_curve_torus_knots.py @@ -669,7 +669,7 @@ class torus_knot_plus(Operator, AddObjectHelper): box.prop(self, "colorSet") box.prop(self, "random_colors") box.prop(self, "saturation") - + col = layout.column() col.row().prop(self, "edit_mode", expand=True) @@ -689,7 +689,7 @@ class torus_knot_plus(Operator, AddObjectHelper): # turn off 'Enter Edit Mode' use_enter_edit_mode = bpy.context.preferences.edit.use_enter_edit_mode bpy.context.preferences.edit.use_enter_edit_mode = False - + if self.mode == 'EXT_INT': # adjust the equivalent radii pair : (R,r) <=> (eR,iR) self.torus_R = (self.torus_eR + self.torus_iR) * 0.5 @@ -721,10 +721,10 @@ class torus_knot_plus(Operator, AddObjectHelper): # create the curve create_torus_knot(self, context) - + if use_enter_edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') - + # restore pre operator state bpy.context.preferences.edit.use_enter_edit_mode = use_enter_edit_mode diff --git a/add_curve_extra_objects/beveltaper_curve.py b/add_curve_extra_objects/beveltaper_curve.py index d3cc4a93..6e11ada6 100644 --- a/add_curve_extra_objects/beveltaper_curve.py +++ b/add_curve_extra_objects/beveltaper_curve.py @@ -313,7 +313,7 @@ class add_tapercurve(Operator): col_sub.active = self.link2 row.prop(self, "link2", toggle=True, text="", icon="LINKED") col_sub.prop(self, "diff") - + col = layout.column() col.row().prop(self, "edit_mode", expand=True) @@ -325,7 +325,7 @@ class add_tapercurve(Operator): self.scale_ends2 = self.scale_ends1 = self.scale_mid - self.diff add_taper(self, context) - + if self.edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') else: @@ -410,7 +410,7 @@ class add_bevelcurve(Operator, AddObjectHelper): add_type4(self, context) if self.types == 5: add_type5(self, context) - + if self.edit_mode: bpy.ops.object.mode_set(mode = 'EDIT') else: |