Cleanup: strip trailing space, remove BOM

This commit is contained in:
Campbell Barton 2021-08-11 10:09:25 +10:00
parent 2acf22b593
commit aec02fd095
9 changed files with 29 additions and 29 deletions

View File

@ -1,4 +1,4 @@
# ##### BEGIN GPL LICENSE BLOCK #####
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -486,4 +486,4 @@ def make_possible_reductions_on_image(teximage, input_filepath, do_reductions=Fa
ims.quality = orig_quality
ims.color_mode = orig_color_mode
ims.compression = orig_compression
ims.color_depth = orig_depth
ims.color_depth = orig_depth

View File

@ -333,7 +333,7 @@ def cancel_cage(self):
self.gp_obj.grease_pencil_modifiers.remove(mod)
else:
print(f'tmp_lattice modifier not found to remove on {self.gp_obj.name}')
for ob in self.other_gp:
mod = ob.grease_pencil_modifiers.get('tmp_lattice')
if mod:
@ -586,7 +586,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
## silent return
return {'CANCELLED'}
# bpy.ops.ed.undo_push(message="Box deform step")#don't work as expected (+ might be obsolete)
# https://developer.blender.org/D6147 <- undo forget

View File

@ -89,7 +89,7 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences):
name = "Use Hud",
description = "Display angle lines and angle value as text on viewport",
default = False)
canvas_use_view_center: BoolProperty(
name = "Rotate From View Center In Camera",
description = "Rotate from view center in camera view, Else rotate from camera center",

View File

@ -136,7 +136,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
## area deformation restore
new_cam_offset = mathutils.Vector((new_cam_offset[0], new_cam_offset[1] * self.ratio_inv))
context.space_data.region_3d.view_camera_offset = new_cam_offset
else: # free view
@ -187,7 +187,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
# CORRECT UI OVERLAP FROM HEADER TOOLBAR
regs = context.area.regions
if context.preferences.system.use_region_overlap:
w = context.area.width
w = context.area.width
# minus tool header
h = context.area.height - regs[0].height
else:
@ -195,9 +195,9 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
w = context.area.width - regs[2].width - regs[3].width
# minus tool header + header
h = context.area.height - regs[0].height - regs[1].height
self.ratio = h / w
self.ratio_inv = w / h
self.ratio_inv = w / h
if self.in_cam:
# Get camera from scene
@ -207,8 +207,8 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
if self.cam.lock_rotation[:] != (False, False, False):
self.report({'WARNING'}, 'Camera rotation is locked')
return {'CANCELLED'}
if self.use_view_center:
if self.use_view_center:
self.center = mathutils.Vector((w/2, h/2))
else:
self.center = self.get_center_view(context, self.cam)
@ -220,7 +220,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
# store camera matrix world
self.cam_matrix = self.cam.matrix_world.copy()
# self.cam_init_euler = self.cam.rotation_euler.copy()
## initialize current view_offset in camera
self.view_cam_offset = mathutils.Vector(context.space_data.region_3d.view_camera_offset)

View File

@ -211,7 +211,7 @@ class GPTS_OT_time_scrub(bpy.types.Operator):
else:
self.init_index = 0
self.init_frame = self.new_frame = self.pos[0]
# del active_pos
self.index_limit = len(self.pos) - 1
@ -311,14 +311,14 @@ class GPTS_OT_time_scrub(bpy.types.Operator):
shader = gpu.shader.from_builtin('2D_UNIFORM_COLOR') # initiate shader
self.batch_timeline = batch_for_shader(
shader, 'LINES', {"pos": self.hud_lines})
if self.rolling_mode:
current_id = self.pos.index(self.new_frame)
# Add init_frame to "cancel" it in later UI code
ui_key_pos = [i - current_id + self.init_frame for i, _f in enumerate(self.pos[:-2])]
else:
ui_key_pos = self.pos[:-2]
# keyframe display
if self.keyframe_aspect == 'LINE':
@ -716,7 +716,7 @@ def draw_ts_pref(prefs, layout):
snap_text = 'Disable keyframes snap: '
else:
snap_text = 'Keyframes snap: '
snap_text += 'Left Mouse' if prefs.keycode == 'RIGHTMOUSE' else 'Right Mouse'
if not prefs.use_ctrl:
snap_text += ' or Ctrl'
@ -724,7 +724,7 @@ def draw_ts_pref(prefs, layout):
snap_text += ' or Shift'
if not prefs.use_alt:
snap_text += ' or Alt'
if prefs.rolling_mode:
snap_text = 'Gap-less mode (always snap)'

View File

@ -1,4 +1,4 @@
# ##### BEGIN GPL LICENSE BLOCK #####
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License

View File

@ -1893,7 +1893,7 @@ class NWPreviewNode(Operator, NWBase):
# Exit early
if not valid:
return {'FINISHED'}
delete_sockets = []
# Scan through all nodes in tree including nodes inside of groups to find viewer sockets
@ -1926,7 +1926,7 @@ class NWPreviewNode(Operator, NWBase):
if out_i is None:
return {'FINISHED'}
socket_type = 'GEOMETRY'
# Find an input socket of the output of type geometry
# Find an input socket of the output of type geometry
geometryoutindex = None
for i,inp in enumerate(geometryoutput.inputs):
if inp.type == socket_type:
@ -2430,13 +2430,13 @@ class NWMergeNodes(Operator, NWBase):
# Check if the link connects to a node that is in selected_nodes
# If not, then check recursively for each link in the nodes outputs.
# If yes, return True. If the recursion stops without finding a node
# in selected_nodes, it returns False. The depth is used to prevent
# in selected_nodes, it returns False. The depth is used to prevent
# getting stuck in a loop because of an already present cycle.
@staticmethod
def link_creates_cycle(link, selected_nodes, depth=0)->bool:
if depth > 255:
# We're stuck in a cycle, but that cycle was already present,
# so we return False.
# so we return False.
# NOTE: The number 255 is arbitrary, but seems to work well.
return False
node = link.to_node
@ -2451,7 +2451,7 @@ class NWMergeNodes(Operator, NWBase):
return True
# None of the outputs found a node in selected_nodes, so there is no cycle.
return False
# Merge the nodes in `nodes_list` with a node of type `node_name` that has a multi_input socket.
# The parameters `socket_indices` gives the indices of the node sockets in the order that they should
# be connected. The last one is assumed to be a multi input socket.
@ -2597,7 +2597,7 @@ class NWMergeNodes(Operator, NWBase):
# get maximum loc_x
loc_x = nodes_list[0][1] + nodes_list[0][3] + 70
nodes_list.sort(key=lambda k: k[2], reverse=True)
# Change the node type for math nodes in a geometry node tree.
if tree_type == 'GEOMETRY':
if nodes_list is selected_math or nodes_list is selected_vector:
@ -2709,7 +2709,7 @@ class NWMergeNodes(Operator, NWBase):
add.location = loc_x, loc_y
loc_y += offset_y
add.select = True
# This has already been handled separately
if was_multi:
continue
@ -2721,7 +2721,7 @@ class NWMergeNodes(Operator, NWBase):
last_add = nodes[count_before]
# Create list of invalid indexes.
invalid_nodes = [nodes[n[0]] for n in (selected_mix + selected_math + selected_shader + selected_z + selected_geometry)]
# Special case:
# Two nodes were selected and first selected has no output links, second selected has output links.
# Then add links from last add to all links 'to_socket' of out links of second selected.
@ -4385,7 +4385,7 @@ class NWConnectionListOutputs(Menu, NWBase):
n1 = nodes[context.scene.NWLazySource]
index=0
for o in n1.outputs:
# Only show sockets that are exposed.
# Only show sockets that are exposed.
if o.enabled:
layout.operator(NWCallInputsMenu.bl_idname, text=o.name, icon="RADIOBUT_OFF").from_socket=index
index+=1
@ -4406,7 +4406,7 @@ class NWConnectionListInputs(Menu, NWBase):
# Only show sockets that are exposed.
# This prevents, for example, the scale value socket
# of the vector math node being added to the list when
# the mode is not 'SCALE'.
# the mode is not 'SCALE'.
if i.enabled:
op = layout.operator(NWMakeLink.bl_idname, text=i.name, icon="FORWARD")
op.from_socket = context.scene.NWSourceSocket

View File

@ -928,7 +928,7 @@ class VIEW3D_MT_rigify(bpy.types.Menu):
layout = self.layout
layout.operator(Generate.bl_idname, text="Generate")
if context.mode == 'EDIT_ARMATURE':
layout.separator()
layout.operator(Sample.bl_idname)