Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-10-02 03:15:51 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-10-02 04:59:16 +0300
commit41d2d6da0c96d351b47acb64d3e0decdba16cb16 (patch)
tree8f955ed71d907ab9f7ee97627a9a7c91192d139a /release/scripts/modules
parentbab9de2a52929fe2b45ecddb1eb09da3378e303b (diff)
Cleanup: pep8 (indentation, spacing, long lines)
Diffstat (limited to 'release/scripts/modules')
-rw-r--r--release/scripts/modules/animsys_refactor.py5
-rw-r--r--release/scripts/modules/bl_i18n_utils/bl_extract_messages.py2
-rw-r--r--release/scripts/modules/bl_i18n_utils/utils.py2
-rwxr-xr-xrelease/scripts/modules/bl_i18n_utils/utils_rtl.py22
-rw-r--r--release/scripts/modules/bl_previews_utils/bl_previews_render.py14
-rw-r--r--release/scripts/modules/bpy_types.py12
-rw-r--r--release/scripts/modules/gpu_extras/presets.py7
-rw-r--r--release/scripts/modules/graphviz_export.py28
8 files changed, 62 insertions, 30 deletions
diff --git a/release/scripts/modules/animsys_refactor.py b/release/scripts/modules/animsys_refactor.py
index 7255ce5cd22..97e8a8dd144 100644
--- a/release/scripts/modules/animsys_refactor.py
+++ b/release/scripts/modules/animsys_refactor.py
@@ -80,7 +80,10 @@ class DataPathBuilder:
base_new = Ellipsis
# find the new name
if item.startswith("."):
- for class_name, item_new, options in rna_update_from_map.get(item[1:], []) + [(None, item[1:], None)]:
+ for class_name, item_new, options in (
+ rna_update_from_map.get(item[1:], []) +
+ [(None, item[1:], None)]
+ ):
if callable(item_new):
# No type check here, callback is assumed to know what it's doing.
base_new, item_new = item_new(base, class_name, item[1:], fcurve, options)
diff --git a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
index b4abf572dbc..063e3cafb73 100644
--- a/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
+++ b/release/scripts/modules/bl_i18n_utils/bl_extract_messages.py
@@ -177,7 +177,7 @@ def print_info(reports, pot):
_print("\t“{}”|“{}”:".format(*key))
# We support multi-lines tooltips now...
# ~ if multi_lines and key in multi_lines:
- # ~ _print("\t\t-> newline in this message!")
+ # ~ _print("\t\t-> newline in this message!")
if not_capitalized and key in not_capitalized:
_print("\t\t-> message not capitalized!")
if end_point and key in end_point:
diff --git a/release/scripts/modules/bl_i18n_utils/utils.py b/release/scripts/modules/bl_i18n_utils/utils.py
index 61837cc0956..4cb25816a34 100644
--- a/release/scripts/modules/bl_i18n_utils/utils.py
+++ b/release/scripts/modules/bl_i18n_utils/utils.py
@@ -185,7 +185,7 @@ def enable_addons(addons=None, support=None, disable=False, check_only=False):
ret = [
mod for mod in addon_utils.modules()
if (((addons and mod.__name__ in addons) or
- (not addons and addon_utils.module_bl_info(mod)["support"] in support)) and
+ (not addons and addon_utils.module_bl_info(mod)["support"] in support)) and
(mod.__name__ not in black_list))
]
diff --git a/release/scripts/modules/bl_i18n_utils/utils_rtl.py b/release/scripts/modules/bl_i18n_utils/utils_rtl.py
index 1a71bb735bc..2b6a56c5deb 100755
--- a/release/scripts/modules/bl_i18n_utils/utils_rtl.py
+++ b/release/scripts/modules/bl_i18n_utils/utils_rtl.py
@@ -37,27 +37,27 @@ import ctypes
import re
-#define FRIBIDI_MASK_NEUTRAL 0x00000040L /* Is neutral */
+# define FRIBIDI_MASK_NEUTRAL 0x00000040L /* Is neutral */
FRIBIDI_PAR_ON = 0x00000040
-#define FRIBIDI_FLAG_SHAPE_MIRRORING 0x00000001
-#define FRIBIDI_FLAG_REORDER_NSM 0x00000002
+# define FRIBIDI_FLAG_SHAPE_MIRRORING 0x00000001
+# define FRIBIDI_FLAG_REORDER_NSM 0x00000002
-#define FRIBIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
-#define FRIBIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
-#define FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
+# define FRIBIDI_FLAG_SHAPE_ARAB_PRES 0x00000100
+# define FRIBIDI_FLAG_SHAPE_ARAB_LIGA 0x00000200
+# define FRIBIDI_FLAG_SHAPE_ARAB_CONSOLE 0x00000400
-#define FRIBIDI_FLAG_REMOVE_BIDI 0x00010000
-#define FRIBIDI_FLAG_REMOVE_JOINING 0x00020000
-#define FRIBIDI_FLAG_REMOVE_SPECIALS 0x00040000
+# define FRIBIDI_FLAG_REMOVE_BIDI 0x00010000
+# define FRIBIDI_FLAG_REMOVE_JOINING 0x00020000
+# define FRIBIDI_FLAG_REMOVE_SPECIALS 0x00040000
-#define FRIBIDI_FLAGS_DEFAULT ( \
+# define FRIBIDI_FLAGS_DEFAULT ( \
# FRIBIDI_FLAG_SHAPE_MIRRORING | \
# FRIBIDI_FLAG_REORDER_NSM | \
# FRIBIDI_FLAG_REMOVE_SPECIALS )
-#define FRIBIDI_FLAGS_ARABIC ( \
+# define FRIBIDI_FLAGS_ARABIC ( \
# FRIBIDI_FLAG_SHAPE_ARAB_PRES | \
# FRIBIDI_FLAG_SHAPE_ARAB_LIGA )
diff --git a/release/scripts/modules/bl_previews_utils/bl_previews_render.py b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
index bcb2fe8324d..c9603e46ecf 100644
--- a/release/scripts/modules/bl_previews_utils/bl_previews_render.py
+++ b/release/scripts/modules/bl_previews_utils/bl_previews_render.py
@@ -211,7 +211,8 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
bpy.data.lights.remove(bpy.data.lights[render_context.light_data, None])
else:
rna_backup_restore(light, render_context.backup_light)
- rna_backup_restore(bpy.data.lights[render_context.light_data, None], render_context.backup_light_data)
+ rna_backup_restore(bpy.data.lights[render_context.light_data,
+ None], render_context.backup_light_data)
except Exception as e:
print("ERROR:", e)
success = False
@@ -229,7 +230,8 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
def object_bbox_merge(bbox, ob, ob_space, offset_matrix):
# Take collections instances into account (including linked one in this case).
if ob.type == 'EMPTY' and ob.instance_type == 'COLLECTION':
- grp_objects = tuple((ob.name, ob.library.filepath if ob.library else None) for ob in ob.instance_collection.all_objects)
+ grp_objects = tuple((ob.name, ob.library.filepath if ob.library else None)
+ for ob in ob.instance_collection.all_objects)
if (len(grp_objects) == 0):
ob_bbox = ob.bound_box
else:
@@ -390,7 +392,10 @@ def do_previews(do_objects, do_collections, do_scenes, do_data_intern):
bpy.context.window.scene = scene
bpy.ops.object.collection_instance_add(collection=grp.name)
- grp_ob = next((ob for ob in scene.objects if ob.instance_collection and ob.instance_collection.name == grp.name))
+ grp_ob = next((
+ ob for ob in scene.objects
+ if ob.instance_collection and ob.instance_collection.name == grp.name
+ ))
grp_obname = grp_ob.name
bpy.context.view_layer.update()
@@ -470,7 +475,8 @@ def main():
# Get rid of Blender args!
argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
- parser = argparse.ArgumentParser(description="Use Blender to generate previews for currently open Blender file's items.")
+ parser = argparse.ArgumentParser(
+ description="Use Blender to generate previews for currently open Blender file's items.")
parser.add_argument('--clear', default=False, action="store_true",
help="Clear previews instead of generating them.")
parser.add_argument('--no_backups', default=False, action="store_true",
diff --git a/release/scripts/modules/bpy_types.py b/release/scripts/modules/bpy_types.py
index 7c26744ce8c..d863778a9c2 100644
--- a/release/scripts/modules/bpy_types.py
+++ b/release/scripts/modules/bpy_types.py
@@ -912,12 +912,12 @@ class Menu(StructRNA, _GenericUI, metaclass=RNAMeta):
for directory in searchpaths:
files.extend([
(f, os.path.join(directory, f))
- for f in os.listdir(directory)
- if (not f.startswith("."))
- if ((filter_ext is None) or
- (filter_ext(os.path.splitext(f)[1])))
- if ((filter_path is None) or
- (filter_path(f)))
+ for f in os.listdir(directory)
+ if (not f.startswith("."))
+ if ((filter_ext is None) or
+ (filter_ext(os.path.splitext(f)[1])))
+ if ((filter_path is None) or
+ (filter_path(f)))
])
files.sort()
diff --git a/release/scripts/modules/gpu_extras/presets.py b/release/scripts/modules/gpu_extras/presets.py
index 015608b3586..81d515904a1 100644
--- a/release/scripts/modules/gpu_extras/presets.py
+++ b/release/scripts/modules/gpu_extras/presets.py
@@ -78,9 +78,10 @@ def draw_texture_2d(texture_id, position, width, height):
coords = ((0, 0), (1, 0), (1, 1), (0, 1))
shader = gpu.shader.from_builtin('2D_IMAGE')
- batch = batch_for_shader(shader, 'TRI_FAN',
- {"pos" : coords,
- "texCoord" : coords})
+ batch = batch_for_shader(
+ shader, 'TRI_FAN',
+ {"pos": coords, "texCoord": coords},
+ )
bgl.glActiveTexture(bgl.GL_TEXTURE0)
bgl.glBindTexture(bgl.GL_TEXTURE_2D, texture_id)
diff --git a/release/scripts/modules/graphviz_export.py b/release/scripts/modules/graphviz_export.py
index fbe23a05940..8df0006811e 100644
--- a/release/scripts/modules/graphviz_export.py
+++ b/release/scripts/modules/graphviz_export.py
@@ -80,7 +80,13 @@ def graph_armature(obj, filepath, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=Tr
label.append("%s = %s" % (key, value))
- opts = ["shape=box", "regular=1", "style=filled", "fixedsize=false", 'label="%s"' % compat_str('\n'.join(label))]
+ opts = [
+ "shape=box",
+ "regular=1",
+ "style=filled",
+ "fixedsize=false",
+ 'label="%s"' % compat_str('\n'.join(label)),
+ ]
if bone.name.startswith('ORG'):
opts.append("fillcolor=yellow")
@@ -125,7 +131,15 @@ def graph_armature(obj, filepath, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=Tr
subtarget = getattr(constraint, "subtarget", "")
if subtarget:
# TODO, not internal links
- opts = ['dir=forward', "weight=1", "arrowhead=normal", "arrowtail=none", "constraint=false", 'color="red"', 'labelfontsize=4']
+ opts = [
+ 'dir=forward',
+ "weight=1",
+ "arrowhead=normal",
+ "arrowtail=none",
+ "constraint=false",
+ 'color="red"',
+ 'labelfontsize=4',
+ ]
if XTRA_INFO:
label = "%s\n%s" % (constraint.type, constraint.name)
opts.append('label="%s"' % compat_str(label))
@@ -160,7 +174,15 @@ def graph_armature(obj, filepath, FAKE_PARENT=True, CONSTRAINTS=True, DRIVERS=Tr
pbone_target = rna_path_as_pbone(target.data_path)
rna_path_target = target.data_path
if pbone_target:
- opts = ['dir=forward', "weight=1", "arrowhead=normal", "arrowtail=none", "constraint=false", 'color="blue"', "labelfontsize=4"]
+ opts = [
+ 'dir=forward',
+ "weight=1",
+ "arrowhead=normal",
+ "arrowtail=none",
+ "constraint=false",
+ 'color="blue"',
+ "labelfontsize=4",
+ ]
display_source = rna_path.replace("pose.bones", "")
display_target = rna_path_target.replace("pose.bones", "")
if XTRA_INFO: