Cleanup: imports, indentation, long lines
This commit is contained in:
@@ -21,7 +21,10 @@ import bpy
|
|||||||
import os
|
import os
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
from bpy.props import FloatProperty
|
from bpy.props import FloatProperty
|
||||||
from mathutils import Vector, Matrix
|
from mathutils import (
|
||||||
|
Vector,
|
||||||
|
Matrix,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def CLIP_spaces_walk(context, all_screens, tarea, tspace, callback, *args):
|
def CLIP_spaces_walk(context, all_screens, tarea, tspace, callback, *args):
|
||||||
|
@@ -16,13 +16,15 @@
|
|||||||
#
|
#
|
||||||
# ##### END GPL LICENSE BLOCK #####
|
# ##### END GPL LICENSE BLOCK #####
|
||||||
|
|
||||||
|
# <pep8 compliant>
|
||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from bpy.props import (
|
from bpy.props import (
|
||||||
BoolProperty,
|
BoolProperty,
|
||||||
EnumProperty,
|
EnumProperty,
|
||||||
StringProperty,
|
StringProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
|
class SCENE_OT_freestyle_fill_range_by_selection(bpy.types.Operator):
|
||||||
|
@@ -21,7 +21,10 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
|
|
||||||
from bpy.props import EnumProperty, IntProperty
|
from bpy.props import (
|
||||||
|
EnumProperty,
|
||||||
|
IntProperty,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class MeshMirrorUV(Operator):
|
class MeshMirrorUV(Operator):
|
||||||
|
@@ -23,14 +23,14 @@ import nodeitems_utils
|
|||||||
from bpy.types import (
|
from bpy.types import (
|
||||||
Operator,
|
Operator,
|
||||||
PropertyGroup,
|
PropertyGroup,
|
||||||
)
|
)
|
||||||
from bpy.props import (
|
from bpy.props import (
|
||||||
BoolProperty,
|
BoolProperty,
|
||||||
CollectionProperty,
|
CollectionProperty,
|
||||||
EnumProperty,
|
EnumProperty,
|
||||||
IntProperty,
|
IntProperty,
|
||||||
StringProperty,
|
StringProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class NodeSetting(PropertyGroup):
|
class NodeSetting(PropertyGroup):
|
||||||
|
@@ -21,12 +21,12 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
from bpy.props import (
|
from bpy.props import (
|
||||||
StringProperty,
|
|
||||||
BoolProperty,
|
BoolProperty,
|
||||||
EnumProperty,
|
EnumProperty,
|
||||||
IntProperty,
|
|
||||||
FloatProperty,
|
FloatProperty,
|
||||||
)
|
IntProperty,
|
||||||
|
StringProperty,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class SelectPattern(Operator):
|
class SelectPattern(Operator):
|
||||||
|
@@ -26,7 +26,8 @@ from mathutils import Vector
|
|||||||
def GlobalBB_LQ(bb_world):
|
def GlobalBB_LQ(bb_world):
|
||||||
|
|
||||||
# Initialize the variables with the 8th vertex
|
# Initialize the variables with the 8th vertex
|
||||||
left, right, front, back, down, up = (bb_world[7][0],
|
left, right, front, back, down, up = (
|
||||||
|
bb_world[7][0],
|
||||||
bb_world[7][0],
|
bb_world[7][0],
|
||||||
bb_world[7][1],
|
bb_world[7][1],
|
||||||
bb_world[7][1],
|
bb_world[7][1],
|
||||||
@@ -398,13 +399,15 @@ class AlignObjects(Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
align_axis = self.align_axis
|
align_axis = self.align_axis
|
||||||
ret = align_objects(context,
|
ret = align_objects(
|
||||||
|
context,
|
||||||
'X' in align_axis,
|
'X' in align_axis,
|
||||||
'Y' in align_axis,
|
'Y' in align_axis,
|
||||||
'Z' in align_axis,
|
'Z' in align_axis,
|
||||||
self.align_mode,
|
self.align_mode,
|
||||||
self.relative_to,
|
self.relative_to,
|
||||||
self.bb_quality)
|
self.bb_quality,
|
||||||
|
)
|
||||||
|
|
||||||
if not ret:
|
if not ret:
|
||||||
self.report({'WARNING'}, "No objects with bound-box selected")
|
self.report({'WARNING'}, "No objects with bound-box selected")
|
||||||
|
@@ -27,7 +27,7 @@ from bpy.props import (
|
|||||||
IntProperty,
|
IntProperty,
|
||||||
FloatProperty,
|
FloatProperty,
|
||||||
FloatVectorProperty,
|
FloatVectorProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def object_ensure_material(obj, mat_name):
|
def object_ensure_material(obj, mat_name):
|
||||||
|
@@ -20,8 +20,10 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
from bpy.props import IntProperty
|
from bpy.props import (
|
||||||
from bpy.props import EnumProperty
|
EnumProperty,
|
||||||
|
IntProperty,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class CopyRigidbodySettings(Operator):
|
class CopyRigidbodySettings(Operator):
|
||||||
|
@@ -18,7 +18,11 @@
|
|||||||
|
|
||||||
# TODO <pep8 compliant>
|
# TODO <pep8 compliant>
|
||||||
|
|
||||||
from mathutils import Matrix, Vector, geometry
|
from mathutils import (
|
||||||
|
Matrix,
|
||||||
|
Vector,
|
||||||
|
geometry,
|
||||||
|
)
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@ from bpy.props import (
|
|||||||
IntProperty,
|
IntProperty,
|
||||||
FloatProperty,
|
FloatProperty,
|
||||||
EnumProperty,
|
EnumProperty,
|
||||||
)
|
)
|
||||||
|
|
||||||
from bpy.app.translations import pgettext_tip as tip_
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
@@ -921,7 +921,10 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
|
|||||||
# an operator (common case - just button referencing an op)
|
# an operator (common case - just button referencing an op)
|
||||||
if hasattr(bpy.types, class_name.upper() + "_OT_" + class_prop):
|
if hasattr(bpy.types, class_name.upper() + "_OT_" + class_prop):
|
||||||
if do_url:
|
if do_url:
|
||||||
url = ("%s/bpy.ops.%s.html#bpy.ops.%s.%s" % (url_prefix, class_name, class_name, class_prop))
|
url = (
|
||||||
|
"%s/bpy.ops.%s.html#bpy.ops.%s.%s" %
|
||||||
|
(url_prefix, class_name, class_name, class_prop)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
|
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
|
||||||
else:
|
else:
|
||||||
@@ -936,7 +939,10 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
|
|||||||
class_name, class_prop = class_name.split("_OT_", 1)
|
class_name, class_prop = class_name.split("_OT_", 1)
|
||||||
class_name = class_name.lower()
|
class_name = class_name.lower()
|
||||||
if do_url:
|
if do_url:
|
||||||
url = ("%s/bpy.ops.%s.html#bpy.ops.%s.%s" % (url_prefix, class_name, class_name, class_prop))
|
url = (
|
||||||
|
"%s/bpy.ops.%s.html#bpy.ops.%s.%s" %
|
||||||
|
(url_prefix, class_name, class_name, class_prop)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
|
rna = "bpy.ops.%s.%s" % (class_name, class_prop)
|
||||||
else:
|
else:
|
||||||
@@ -952,9 +958,12 @@ def _wm_doc_get_id(doc_id, do_url=True, url_prefix=""):
|
|||||||
rna_parent = rna_parent.base
|
rna_parent = rna_parent.base
|
||||||
|
|
||||||
if do_url:
|
if do_url:
|
||||||
url = ("%s/bpy.types.%s.html#bpy.types.%s.%s" % (url_prefix, class_name, class_name, class_prop))
|
url = (
|
||||||
|
"%s/bpy.types.%s.html#bpy.types.%s.%s" %
|
||||||
|
(url_prefix, class_name, class_name, class_prop)
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
rna = ("bpy.types.%s.%s" % (class_name, class_prop))
|
rna = "bpy.types.%s.%s" % (class_name, class_prop)
|
||||||
else:
|
else:
|
||||||
# We assume this is custom property, only try to generate generic url/rna_id...
|
# We assume this is custom property, only try to generate generic url/rna_id...
|
||||||
if do_url:
|
if do_url:
|
||||||
@@ -1298,8 +1307,8 @@ class WM_OT_properties_add(Operator):
|
|||||||
|
|
||||||
return prop_new
|
return prop_new
|
||||||
|
|
||||||
prop = unique_name(
|
prop = unique_name({
|
||||||
{*item.keys(),
|
*item.keys(),
|
||||||
*type(item).bl_rna.properties.keys(),
|
*type(item).bl_rna.properties.keys(),
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -1381,7 +1390,10 @@ class WM_OT_appconfig_default(Operator):
|
|||||||
filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py")
|
filepath = os.path.join(bpy.utils.preset_paths("interaction")[0], "blender.py")
|
||||||
|
|
||||||
if os.path.exists(filepath):
|
if os.path.exists(filepath):
|
||||||
bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets")
|
bpy.ops.script.execute_preset(
|
||||||
|
filepath=filepath,
|
||||||
|
menu_idname="USERPREF_MT_interaction_presets",
|
||||||
|
)
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
@@ -1401,7 +1413,10 @@ class WM_OT_appconfig_activate(Operator):
|
|||||||
filepath = self.filepath.replace("keyconfig", "interaction")
|
filepath = self.filepath.replace("keyconfig", "interaction")
|
||||||
|
|
||||||
if os.path.exists(filepath):
|
if os.path.exists(filepath):
|
||||||
bpy.ops.script.execute_preset(filepath=filepath, menu_idname="USERPREF_MT_interaction_presets")
|
bpy.ops.script.execute_preset(
|
||||||
|
filepath=filepath,
|
||||||
|
menu_idname="USERPREF_MT_interaction_presets",
|
||||||
|
)
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
@@ -1636,7 +1651,8 @@ class WM_OT_keyconfig_export(Operator):
|
|||||||
|
|
||||||
wm = context.window_manager
|
wm = context.window_manager
|
||||||
|
|
||||||
keyconfig_utils.keyconfig_export(wm,
|
keyconfig_utils.keyconfig_export(
|
||||||
|
wm,
|
||||||
wm.keyconfigs.active,
|
wm.keyconfigs.active,
|
||||||
self.filepath,
|
self.filepath,
|
||||||
)
|
)
|
||||||
@@ -1904,7 +1920,10 @@ class WM_OT_theme_install(Operator):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
shutil.copyfile(xmlfile, path_dest)
|
shutil.copyfile(xmlfile, path_dest)
|
||||||
bpy.ops.script.execute_preset(filepath=path_dest, menu_idname="USERPREF_MT_interface_theme_presets")
|
bpy.ops.script.execute_preset(
|
||||||
|
filepath=path_dest,
|
||||||
|
menu_idname="USERPREF_MT_interface_theme_presets",
|
||||||
|
)
|
||||||
|
|
||||||
except:
|
except:
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
@@ -2232,7 +2251,6 @@ class WM_OT_app_template_install(Operator):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
import addon_utils
|
|
||||||
import traceback
|
import traceback
|
||||||
import zipfile
|
import zipfile
|
||||||
import shutil
|
import shutil
|
||||||
|
@@ -19,7 +19,11 @@
|
|||||||
# <pep8 compliant>
|
# <pep8 compliant>
|
||||||
import bpy
|
import bpy
|
||||||
import nodeitems_utils
|
import nodeitems_utils
|
||||||
from nodeitems_utils import NodeCategory, NodeItem, NodeItemCustom
|
from nodeitems_utils import (
|
||||||
|
NodeCategory,
|
||||||
|
NodeItem,
|
||||||
|
NodeItemCustom,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Subclasses for standard node types
|
# Subclasses for standard node types
|
||||||
|
Reference in New Issue
Block a user