Skip to content

Commit

Permalink
Cleanup: trailing space
Browse files Browse the repository at this point in the history
  • Loading branch information
ideasman42 committed Jan 29, 2020
1 parent 711829f commit b858408
Show file tree
Hide file tree
Showing 84 changed files with 747 additions and 747 deletions.
8 changes: 4 additions & 4 deletions add_curve_extra_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -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()
Expand All @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions add_curve_extra_objects/add_curve_braid.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ def draw(self, context):
col.label(text="Geometry Options:")
col.prop(self, "strandsize")
col.prop(self, "resolution")

col = layout.column()
col.row().prop(self, "edit_mode", expand=True)

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

circle = defaultCircle(self.strandsize)
context.scene.collection.objects.link(circle)
braid = awesome_braid(
Expand All @@ -258,10 +258,10 @@ def execute(self, context):
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

Expand Down
6 changes: 3 additions & 3 deletions add_curve_extra_objects/add_curve_celtic_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ 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

# Cache some values
s = sin(self.crossing_angle) * self.crossing_strength
c = cos(self.crossing_angle) * self.crossing_strength
Expand Down Expand Up @@ -271,9 +271,9 @@ def make_loop(loop, forward):
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

Expand Down
26 changes: 13 additions & 13 deletions add_curve_extra_objects/add_curve_curly.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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":
Expand All @@ -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')
Expand Down Expand Up @@ -508,7 +508,7 @@ class add_curlycurve(Operator, AddObjectHelper):
('3D', "3D", "3D")
]
)

edit_mode : BoolProperty(
name="Show in edit mode",
default=True,
Expand All @@ -526,13 +526,13 @@ def draw(self, context):
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")
Expand All @@ -543,7 +543,7 @@ 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

if self.types == 1:
add_type1(self, context)
if self.types == 2:
Expand All @@ -564,10 +564,10 @@ def execute(self, context):
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

Expand Down
56 changes: 28 additions & 28 deletions add_curve_extra_objects/add_curve_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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':
Expand All @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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'
Expand All @@ -783,15 +783,15 @@ 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
if self.shape == '3D':
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":
Expand All @@ -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')
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -1236,23 +1236,23 @@ def draw(self, context):

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':
col.row().prop(self, 'handleType', expand=True)

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")
Expand All @@ -1274,29 +1274,29 @@ def poll(cls, context):
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'}
Expand Down
Loading

0 comments on commit b858408

Please sign in to comment.