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:
authorCampbell Barton <ideasman42@gmail.com>2021-01-25 04:33:47 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-01-25 04:33:59 +0300
commit425a3f6a705beab849cab36d2ca2ae43726d700f (patch)
tree00802f0b1efac9d9fc8b7b4062ab5349ca90722d /greasepencil_tools
parent3c6e9c26bc6b35399dfbc38c3116b1375fa6f53c (diff)
Cleanup: strip trailing space
Diffstat (limited to 'greasepencil_tools')
-rw-r--r--greasepencil_tools/box_deform.py74
-rw-r--r--greasepencil_tools/import_brush_pack.py24
-rw-r--r--greasepencil_tools/line_reshape.py36
-rw-r--r--greasepencil_tools/prefs.py16
-rw-r--r--greasepencil_tools/rotate_canvas.py20
-rw-r--r--greasepencil_tools/timeline_scrub.py2
-rw-r--r--greasepencil_tools/ui_panels.py2
7 files changed, 87 insertions, 87 deletions
diff --git a/greasepencil_tools/box_deform.py b/greasepencil_tools/box_deform.py
index 1f6d3abf..502c18ed 100644
--- a/greasepencil_tools/box_deform.py
+++ b/greasepencil_tools/box_deform.py
@@ -60,7 +60,7 @@ def view_cage(obj):
target_frames = [f for f in l.frames if f.select]
else:
target_frames = [l.active_frame]
-
+
for f in target_frames:
for s in f.strokes:
if not s.select:
@@ -77,7 +77,7 @@ def view_cage(obj):
for s in l.active_frame.strokes:
for p in s.points:
coords.append(obj.matrix_world @ p.co)
-
+
elif bpy.context.mode == 'PAINT_GPENCIL':
# get last stroke points coordinated
if not gpl.active or not gpl.active.active_frame:
@@ -85,12 +85,12 @@ def view_cage(obj):
if not len(gpl.active.active_frame.strokes):
return 'No stroke found to deform'
-
+
paint_id = -1
if bpy.context.scene.tool_settings.use_gpencil_draw_onback:
paint_id = 0
coords = [obj.matrix_world @ p.co for p in gpl.active.active_frame.strokes[paint_id].points]
-
+
else:
return 'Wrong mode!'
@@ -106,24 +106,24 @@ def view_cage(obj):
if bpy.context.mode == 'EDIT_GPENCIL':
vg = assign_vg(obj, vg_name)
-
+
if bpy.context.mode == 'PAINT_GPENCIL':
# points cannot be assign to API yet(ugly and slow workaround but only way)
# -> https://developer.blender.org/T56280 so, hop'in'ops !
-
+
# store selection and deselect all
plist = []
for s in gpl.active.active_frame.strokes:
for p in s.points:
plist.append([p, p.select])
p.select = False
-
+
# select
## foreach_set does not update
# gpl.active.active_frame.strokes[paint_id].points.foreach_set('select', [True]*len(gpl.active.active_frame.strokes[paint_id].points))
for p in gpl.active.active_frame.strokes[paint_id].points:
p.select = True
-
+
# assign
bpy.ops.object.mode_set(mode='EDIT_GPENCIL')
vg = assign_vg(obj, vg_name)
@@ -131,7 +131,7 @@ def view_cage(obj):
# restore
for pl in plist:
pl[0].select = pl[1]
-
+
## View axis Mode ---
@@ -216,7 +216,7 @@ def view_cage(obj):
if initial_mode == 'PAINT_GPENCIL':
mod.layer = gpl.active.info
-
+
# note : if initial was Paint, changed to Edit
# so vertex attribution is valid even for paint
if bpy.context.mode == 'EDIT_GPENCIL':
@@ -226,7 +226,7 @@ def view_cage(obj):
if bpy.context.mode != 'OBJECT':
bpy.ops.object.mode_set(mode='OBJECT')
- # Store name of deformed object in case of 'revive modal'
+ # Store name of deformed object in case of 'revive modal'
cage.vertex_groups.new(name=obj.name)
## select and make cage active
@@ -245,7 +245,7 @@ def view_cage(obj):
def back_to_obj(obj, gp_mode, org_lattice_toolset, context):
if context.mode == 'EDIT_LATTICE' and org_lattice_toolset:# Tweaktoolcode - restore the active tool used by lattice edit..
bpy.ops.wm.tool_set_by_id(name = org_lattice_toolset)# Tweaktoolcode
-
+
# gp object active and selected
bpy.ops.object.mode_set(mode='OBJECT')
obj.select_set(True)
@@ -273,9 +273,9 @@ def cancel_cage(gp_obj, cage):
gp_obj.grease_pencil_modifiers.remove(mod)
else:
print('tmp_lattice modifier not found to remove...')
-
+
delete_cage(cage)
-
+
class GP_OT_latticeGpDeform(bpy.types.Operator):
"""Create a lattice to use as quad corner transform"""
@@ -302,7 +302,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
if event.type in {'Z'} and event.value == 'PRESS' and event.ctrl:
## Disable (capture key)
return {"RUNNING_MODAL"}
- ## Not found how possible to find modal start point in undo stack to
+ ## Not found how possible to find modal start point in undo stack to
# print('ops list', context.window_manager.operators.keys())
# if context.window_manager.operators:#can be empty
# print('\nlast name', context.window_manager.operators[-1].name)
@@ -320,7 +320,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
if event.type in {'H'} and event.value == 'PRESS':
# self.report({'INFO'}, "Can't hide")
return {"RUNNING_MODAL"}
-
+
if event.type in {'ONE'} and event.value == 'PRESS':# , 'NUMPAD_1'
self.lat.points_u = self.lat.points_v = 2
return {"RUNNING_MODAL"}
@@ -361,25 +361,25 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
self.lat.points_u = 2
self.lat.points_v = 1
return {"RUNNING_MODAL"}
-
+
if event.type in {'RIGHT_ARROW'} and event.value == 'PRESS' and event.ctrl:
if self.lat.points_u < 20:
- self.lat.points_u += 1
+ self.lat.points_u += 1
return {"RUNNING_MODAL"}
if event.type in {'LEFT_ARROW'} and event.value == 'PRESS' and event.ctrl:
if self.lat.points_u > 1:
- self.lat.points_u -= 1
+ self.lat.points_u -= 1
return {"RUNNING_MODAL"}
if event.type in {'UP_ARROW'} and event.value == 'PRESS' and event.ctrl:
if self.lat.points_v < 20:
- self.lat.points_v += 1
+ self.lat.points_v += 1
return {"RUNNING_MODAL"}
if event.type in {'DOWN_ARROW'} and event.value == 'PRESS' and event.ctrl:
if self.lat.points_v > 1:
- self.lat.points_v -= 1
+ self.lat.points_v -= 1
return {"RUNNING_MODAL"}
@@ -397,15 +397,15 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
self.restore_prefs(context)
back_to_obj(self.gp_obj, self.gp_mode, self.org_lattice_toolset, context)
apply_cage(self.gp_obj, self.cage)#must be in object mode
-
- # back to original mode
+
+ # back to original mode
if self.gp_mode != 'OBJECT':
bpy.ops.object.mode_set(mode=self.gp_mode)
context.area.header_text_set(None)#reset header
return {'FINISHED'}
-
+
# Abort ---
# One Warning for Tab cancellation.
if event.type == 'TAB' and event.value == 'PRESS':
@@ -432,14 +432,14 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
self.restore_prefs(context)
back_to_obj(self.gp_obj, self.gp_mode, self.org_lattice_toolset, context)
cancel_cage(self.gp_obj, self.cage)
- context.area.header_text_set(None)
+ context.area.header_text_set(None)
if self.gp_mode != 'OBJECT':
bpy.ops.object.mode_set(mode=self.gp_mode)
def store_prefs(self, context):
# store_valierables <-< preferences
- self.use_drag_immediately = context.preferences.inputs.use_drag_immediately
- self.drag_threshold_mouse = context.preferences.inputs.drag_threshold_mouse
+ self.use_drag_immediately = context.preferences.inputs.use_drag_immediately
+ self.drag_threshold_mouse = context.preferences.inputs.drag_threshold_mouse
self.drag_threshold_tablet = context.preferences.inputs.drag_threshold_tablet
self.use_overlays = context.space_data.overlay.show_overlays
# maybe store in windows manager to keep around in case of modal revival ?
@@ -450,7 +450,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
context.preferences.inputs.drag_threshold_mouse = self.drag_threshold_mouse
context.preferences.inputs.drag_threshold_tablet = self.drag_threshold_tablet
context.space_data.overlay.show_overlays = self.use_overlays
-
+
def set_prefs(self, context):
context.preferences.inputs.use_drag_immediately = True
context.preferences.inputs.drag_threshold_mouse = 1
@@ -475,8 +475,8 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
self.org_lattice_toolset = None
## usability toggles
if self.prefs.use_clic_drag:#Store the active tool since we will change it
- self.org_lattice_toolset = bpy.context.workspace.tools.from_space_view3d_mode(bpy.context.mode, create=False).idname# Tweaktoolcode
-
+ self.org_lattice_toolset = bpy.context.workspace.tools.from_space_view3d_mode(bpy.context.mode, create=False).idname# Tweaktoolcode
+
#store (scene properties needed in case of ctrlZ revival)
self.store_prefs(context)
self.gp_mode = 'EDIT_GPENCIL'
@@ -502,17 +502,17 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
if context.object.type != 'GPENCIL':
# self.report({'ERROR'}, "Works only on gpencil objects")
- ## silent return
+ ## silent return
return {'CANCELLED'}
#paint need VG workaround. object need good shortcut
if context.mode not in ('EDIT_GPENCIL', 'OBJECT', 'PAINT_GPENCIL'):
# self.report({'WARNING'}, "Works only in following GPencil modes: edit")# ERROR
- ## silent return
+ ## 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
+ # https://developer.blender.org/D6147 <- undo forget
self.gp_obj = context.object
# Clean potential failed previous job (delete tmp lattice)
@@ -529,10 +529,10 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
if [m for m in self.gp_obj.grease_pencil_modifiers if m.type == 'GP_LATTICE']:
self.report({'ERROR'}, "Grease pencil object already has a lattice modifier (can only have one)")
return {'CANCELLED'}
-
+
self.gp_mode = context.mode#store mode for restore
-
+
# All good, create lattice and start modal
# Create lattice (and switch to lattice edit) ----
@@ -540,7 +540,7 @@ valid:Spacebar/Enter, cancel:Del/Backspace/Tab/Ctrl+T"
if isinstance(self.cage, str):#error, cage not created, display error
self.report({'ERROR'}, self.cage)
return {'CANCELLED'}
-
+
self.lat = self.cage.data
self.set_prefs(context)
@@ -581,4 +581,4 @@ def unregister():
wm = bpy.context.window_manager
p = 'boxdeform_running'
if p in wm:
- del wm[p] \ No newline at end of file
+ del wm[p]
diff --git a/greasepencil_tools/import_brush_pack.py b/greasepencil_tools/import_brush_pack.py
index 90d186c3..b1306bed 100644
--- a/greasepencil_tools/import_brush_pack.py
+++ b/greasepencil_tools/import_brush_pack.py
@@ -30,7 +30,7 @@ def download_url(url, dest):
import time
ssl._create_default_https_context = ssl._create_unverified_context
start_time = time.time()
-
+
try:
with urllib.request.urlopen(url) as response, open(dest, 'wb') as out_file:
shutil.copyfileobj(response, out_file)
@@ -53,7 +53,7 @@ def get_brushes(blend_fp):
## force fake user for the brushes
for b in data_to.brushes:
b.use_fake_user = True
-
+
return len(data_to.brushes)
class GP_OT_install_brush_pack(bpy.types.Operator):
@@ -101,12 +101,12 @@ class GP_OT_install_brush_pack(bpy.types.Operator):
if not temp:
self.report({'ERROR'}, 'no os temporary directory found to download brush pack (using python tempfile.gettempdir())')
return {"CANCELLED"}
-
+
self.temp = Path(temp)
## download link from gitlab
- # brush pack project https://gitlab.com/pepe-school-land/gp-brush-pack
- repo_url = r'https://gitlab.com/api/v4/projects/21994857'
+ # brush pack project https://gitlab.com/pepe-school-land/gp-brush-pack
+ repo_url = r'https://gitlab.com/api/v4/projects/21994857'
tree_url = f'{repo_url}/repository/tree'
## need to create an SSl context or linux fail and raise unverified ssl
@@ -127,7 +127,7 @@ class GP_OT_install_brush_pack(bpy.types.Operator):
self.report({'ERROR'}, f'Check your internet connexion, Impossible to connect to url: {tree_url}')
return {"CANCELLED"}
-
+
if not html:
self.report({'ERROR'}, f'No response read from: {tree_url}')
return {"CANCELLED"}
@@ -154,7 +154,7 @@ class GP_OT_install_brush_pack(bpy.types.Operator):
dl_url = f"{repo_url}/repository/blobs/{id_num}/raw"
self.brushzip = self.temp / zipname
-
+
### Load existing files instead of redownloading if exists and up to date (same hash)
if self.brushzip.exists():
@@ -167,20 +167,20 @@ class GP_OT_install_brush_pack(bpy.types.Operator):
while len(fb) > 0:
file_hash.update(fb)
fb = f.read(BLOCK_SIZE)
-
+
if file_hash.hexdigest() == id_num: # same git SHA1
- ## is up to date, install
+ ## is up to date, install
print(f'{self.brushzip} is up do date, appending brushes')
self._install_from_zip()
return {"FINISHED"}
-
+
## Download, unzip, use blend
print(f'Downloading brushpack in {self.brushzip}')
## https://cloud.blender.org/p/gallery/5f235cc297f8815e74ffb90b
fallback_url='https://gitlab.com/pepe-school-land/gp-brush-pack/-/blob/master/Official_GP_brush_pack_v01.zip'
err = simple_dl_url(dl_url, str(self.brushzip), fallback_url)
- # err = download_url(dl_url, str(self.brushzip), fallback_url)
+ # err = download_url(dl_url, str(self.brushzip), fallback_url)
if err:
self.report({'ERROR'}, 'Could not download brush pack. Check your internet connection. (see console for detail)')
@@ -195,4 +195,4 @@ def register():
bpy.utils.register_class(GP_OT_install_brush_pack)
def unregister():
- bpy.utils.unregister_class(GP_OT_install_brush_pack) \ No newline at end of file
+ bpy.utils.unregister_class(GP_OT_install_brush_pack)
diff --git a/greasepencil_tools/line_reshape.py b/greasepencil_tools/line_reshape.py
index 608b95b2..b994b8d6 100644
--- a/greasepencil_tools/line_reshape.py
+++ b/greasepencil_tools/line_reshape.py
@@ -15,7 +15,7 @@
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
-
+
'''Based on GP_refine_stroke 0.2.4 - Author: Samuel Bernou'''
import bpy
@@ -36,10 +36,10 @@ def vector_len_from_coord(a, b):
Get two points (that has coordinate 'co' attribute) or Vectors (2D or 3D)
Return length as float
'''
- from mathutils import Vector
+ from mathutils import Vector
if type(a) is Vector:
return (a - b).length
- else:
+ else:
return (a.co - b.co).length
def point_from_dist_in_segment_3d(a, b, ratio):
@@ -53,7 +53,7 @@ def get_stroke_length(s):
all_len = 0.0
for i in range(0, len(s.points)-1):
#print(vector_len_from_coord(s.points[i],s.points[i+1]))
- all_len += vector_len_from_coord(s.points[i],s.points[i+1])
+ all_len += vector_len_from_coord(s.points[i],s.points[i+1])
return (all_len)
### --- Functions
@@ -63,7 +63,7 @@ def to_straight_line(s, keep_points=True, influence=100, straight_pressure=True)
keep points : if false only start and end point stay
straight_pressure : (not available with keep point) take the mean pressure of all points and apply to stroke.
'''
-
+
p_len = len(s.points)
if p_len <= 2: # 1 or 2 points only, cancel
return
@@ -83,21 +83,21 @@ def to_straight_line(s, keep_points=True, influence=100, straight_pressure=True)
full_dist = get_stroke_length(s)
dist_from_start = 0.0
coord_list = []
-
+
for i in range(1, p_len-1):#all but first and last
dist_from_start += vector_len_from_coord(s.points[i-1],s.points[i])
ratio = dist_from_start / full_dist
# dont apply directly (change line as we measure it in loop)
coord_list.append( point_from_dist_in_segment_3d(A, B, ratio) )
-
+
# apply change
for i in range(1, p_len-1):
## Direct super straight 100%
#s.points[i].co = coord_list[i-1]
-
+
## With influence
s.points[i].co = point_from_dist_in_segment_3d(s.points[i].co, coord_list[i-1], influence / 100)
-
+
return
def get_last_index(context=None):
@@ -119,9 +119,9 @@ class GP_OT_straightStroke(bpy.types.Operator):
return context.active_object is not None and context.object.type == 'GPENCIL'
#and context.mode in ('PAINT_GPENCIL', 'EDIT_GPENCIL')
- influence_val : bpy.props.FloatProperty(name="Straight force", description="Straight interpolation percentage",
+ influence_val : bpy.props.FloatProperty(name="Straight force", description="Straight interpolation percentage",
default=100, min=0, max=100, step=2, precision=1, subtype='PERCENTAGE', unit='NONE')
-
+
def execute(self, context):
gp = context.object.data
gpl = gp.layers
@@ -130,16 +130,16 @@ class GP_OT_straightStroke(bpy.types.Operator):
if context.mode == 'PAINT_GPENCIL':
if not gpl.active or not gpl.active.active_frame:
- self.report({'ERROR'}, 'No Grease pencil frame found')
+ self.report({'ERROR'}, 'No Grease pencil frame found')
return {"CANCELLED"}
if not len(gpl.active.active_frame.strokes):
- self.report({'ERROR'}, 'No strokes found.')
+ self.report({'ERROR'}, 'No strokes found.')
return {"CANCELLED"}
s = gpl.active.active_frame.strokes[get_last_index(context)]
to_straight_line(s, keep_points=True, influence=self.influence_val)
-
+
elif context.mode == 'EDIT_GPENCIL':
ct = 0
for l in gpl:
@@ -150,15 +150,15 @@ class GP_OT_straightStroke(bpy.types.Operator):
target_frames = [f for f in l.frames if f.select]
else:
target_frames = [l.active_frame]
-
+
for f in target_frames:
for s in f.strokes:
if s.select:
ct += 1
to_straight_line(s, keep_points=True, influence=self.influence_val)
-
+
if not ct:
- self.report({'ERROR'}, 'No selected stroke found.')
+ self.report({'ERROR'}, 'No selected stroke found.')
return {"CANCELLED"}
## filter method
@@ -172,7 +172,7 @@ class GP_OT_straightStroke(bpy.types.Operator):
# to_straight_line(s, keep_points=True, influence = self.influence_val)#, straight_pressure=True
return {"FINISHED"}
-
+
def draw(self, context):
layout = self.layout
layout.prop(self, "influence_val")
diff --git a/greasepencil_tools/prefs.py b/greasepencil_tools/prefs.py
index 69b92780..b8b9894d 100644
--- a/greasepencil_tools/prefs.py
+++ b/greasepencil_tools/prefs.py
@@ -74,13 +74,13 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences):
name='Use click drag directly on points',
description="Change the active tool to 'tweak' during modal, Allow to direct clic-drag points of the box",
default=True)
-
+
default_deform_type : EnumProperty(
items=(('KEY_LINEAR', "Linear (perspective mode)", "Linear interpolation, like corner deform / perspective tools of classic 2D", 'IPO_LINEAR',0),
('KEY_BSPLINE', "Spline (smooth deform)", "Spline interpolation transformation\nBest when lattice is subdivided", 'IPO_CIRC',1),
),
name='Starting Interpolation', default='KEY_LINEAR', description='Choose default interpolation when entering mode')
-
+
# About interpolation : https://docs.blender.org/manual/en/2.83/animation/shape_keys/shape_keys_panel.html#fig-interpolation-type
auto_swap_deform_type : BoolProperty(
@@ -112,7 +112,7 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences):
('MIDDLEMOUSE', 'Mid click', 'Use click on Mid mouse button', 'MOUSE_MMB', 2),
),
update=auto_rebind)
-
+
use_shift: BoolProperty(
name = "combine with shift",
description = "add shift",
@@ -139,8 +139,8 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences):
row.prop(self, "pref_tabs", expand=True)
if self.pref_tabs == 'PREF':
-
- ## TAB CATEGORY
+
+ ## TAB CATEGORY
box = layout.box()
row = box.row(align=True)
row.label(text="Panel Category:")
@@ -153,7 +153,7 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences):
# box.separator()
box.prop(self, "default_deform_type")
box.label(text="Deformer type can be changed during modal with 'M' key, this is for default behavior", icon='INFO')
-
+
box.prop(self, "auto_swap_deform_type")
box.label(text="Once 'M' is hit, auto swap is desactivated to stay in your chosen mode", icon='INFO')
@@ -164,7 +164,7 @@ class GreasePencilAddonPrefs(bpy.types.AddonPreferences):
box.prop(self, "canvas_use_shortcut", text='Bind Shortcuts')
if self.canvas_use_shortcut:
-
+
row = box.row()
row.label(text="(Auto rebind when changing shortcut)")#icon=""
# row.operator("prefs.rebind_shortcut", text='Bind/Rebind shortcuts', icon='FILE_REFRESH')#EVENT_SPACEKEY
@@ -255,4 +255,4 @@ def register():
def unregister():
unregister_keymaps()
bpy.utils.unregister_class(GreasePencilAddonPrefs)
- bpy.utils.unregister_class(GPTS_timeline_settings) \ No newline at end of file
+ bpy.utils.unregister_class(GPTS_timeline_settings)
diff --git a/greasepencil_tools/rotate_canvas.py b/greasepencil_tools/rotate_canvas.py
index 2ba5ed34..aec6e900 100644
--- a/greasepencil_tools/rotate_canvas.py
+++ b/greasepencil_tools/rotate_canvas.py
@@ -83,14 +83,14 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
if self.in_cam:
self.cam.matrix_world = self.cam_matrix
self.cam.rotation_euler.rotate_axis("Z", self.angle)
-
+
else:#free view
context.space_data.region_3d.view_rotation = self._rotation
rot = context.space_data.region_3d.view_rotation
rot = rot.to_euler()
rot.rotate_axis("Z", self.angle)
context.space_data.region_3d.view_rotation = rot.to_quaternion()
-
+
if event.type in {'RIGHTMOUSE', 'LEFTMOUSE', 'MIDDLEMOUSE'} and event.value == 'RELEASE':
if not self.angle:
# self.report({'INFO'}, 'Reset')
@@ -98,7 +98,7 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
context.space_data.region_3d.view_rotation = aim.to_track_quat('Z','Y')#track Z, up Y
self.execute(context)
return {'FINISHED'}
-
+
if event.type == 'ESC':#Cancel
self.execute(context)
if self.in_cam:
@@ -118,10 +118,10 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
if self.in_cam:
# Get camera from scene
self.cam = bpy.context.scene.camera
-
+
#return if one element is locked (else bypass location)
if self.cam.lock_rotation[:] != (False, False, False):
- self.report({'WARNING'}, 'Camera rotation is locked')
+ self.report({'WARNING'}, 'Camera rotation is locked')
return {'CANCELLED'}
self.center = self.get_center_view(context, self.cam)
@@ -135,21 +135,21 @@ class RC_OT_RotateCanvas(bpy.types.Operator):
else:
self.center = mathutils.Vector((context.area.width/2, context.area.height/2))
-
+
# store current rotation
self._rotation = context.space_data.region_3d.view_rotation.copy()
# Get current mouse coordination
self.pos_current = mathutils.Vector((event.mouse_region_x, event.mouse_region_y))
-
+
self.initial_pos = self.pos_current# for draw debug, else no need
# Calculate inital vector
self.vector_initial = self.pos_current - self.center
self.vector_initial.normalize()
-
+
# Initializes the current vector with the same initial vector.
self.vector_current = self.vector_initial.copy()
-
+
args = (self, context)
if self.hud:
self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_PIXEL')
@@ -167,4 +167,4 @@ def unregister():
bpy.utils.unregister_class(RC_OT_RotateCanvas)
# if __name__ == "__main__":
-# register() \ No newline at end of file
+# register()
diff --git a/greasepencil_tools/timeline_scrub.py b/greasepencil_tools/timeline_scrub.py
index bd7edebe..1f89f4d1 100644
--- a/greasepencil_tools/timeline_scrub.py
+++ b/greasepencil_tools/timeline_scrub.py
@@ -227,7 +227,7 @@ class GPTS_OT_time_scrub(bpy.types.Operator):
self.my = my = event.mouse_region_y
self.hud_lines = []
-
+
# frame marks
for x in hud_pos_x:
self.hud_lines.append((x, my - (frame_height/2)))
diff --git a/greasepencil_tools/ui_panels.py b/greasepencil_tools/ui_panels.py
index 715c4db5..292d0e5a 100644
--- a/greasepencil_tools/ui_panels.py
+++ b/greasepencil_tools/ui_panels.py
@@ -27,7 +27,7 @@ class GP_PT_sidebarPanel(bpy.types.Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
-
+
# Box deform ops
self.layout.operator_context = 'INVOKE_DEFAULT'
layout.operator('gp.latticedeform', icon ="MOD_MESHDEFORM")# MOD_LATTICE, LATTICE_DATA