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:
-rw-r--r--build_files/buildbot/buildbot_utils.py11
-rw-r--r--build_files/buildbot/codesign/archive_with_indicator.py2
-rw-r--r--build_files/buildbot/worker_pack.py8
-rw-r--r--build_files/buildbot/worker_test.py2
-rwxr-xr-xbuild_files/cmake/cmake_netbeans_project.py2
-rw-r--r--build_files/cmake/cmake_static_check_clang_array.py4
-rwxr-xr-xbuild_files/utils/make_update.py69
-rwxr-xr-xbuild_files/utils/make_utils.py2
-rw-r--r--doc/python_api/sphinx_doc_gen.py2
-rw-r--r--intern/cycles/blender/addon/engine.py3
-rw-r--r--intern/cycles/blender/addon/operators.py8
-rw-r--r--intern/cycles/blender/addon/properties.py32
-rw-r--r--intern/cycles/blender/addon/ui.py45
-rw-r--r--intern/cycles/blender/addon/version_update.py8
-rw-r--r--release/scripts/freestyle/modules/freestyle/chainingiterators.py116
-rw-r--r--release/scripts/freestyle/modules/freestyle/predicates.py22
-rw-r--r--release/scripts/freestyle/modules/freestyle/types.py2
-rw-r--r--release/scripts/freestyle/modules/freestyle/utils.py9
-rw-r--r--release/scripts/freestyle/modules/parameter_editor.py18
-rw-r--r--release/scripts/freestyle/styles/anisotropic_diffusion.py6
-rw-r--r--release/scripts/freestyle/styles/apriori_and_causal_density.py6
-rw-r--r--release/scripts/freestyle/styles/apriori_density.py8
-rw-r--r--release/scripts/freestyle/styles/blueprint_circles.py8
-rw-r--r--release/scripts/freestyle/styles/blueprint_ellipses.py6
-rw-r--r--release/scripts/freestyle/styles/blueprint_squares.py6
-rw-r--r--release/scripts/freestyle/styles/cartoon.py6
-rw-r--r--release/scripts/freestyle/styles/contour.py8
-rw-r--r--release/scripts/freestyle/styles/curvature2d.py6
-rw-r--r--release/scripts/freestyle/styles/external_contour.py6
-rw-r--r--release/scripts/freestyle/styles/external_contour_sketchy.py6
-rw-r--r--release/scripts/freestyle/styles/external_contour_smooth.py10
-rw-r--r--release/scripts/freestyle/styles/haloing.py10
-rw-r--r--release/scripts/freestyle/styles/ignore_small_occlusions.py8
-rw-r--r--release/scripts/freestyle/styles/invisible_lines.py6
-rw-r--r--release/scripts/freestyle/styles/japanese_bigbrush.py20
-rw-r--r--release/scripts/freestyle/styles/long_anisotropically_dense.py25
-rw-r--r--release/scripts/freestyle/styles/multiple_parameterization.py12
-rw-r--r--release/scripts/freestyle/styles/nature.py6
-rw-r--r--release/scripts/freestyle/styles/near_lines.py6
-rw-r--r--release/scripts/freestyle/styles/occluded_by_specific_object.py12
-rw-r--r--release/scripts/freestyle/styles/polygonalize.py6
-rw-r--r--release/scripts/freestyle/styles/qi0.py6
-rw-r--r--release/scripts/freestyle/styles/qi0_not_external_contour.py6
-rw-r--r--release/scripts/freestyle/styles/qi1.py6
-rw-r--r--release/scripts/freestyle/styles/qi2.py6
-rw-r--r--release/scripts/freestyle/styles/sequentialsplit_sketchy.py8
-rw-r--r--release/scripts/freestyle/styles/sketchy_multiple_parameterization.py6
-rw-r--r--release/scripts/freestyle/styles/sketchy_topology_broken.py10
-rw-r--r--release/scripts/freestyle/styles/sketchy_topology_preserved.py6
-rw-r--r--release/scripts/freestyle/styles/split_at_tvertices.py10
-rw-r--r--release/scripts/freestyle/styles/suggestive.py6
-rw-r--r--release/scripts/freestyle/styles/thickness_fof_depth_discontinuity.py6
-rw-r--r--release/scripts/freestyle/styles/tipremover.py6
-rw-r--r--release/scripts/freestyle/styles/tvertex_remover.py6
-rw-r--r--release/scripts/freestyle/styles/uniformpruning_zsort.py6
-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
-rw-r--r--release/scripts/startup/bl_operators/gpencil_mesh_bake.py2
-rw-r--r--release/scripts/startup/bl_operators/object_quick_effects.py9
-rw-r--r--release/scripts/startup/bl_operators/presets.py4
-rw-r--r--release/scripts/startup/bl_operators/uvcalc_lightmap.py2
-rw-r--r--release/scripts/startup/bl_operators/vertexpaint_dirt.py2
-rw-r--r--release/scripts/startup/bl_operators/view3d.py8
-rw-r--r--release/scripts/startup/bl_ui/properties_data_hair.py13
-rw-r--r--release/scripts/startup/bl_ui/properties_data_mesh.py10
-rw-r--r--release/scripts/startup/bl_ui/properties_data_pointcloud.py13
-rw-r--r--release/scripts/startup/bl_ui/properties_data_volume.py8
-rw-r--r--release/scripts/startup/bl_ui/properties_freestyle.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_grease_pencil_common.py8
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py28
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py5
-rw-r--r--release/scripts/startup/bl_ui/space_filebrowser.py4
-rw-r--r--release/scripts/startup/bl_ui/space_image.py2
-rw-r--r--release/scripts/startup/bl_ui/space_text.py2
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_toolbar.py17
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py48
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py14
-rw-r--r--release/windows/msix/create_msix_package.py75
-rwxr-xr-xsource/blender/datatoc/datatoc_icon.py5
-rwxr-xr-xsource/blender/datatoc/datatoc_icon_split_to_png.py5
-rwxr-xr-xsource/blender/makesrna/rna_cleanup/rna_cleaner.py3
-rwxr-xr-xsource/blender/makesrna/rna_cleanup/rna_cleaner_merge.py5
-rw-r--r--tests/python/alembic_export_tests.py5
-rw-r--r--tests/python/batch_import.py14
-rw-r--r--tests/python/bl_alembic_io_test.py8
-rw-r--r--tests/python/bl_animation_fcurves.py60
-rw-r--r--tests/python/bl_blendfile_io.py2
-rw-r--r--tests/python/bl_blendfile_liblink.py2
-rw-r--r--tests/python/bl_blendfile_utils.py2
-rw-r--r--tests/python/bl_constraints.py4
-rw-r--r--tests/python/bl_run_operators.py6
-rw-r--r--tests/python/eevee_render_tests.py4
-rwxr-xr-xtests/python/modules/global_report.py4
-rw-r--r--tests/python/modules/mesh_test.py18
-rwxr-xr-xtests/python/modules/render_report.py2
-rw-r--r--tests/python/operators.py2
-rw-r--r--tests/python/rna_array.py11
-rw-r--r--tests/python/rna_info_dump.py10
104 files changed, 691 insertions, 501 deletions
diff --git a/build_files/buildbot/buildbot_utils.py b/build_files/buildbot/buildbot_utils.py
index 919b197b380..2fce979466e 100644
--- a/build_files/buildbot/buildbot_utils.py
+++ b/build_files/buildbot/buildbot_utils.py
@@ -50,22 +50,23 @@ class Builder:
# Detect platform
if name.startswith('mac'):
self.platform = 'mac'
- self.command_prefix = []
+ self.command_prefix = []
elif name.startswith('linux'):
self.platform = 'linux'
if is_tool('scl'):
- self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
+ self.command_prefix = ['scl', 'enable', 'devtoolset-9', '--']
else:
- self.command_prefix = []
+ self.command_prefix = []
elif name.startswith('win'):
self.platform = 'win'
- self.command_prefix = []
+ self.command_prefix = []
else:
raise ValueError('Unkonw platform for builder ' + self.platform)
# Always 64 bit now
self.bits = 64
+
def create_builder_from_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('builder_name')
@@ -106,7 +107,7 @@ class VersionInfo:
def _parse_header_file(self, filename, define):
import re
- regex = re.compile("^#\s*define\s+%s\s+(.*)" % define)
+ regex = re.compile(r"^#\s*define\s+%s\s+(.*)" % define)
with open(filename, "r") as file:
for l in file:
match = regex.match(l)
diff --git a/build_files/buildbot/codesign/archive_with_indicator.py b/build_files/buildbot/codesign/archive_with_indicator.py
index 085026fcf98..e5c4be885bc 100644
--- a/build_files/buildbot/codesign/archive_with_indicator.py
+++ b/build_files/buildbot/codesign/archive_with_indicator.py
@@ -102,7 +102,7 @@ class ArchiveWithIndicator:
# Wait for until archive is fully stored.
actual_archive_size = self.archive_filepath.stat().st_size
- if actual_archive_size != expected_archive_size:
+ if actual_archive_size != expected_archive_size:
print('Partial/invalid archive size (expected '
f'{expected_archive_size} got {actual_archive_size})')
return False
diff --git a/build_files/buildbot/worker_pack.py b/build_files/buildbot/worker_pack.py
index 82b406cd42d..a5727a66e09 100644
--- a/build_files/buildbot/worker_pack.py
+++ b/build_files/buildbot/worker_pack.py
@@ -35,7 +35,7 @@ def get_package_name(builder, platform=None):
package_name = 'blender-' + info.full_version
if platform:
- package_name += '-' + platform
+ package_name += '-' + platform
if not (builder.branch == 'master' or builder.is_release_branch):
if info.is_development_build:
package_name = builder.branch + "-" + package_name
@@ -175,7 +175,11 @@ def pack_linux(builder):
print("Stripping python...")
py_target = os.path.join(builder.install_dir, info.short_version)
- buildbot_utils.call(builder.command_prefix + ['find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';'])
+ buildbot_utils.call(
+ builder.command_prefix + [
+ 'find', py_target, '-iname', '*.so', '-exec', 'strip', '-s', '{}', ';',
+ ],
+ )
# Construct package name
platform_name = 'linux64'
diff --git a/build_files/buildbot/worker_test.py b/build_files/buildbot/worker_test.py
index db02801007e..8a6e7d4bb69 100644
--- a/build_files/buildbot/worker_test.py
+++ b/build_files/buildbot/worker_test.py
@@ -33,7 +33,7 @@ def get_ctest_arguments(builder):
def test(builder):
os.chdir(builder.build_dir)
- command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
+ command = builder.command_prefix + ['ctest'] + get_ctest_arguments(builder)
buildbot_utils.call(command)
diff --git a/build_files/cmake/cmake_netbeans_project.py b/build_files/cmake/cmake_netbeans_project.py
index 35985e532b8..cfc3ff6b6fa 100755
--- a/build_files/cmake/cmake_netbeans_project.py
+++ b/build_files/cmake/cmake_netbeans_project.py
@@ -182,7 +182,7 @@ def create_nb_project_main():
f.write(' </logicalFolder>\n')
# default, but this dir is infact not in blender dir so we can ignore it
# f.write(' <sourceFolderFilter>^(nbproject)$</sourceFolderFilter>\n')
- f.write(' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
+ f.write(r' <sourceFolderFilter>^(nbproject|__pycache__|.*\.py|.*\.html|.*\.blend)$</sourceFolderFilter>\n')
f.write(' <sourceRootList>\n')
f.write(' <Elem>%s</Elem>\n' % SOURCE_DIR) # base_root_rel
diff --git a/build_files/cmake/cmake_static_check_clang_array.py b/build_files/cmake/cmake_static_check_clang_array.py
index 4a7a22619cc..61eee360d6e 100644
--- a/build_files/cmake/cmake_static_check_clang_array.py
+++ b/build_files/cmake/cmake_static_check_clang_array.py
@@ -49,8 +49,8 @@ def main():
check_commands = []
for c, inc_dirs, defs in source_info:
- #~if "source/blender" not in c:
- #~ continue
+ # ~if "source/blender" not in c:
+ # ~ continue
cmd = ([CHECKER_BIN] +
CHECKER_ARGS +
diff --git a/build_files/utils/make_update.py b/build_files/utils/make_update.py
index ae7269b07cd..53f6b3d447f 100755
--- a/build_files/utils/make_update.py
+++ b/build_files/utils/make_update.py
@@ -92,30 +92,32 @@ def svn_update(args, release_version):
print_stage("Updating Precompiled Libraries and Tests")
if os.path.isdir(lib_dirpath):
- for dirname in os.listdir(lib_dirpath):
- dirpath = os.path.join(lib_dirpath, dirname)
-
- if dirname == ".svn":
- # Cleanup must be run from svn root directory if it exists.
- if not make_utils.command_missing(args.svn_command):
- call(svn_non_interactive + ["cleanup", lib_dirpath])
- continue
-
- svn_dirpath = os.path.join(dirpath, ".svn")
- svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
-
- if os.path.isdir(dirpath) and \
- (os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath)):
- if make_utils.command_missing(args.svn_command):
- sys.stderr.write("svn not found, can't update libraries\n")
- sys.exit(1)
-
- # Cleanup to continue with interrupted downloads.
- if os.path.exists(svn_dirpath):
- call(svn_non_interactive + ["cleanup", dirpath])
- # Switch to appropriate branch and update.
- call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
- call(svn_non_interactive + ["update", dirpath])
+ for dirname in os.listdir(lib_dirpath):
+ dirpath = os.path.join(lib_dirpath, dirname)
+
+ if dirname == ".svn":
+ # Cleanup must be run from svn root directory if it exists.
+ if not make_utils.command_missing(args.svn_command):
+ call(svn_non_interactive + ["cleanup", lib_dirpath])
+ continue
+
+ svn_dirpath = os.path.join(dirpath, ".svn")
+ svn_root_dirpath = os.path.join(lib_dirpath, ".svn")
+
+ if (
+ os.path.isdir(dirpath) and
+ (os.path.exists(svn_dirpath) or os.path.exists(svn_root_dirpath))
+ ):
+ if make_utils.command_missing(args.svn_command):
+ sys.stderr.write("svn not found, can't update libraries\n")
+ sys.exit(1)
+
+ # Cleanup to continue with interrupted downloads.
+ if os.path.exists(svn_dirpath):
+ call(svn_non_interactive + ["cleanup", dirpath])
+ # Switch to appropriate branch and update.
+ call(svn_non_interactive + ["switch", svn_url + dirname, dirpath], exit_on_error=False)
+ call(svn_non_interactive + ["update", dirpath])
# Test if git repo can be updated.
def git_update_skip(args, check_remote_exists=True):
@@ -127,9 +129,11 @@ def git_update_skip(args, check_remote_exists=True):
rebase_merge = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-merge'], exit_on_error=False)
rebase_apply = check_output([args.git_command, 'rev-parse', '--git-path', 'rebase-apply'], exit_on_error=False)
merge_head = check_output([args.git_command, 'rev-parse', '--git-path', 'MERGE_HEAD'], exit_on_error=False)
- if os.path.exists(rebase_merge) or \
- os.path.exists(rebase_apply) or \
- os.path.exists(merge_head):
+ if (
+ os.path.exists(rebase_merge) or
+ os.path.exists(rebase_apply) or
+ os.path.exists(merge_head)
+ ):
return "rebase or merge in progress, complete it first"
# Abort if uncommitted changes.
@@ -139,13 +143,14 @@ def git_update_skip(args, check_remote_exists=True):
# Test if there is an upstream branch configured
if check_remote_exists:
- branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
- remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
- if len(remote) == 0:
- return "no remote branch to pull from"
+ branch = check_output([args.git_command, "rev-parse", "--abbrev-ref", "HEAD"])
+ remote = check_output([args.git_command, "config", "branch." + branch + ".remote"], exit_on_error=False)
+ if len(remote) == 0:
+ return "no remote branch to pull from"
return ""
+
# Update blender repository.
def blender_update(args):
print_stage("Updating Blender Git Repository")
@@ -184,7 +189,7 @@ def submodules_update(args, release_version, branch):
os.chdir(submodule_path)
msg = git_update_skip(args, check_remote_exists=False)
if msg:
- skip_msg += submodule_path + " skipped: " + msg + "\n"
+ skip_msg += submodule_path + " skipped: " + msg + "\n"
else:
if make_utils.git_branch(args.git_command) != submodule_branch:
call([args.git_command, "fetch", "origin"])
diff --git a/build_files/utils/make_utils.py b/build_files/utils/make_utils.py
index ce87bdd46e4..9f928bb524d 100755
--- a/build_files/utils/make_utils.py
+++ b/build_files/utils/make_utils.py
@@ -64,7 +64,7 @@ def git_branch_release_version(branch, tag):
if release_version:
release_version = release_version.group(1)
elif tag:
- release_version = re.search("^v([0-9]*\.[0-9]*).*", tag)
+ release_version = re.search(r"^v([0-9]*\.[0-9]*).*", tag)
if release_version:
release_version = release_version.group(1)
return release_version
diff --git a/doc/python_api/sphinx_doc_gen.py b/doc/python_api/sphinx_doc_gen.py
index 0a63949145a..92ab4797c25 100644
--- a/doc/python_api/sphinx_doc_gen.py
+++ b/doc/python_api/sphinx_doc_gen.py
@@ -1205,7 +1205,7 @@ def pyrna_enum2sphinx(prop, use_empty_descriptions=False):
identifier,
# Account for multi-line enum descriptions, allowing this to be a block of text.
indent(", ".join(escape_rst(val) for val in (name, description) if val) or "Undocumented", " "),
- )
+ )
for identifier, name, description in prop.enum_items
])
else:
diff --git a/intern/cycles/blender/addon/engine.py b/intern/cycles/blender/addon/engine.py
index a50b733eda2..54221d3f1e0 100644
--- a/intern/cycles/blender/addon/engine.py
+++ b/intern/cycles/blender/addon/engine.py
@@ -150,8 +150,7 @@ def create(engine, data, region=None, v3d=None, rv3d=None, preview_osl=False):
screen = screen or rv3d.id_data.as_pointer()
rv3d = rv3d.as_pointer()
- engine.session = _cycles.create(
- engine.as_pointer(), prefs, data, screen, region, v3d, rv3d, preview_osl)
+ engine.session = _cycles.create(engine.as_pointer(), prefs, data, screen, region, v3d, rv3d, preview_osl)
def free(engine):
diff --git a/intern/cycles/blender/addon/operators.py b/intern/cycles/blender/addon/operators.py
index 895e1a83c66..2045f6ab780 100644
--- a/intern/cycles/blender/addon/operators.py
+++ b/intern/cycles/blender/addon/operators.py
@@ -46,8 +46,8 @@ class CYCLES_OT_use_shading_nodes(Operator):
class CYCLES_OT_add_aov(bpy.types.Operator):
"""Add an AOV pass"""
- bl_idname="cycles.add_aov"
- bl_label="Add AOV"
+ bl_idname = "cycles.add_aov"
+ bl_label = "Add AOV"
def execute(self, context):
view_layer = context.view_layer
@@ -61,8 +61,8 @@ class CYCLES_OT_add_aov(bpy.types.Operator):
class CYCLES_OT_remove_aov(bpy.types.Operator):
"""Remove an AOV pass"""
- bl_idname="cycles.remove_aov"
- bl_label="Remove AOV"
+ bl_idname = "cycles.remove_aov"
+ bl_label = "Remove AOV"
def execute(self, context):
view_layer = context.view_layer
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index 3d4dafb43ad..d29f709263e 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -143,7 +143,7 @@ enum_texture_limit = (
('8192', "8192", "Limit texture size to 8192 pixels", 7),
)
-enum_view3d_shading_render_pass= (
+enum_view3d_shading_render_pass = (
('', "General", ""),
('COMBINED', "Combined", "Show the Combined Render pass", 1),
@@ -417,18 +417,18 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
)
min_light_bounces: IntProperty(
- name="Min Light Bounces",
- description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, "
- "but can also be less efficient for more complex geometry like hair and volumes",
- min=0, max=1024,
- default=0,
+ name="Min Light Bounces",
+ description="Minimum number of light bounces. Setting this higher reduces noise in the first bounces, "
+ "but can also be less efficient for more complex geometry like hair and volumes",
+ min=0, max=1024,
+ default=0,
)
min_transparent_bounces: IntProperty(
- name="Min Transparent Bounces",
- description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, "
- "but can also be less efficient for more complex geometry like hair and volumes",
- min=0, max=1024,
- default=0,
+ name="Min Transparent Bounces",
+ description="Minimum number of transparent bounces. Setting this higher reduces noise in the first bounces, "
+ "but can also be less efficient for more complex geometry like hair and volumes",
+ min=0, max=1024,
+ default=0,
)
caustics_reflective: BoolProperty(
@@ -1473,31 +1473,31 @@ class CyclesRenderLayerSettings(bpy.types.PropertyGroup):
description="Render cryptomatte object pass, for isolating objects in compositing",
default=False,
update=update_render_passes,
- )
+ )
use_pass_crypto_material: BoolProperty(
name="Cryptomatte Material",
description="Render cryptomatte material pass, for isolating materials in compositing",
default=False,
update=update_render_passes,
- )
+ )
use_pass_crypto_asset: BoolProperty(
name="Cryptomatte Asset",
description="Render cryptomatte asset pass, for isolating groups of objects with the same parent",
default=False,
update=update_render_passes,
- )
+ )
pass_crypto_depth: IntProperty(
name="Cryptomatte Levels",
description="Sets how many unique objects can be distinguished per pixel",
default=6, min=2, max=16, step=2,
update=update_render_passes,
- )
+ )
pass_crypto_accurate: BoolProperty(
name="Cryptomatte Accurate",
description="Generate a more accurate Cryptomatte pass. CPU only, may render slower and use more memory",
default=True,
update=update_render_passes,
- )
+ )
aovs: CollectionProperty(
type=CyclesAOVPass,
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 11c89a70ad9..72d98e78c4d 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -711,9 +711,9 @@ class CYCLES_RENDER_PT_performance_acceleration_structure(CyclesButtonsPanel, Pa
if use_cpu(context):
use_embree = _cycles.with_embree
if not use_embree:
- sub = col.column(align=True)
- sub.label(text="Cycles built without Embree support")
- sub.label(text="CPU raytracing performance will be poor")
+ sub = col.column(align=True)
+ sub.label(text="Cycles built without Embree support")
+ sub.label(text="CPU raytracing performance will be poor")
col.prop(cscene, "debug_use_spatial_splits")
sub = col.column()
@@ -843,8 +843,6 @@ class CYCLES_RENDER_PT_passes_data(CyclesButtonsPanel, Panel):
col.prop(cycles_view_layer, "pass_debug_render_time", text="Render Time")
col.prop(cycles_view_layer, "pass_debug_sample_count", text="Sample Count")
-
-
layout.prop(view_layer, "pass_alpha_threshold")
@@ -959,7 +957,15 @@ class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, Panel):
row = layout.row()
col = row.column()
- col.template_list("CYCLES_RENDER_UL_aov", "aovs", cycles_view_layer, "aovs", cycles_view_layer, "active_aov", rows=2)
+ col.template_list(
+ "CYCLES_RENDER_UL_aov",
+ "aovs",
+ cycles_view_layer,
+ "aovs",
+ cycles_view_layer,
+ "active_aov",
+ rows=2,
+ )
col = row.column()
sub = col.column(align=True)
@@ -967,9 +973,9 @@ class CYCLES_RENDER_PT_passes_aov(CyclesButtonsPanel, Panel):
sub.operator("cycles.remove_aov", icon='REMOVE', text="")
if cycles_view_layer.active_aov < len(cycles_view_layer.aovs):
- active_aov = cycles_view_layer.aovs[cycles_view_layer.active_aov]
- if active_aov.conflict:
- layout.label(text=active_aov.conflict, icon='ERROR')
+ active_aov = cycles_view_layer.aovs[cycles_view_layer.active_aov]
+ if active_aov.conflict:
+ layout.label(text=active_aov.conflict, icon='ERROR')
class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
@@ -1222,7 +1228,7 @@ class CYCLES_OBJECT_PT_motion_blur(CyclesButtonsPanel, Panel):
def has_geometry_visibility(ob):
return ob and ((ob.type in {'MESH', 'CURVE', 'SURFACE', 'FONT', 'META', 'LIGHT'}) or
- (ob.instance_type == 'COLLECTION' and ob.instance_collection))
+ (ob.instance_type == 'COLLECTION' and ob.instance_collection))
class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel):
@@ -1232,7 +1238,7 @@ class CYCLES_OBJECT_PT_shading(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
- return CyclesButtonsPanel.poll(context) and (context.object)
+ return CyclesButtonsPanel.poll(context) and (context.object)
def draw(self, context):
layout = self.layout
@@ -1255,7 +1261,7 @@ class CYCLES_OBJECT_PT_visibility(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
- return CyclesButtonsPanel.poll(context) and (context.object)
+ return CyclesButtonsPanel.poll(context) and (context.object)
def draw(self, context):
layout = self.layout
@@ -1865,6 +1871,7 @@ class CYCLES_RENDER_PT_bake_influence(CyclesButtonsPanel, Panel):
bl_context = "render"
bl_parent_id = "CYCLES_RENDER_PT_bake"
COMPAT_ENGINES = {'CYCLES'}
+
@classmethod
def poll(cls, context):
scene = context.scene
@@ -2150,8 +2157,10 @@ class CYCLES_VIEW3D_PT_shading_render_pass(Panel):
@classmethod
def poll(cls, context):
- return (context.engine in cls.COMPAT_ENGINES
- and context.space_data.shading.type == 'RENDERED')
+ return (
+ context.engine in cls.COMPAT_ENGINES and
+ context.space_data.shading.type == 'RENDERED'
+ )
def draw(self, context):
shading = context.space_data.shading
@@ -2169,8 +2178,10 @@ class CYCLES_VIEW3D_PT_shading_lighting(Panel):
@classmethod
def poll(cls, context):
- return (context.engine in cls.COMPAT_ENGINES
- and context.space_data.shading.type == 'RENDERED')
+ return (
+ context.engine in cls.COMPAT_ENGINES and
+ context.space_data.shading.type == 'RENDERED'
+ )
def draw(self, context):
layout = self.layout
@@ -2199,12 +2210,14 @@ class CYCLES_VIEW3D_PT_shading_lighting(Panel):
col.prop(shading, "studiolight_intensity")
col.prop(shading, "studiolight_background_alpha")
+
class CYCLES_VIEW3D_PT_simplify_greasepencil(CyclesButtonsPanel, Panel, GreasePencilSimplifyPanel):
bl_label = "Grease Pencil"
bl_parent_id = "CYCLES_RENDER_PT_simplify"
COMPAT_ENGINES = {'CYCLES'}
bl_options = {'DEFAULT_CLOSED'}
+
def draw_device(self, context):
scene = context.scene
layout = self.layout
diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py
index 49f23f4ba30..f7e3e693858 100644
--- a/intern/cycles/blender/addon/version_update.py
+++ b/intern/cycles/blender/addon/version_update.py
@@ -137,9 +137,11 @@ def do_versions(self):
# Caustics Reflective/Refractive separation in 272
if version <= (2, 72, 0):
cscene = scene.cycles
- if (cscene.get("no_caustics", False) and
- not cscene.is_property_set("caustics_reflective") and
- not cscene.is_property_set("caustics_refractive")):
+ if (
+ cscene.get("no_caustics", False) and
+ not cscene.is_property_set("caustics_reflective") and
+ not cscene.is_property_set("caustics_refractive")
+ ):
cscene.caustics_reflective = False
cscene.caustics_refractive = False
diff --git a/release/scripts/freestyle/modules/freestyle/chainingiterators.py b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
index 990a97db3f2..be9a25d1a57 100644
--- a/release/scripts/freestyle/modules/freestyle/chainingiterators.py
+++ b/release/scripts/freestyle/modules/freestyle/chainingiterators.py
@@ -36,14 +36,14 @@ __all__ = (
"pyFillOcclusionsAbsoluteAndRelativeChainingIterator",
"pyFillQi0AbsoluteAndRelativeChainingIterator",
"pyNoIdChainSilhouetteIterator",
- )
+)
# module members
from _freestyle import (
ChainPredicateIterator,
ChainSilhouetteIterator,
- )
+)
# constructs for predicate definition in Python
from freestyle.types import (
@@ -51,15 +51,15 @@ from freestyle.types import (
ChainingIterator,
Nature,
TVertex,
- )
+)
from freestyle.predicates import (
ExternalContourUP1D,
- )
+)
from freestyle.utils import (
ContextFunctions as CF,
get_chain_length,
find_matching_vertex,
- )
+)
import bpy
@@ -73,7 +73,7 @@ NATURES = (
Nature.SUGGESTIVE_CONTOUR,
Nature.VALLEY,
Nature.RIDGE
- )
+)
def nature_in_preceding(nature, index):
@@ -97,12 +97,12 @@ class pyChainSilhouetteIterator(ChainingIterator):
def traverse(self, iter):
it = AdjacencyIterator(iter)
- ## case of TVertex
+ # case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
return find_matching_vertex(mate.id, it)
- ## case of NonTVertex
+ # case of NonTVertex
winner = None
for i, nat in enumerate(NATURES):
if (nat & self.current_edge.nature):
@@ -145,12 +145,12 @@ class pyChainSilhouetteGenericIterator(ChainingIterator):
def traverse(self, iter):
it = AdjacencyIterator(iter)
- ## case of TVertex
+ # case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
return find_matching_vertex(mate.id, it)
- ## case of NonTVertex
+ # case of NonTVertex
winner = None
for i, nat in enumerate(NATURES):
if (nat & self.current_edge.nature):
@@ -227,7 +227,7 @@ class pySketchyChainSilhouetteIterator(ChainingIterator):
:type stayInSelection: bool
"""
- def __init__(self, nRounds=3,stayInSelection=True):
+ def __init__(self, nRounds=3, stayInSelection=True):
ChainingIterator.__init__(self, stayInSelection, False, None, True)
self._timeStamp = CF.get_time_stamp() + nRounds
self._nRounds = nRounds
@@ -249,12 +249,12 @@ class pySketchyChainSilhouetteIterator(ChainingIterator):
def traverse(self, iter):
it = AdjacencyIterator(iter)
- ## case of TVertex
+ # case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
return self.make_sketchy(find_matching_vertex(mate.id, it))
- ## case of NonTVertex
+ # case of NonTVertex
winner = None
for i, nat in enumerate(NATURES):
if (nat & self.current_edge.nature):
@@ -342,13 +342,13 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
winner = None
winnerOrientation = False
it = AdjacencyIterator(iter)
- ## case of TVertex
+ # case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
winner = find_matching_vertex(mate.id, it)
winnerOrientation = not it.is_incoming if not it.is_end else False
- ## case of NonTVertex
+ # case of NonTVertex
else:
for nat in NATURES:
if (self.current_edge.nature & nat):
@@ -379,7 +379,8 @@ class pyFillOcclusionsRelativeChainingIterator(ChainingIterator):
while (not _cit.is_end) and _cit.object.time_stamp != self.timestamp:
connexl += _cit.object.length_2d
_cit.increment()
- if _cit.is_begin: break
+ if _cit.is_begin:
+ break
if connexl > self._percent * self._length:
return None
@@ -411,13 +412,13 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
winner = None
winnerOrientation = False
it = AdjacencyIterator(iter)
- ## case of TVertex
+ # case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
winner = find_matching_vertex(mate.id, it)
winnerOrientation = not it.is_incoming if not it.is_end else False
- ## case of NonTVertex
+ # case of NonTVertex
else:
for nat in NATURES:
if (self.current_edge.nature & nat):
@@ -440,7 +441,8 @@ class pyFillOcclusionsAbsoluteChainingIterator(ChainingIterator):
while (not _cit.is_end) and _cit.object.time_stamp != self.timestamp:
connexl += _cit.object.length_2d
_cit.increment()
- if _cit.is_begin: break
+ if _cit.is_begin:
+ break
if connexl > self._length:
return None
@@ -463,6 +465,7 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
:arg l: Absolute length.
:type l: float
"""
+
def __init__(self, percent, l):
ChainingIterator.__init__(self, False, True, None, True)
self._length = 0.0
@@ -479,13 +482,13 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
winner = None
winnerOrientation = False
it = AdjacencyIterator(iter)
- ## case of TVertex
+ # case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
winner = find_matching_vertex(mate.id, it)
winnerOrientation = not it.is_incoming if not it.is_end else False
- ## case of NonTVertex
+ # case of NonTVertex
else:
for nat in NATURES:
if (self.current_edge.nature & nat):
@@ -499,22 +502,23 @@ class pyFillOcclusionsAbsoluteAndRelativeChainingIterator(ChainingIterator):
if winner is not None and winner.time_stamp != CF.get_time_stamp():
- if self._length == 0.0:
- self._length = get_chain_length(winner, winnerOrientation)
-
- connexl = 0.0
- _cit = pyChainSilhouetteGenericIterator(False, False)
- _cit.begin = winner
- _cit.current_edge = winner
- _cit.orientation = winnerOrientation
- _cit.init()
- while (not _cit.is_end) and _cit.object.time_stamp != CF.get_time_stamp():
- connexl += _cit.object.length_2d
- _cit.increment()
- if _cit.is_begin: break
-
- if (connexl > self._percent * self._length) or (connexl > self._absLength):
- return None
+ if self._length == 0.0:
+ self._length = get_chain_length(winner, winnerOrientation)
+
+ connexl = 0.0
+ _cit = pyChainSilhouetteGenericIterator(False, False)
+ _cit.begin = winner
+ _cit.current_edge = winner
+ _cit.orientation = winnerOrientation
+ _cit.init()
+ while (not _cit.is_end) and _cit.object.time_stamp != CF.get_time_stamp():
+ connexl += _cit.object.length_2d
+ _cit.increment()
+ if _cit.is_begin:
+ break
+
+ if (connexl > self._percent * self._length) or (connexl > self._absLength):
+ return None
return winner
@@ -549,13 +553,13 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
winner = None
winnerOrientation = False
it = AdjacencyIterator(iter)
- ## case of TVertex
+ # case of TVertex
vertex = self.next_vertex
if type(vertex) is TVertex:
mate = vertex.get_mate(self.current_edge)
winner = find_matching_vertex(mate.id, it)
winnerOrientation = not it.is_incoming if not it.is_end else False
- ## case of NonTVertex
+ # case of NonTVertex
else:
for nat in NATURES:
if (self.current_edge.nature & nat):
@@ -569,22 +573,22 @@ class pyFillQi0AbsoluteAndRelativeChainingIterator(ChainingIterator):
if winner is not None and winner.qi:
+ if self._length == 0.0:
+ self._length = get_chain_length(winner, winnerOrientation)
- if self._length == 0.0:
- self._length = get_chain_length(winner, winnerOrientation)
-
- connexl = 0
- _cit = pyChainSilhouetteGenericIterator(False, False)
- _cit.begin = winner
- _cit.current_edge = winner
- _cit.orientation = winnerOrientation
- _cit.init()
- while (not _cit.is_end) and _cit.object.qi != 0:
- connexl += _cit.object.length_2d
- _cit.increment()
- if _cit.is_begin: break
- if (connexl > self._percent * self._length) or (connexl > self._absLength):
- return None
+ connexl = 0
+ _cit = pyChainSilhouetteGenericIterator(False, False)
+ _cit.begin = winner
+ _cit.current_edge = winner
+ _cit.orientation = winnerOrientation
+ _cit.init()
+ while (not _cit.is_end) and _cit.object.qi != 0:
+ connexl += _cit.object.length_2d
+ _cit.increment()
+ if _cit.is_begin:
+ break
+ if (connexl > self._percent * self._length) or (connexl > self._absLength):
+ return None
return winner
@@ -637,10 +641,10 @@ class pyNoIdChainSilhouetteIterator(ChainingIterator):
if vA.id.first == vB.id.first:
return ve
return None
- ## case of NonTVertex
+ # case of NonTVertex
else:
for i, nat in enumerate(NATURES):
- if (nat & self.current_edge.nature):
+ if (nat & self.current_edge.nature):
for ve in it:
ve_nat = ve.nature
if (ve_nat & nat):
diff --git a/release/scripts/freestyle/modules/freestyle/predicates.py b/release/scripts/freestyle/modules/freestyle/predicates.py
index 5cbe577b956..656b6952591 100644
--- a/release/scripts/freestyle/modules/freestyle/predicates.py
+++ b/release/scripts/freestyle/modules/freestyle/predicates.py
@@ -95,7 +95,7 @@ __all__ = (
"pyZBP1D",
"pyZDiscontinuityBP1D",
"pyZSmallerUP1D",
- )
+)
# module members
@@ -117,7 +117,7 @@ from _freestyle import (
TrueUP1D,
ViewMapGradientNormBP1D,
WithinImageBoundaryUP1D,
- )
+)
# constructs for predicate definition in Python
from freestyle.types import (
@@ -129,7 +129,7 @@ from freestyle.types import (
TVertex,
UnaryPredicate0D,
UnaryPredicate1D,
- )
+)
from freestyle.functions import (
Curvature2DAngleF0D,
CurveNatureF1D,
@@ -149,7 +149,7 @@ from freestyle.functions import (
pyCurvilinearLengthF0D,
pyDensityAnisotropyF1D,
pyViewMapGradientNormF1D,
- )
+)
from freestyle.utils import material_from_fedge
@@ -194,6 +194,7 @@ class pyBackTVertexUP0D(UnaryPredicate0D):
Check whether an Interface0DIterator references a TVertex and is
the one that is hidden (inferred from the context).
"""
+
def __init__(self):
UnaryPredicate0D.__init__(self)
self._getQI = QuantitativeInvisibilityF0D()
@@ -239,7 +240,7 @@ class AndUP1D(UnaryPredicate1D):
correct_types = all(isinstance(p, UnaryPredicate1D) for p in self.predicates)
if not (correct_types and predicates):
raise TypeError("%s: Expected one or more UnaryPredicate1D, got %r" %
- (self.__class__.__name__, self.predicates))
+ (self.__class__.__name__, self.predicates))
def __call__(self, inter):
return all(pred(inter) for pred in self.predicates)
@@ -252,7 +253,7 @@ class OrUP1D(UnaryPredicate1D):
correct_types = all(isinstance(p, UnaryPredicate1D) for p in self.predicates)
if not (correct_types and predicates):
raise TypeError("%s: Expected one or more UnaryPredicate1D, got %r" %
- (self.__class__.__name__, self.predicates))
+ (self.__class__.__name__, self.predicates))
def __call__(self, inter):
return any(pred(inter) for pred in self.predicates)
@@ -533,7 +534,8 @@ class pyHighViewMapGradientNormUP1D(UnaryPredicate1D):
class pyDensityVariableSigmaUP1D(UnaryPredicate1D):
- def __init__(self, functor, sigmaMin, sigmaMax, lmin, lmax, tmin, tmax, integration=IntegrationType.MEAN, sampling=2.0):
+ def __init__(self, functor, sigmaMin, sigmaMax, lmin, lmax, tmin,
+ tmax, integration=IntegrationType.MEAN, sampling=2.0):
UnaryPredicate1D.__init__(self)
self._functor = functor
self._sigmaMin = float(sigmaMin)
@@ -571,7 +573,7 @@ class AndBP1D(BinaryPredicate1D):
correct_types = all(isinstance(p, BinaryPredicate1D) for p in self.predicates)
if not (correct_types and predicates):
raise TypeError("%s: Expected one or more BinaryPredicate1D, got %r" %
- (self.__class__.__name__, self.predicates))
+ (self.__class__.__name__, self.predicates))
def __call__(self, i1, i2):
return all(pred(i1, i2) for pred in self.predicates)
@@ -584,7 +586,7 @@ class OrBP1D(BinaryPredicate1D):
correct_types = all(isinstance(p, BinaryPredicate1D) for p in self.predicates)
if not (correct_types and predicates):
raise TypeError("%s: Expected one or more BinaryPredicate1D, got %r" %
- (self.__class__.__name__, self.predicates))
+ (self.__class__.__name__, self.predicates))
def __call__(self, i1, i2):
return any(pred(i1, i2) for pred in self.predicates)
@@ -672,8 +674,10 @@ class pyShuffleBP1D(BinaryPredicate1D):
def __call__(self, inter1, inter2):
return (random.uniform(0, 1) < random.uniform(0, 1))
+
class MaterialBP1D(BinaryPredicate1D):
"""Checks whether the two supplied ViewEdges have the same material."""
+
def __call__(self, i1, i2):
fedges = (fe for ve in (i1, i2) for fe in (ve.first_fedge, ve.last_fedge))
materials = {material_from_fedge(fe) for fe in fedges}
diff --git a/release/scripts/freestyle/modules/freestyle/types.py b/release/scripts/freestyle/modules/freestyle/types.py
index 22f80f41dfc..72d263b26a3 100644
--- a/release/scripts/freestyle/modules/freestyle/types.py
+++ b/release/scripts/freestyle/modules/freestyle/types.py
@@ -170,4 +170,4 @@ from _freestyle import (
ViewShape,
ViewVertex,
orientedViewEdgeIterator,
- )
+)
diff --git a/release/scripts/freestyle/modules/freestyle/utils.py b/release/scripts/freestyle/modules/freestyle/utils.py
index 2d47995d474..d129de66221 100644
--- a/release/scripts/freestyle/modules/freestyle/utils.py
+++ b/release/scripts/freestyle/modules/freestyle/utils.py
@@ -51,14 +51,14 @@ __all__ = (
"stroke_normal",
"StrokeCollector",
"tripplewise",
- )
+)
# module members
from _freestyle import (
ContextFunctions,
getCurrentScene,
integrate,
- )
+)
# constructs for helper functions in Python
from freestyle.types import (
@@ -66,7 +66,7 @@ from freestyle.types import (
Stroke,
StrokeShader,
StrokeVertexIterator,
- )
+)
from mathutils import Vector
from functools import lru_cache, namedtuple
@@ -288,7 +288,7 @@ class BoundingBox:
"maximum",
"size",
"corners",
- )
+ )
def __init__(self, minimum: Vector, maximum: Vector):
self.minimum = minimum
@@ -319,6 +319,7 @@ class BoundingBox:
class StrokeCollector(StrokeShader):
"""Collects and Stores stroke objects"""
+
def __init__(self):
StrokeShader.__init__(self)
self.strokes = []
diff --git a/release/scripts/freestyle/modules/parameter_editor.py b/release/scripts/freestyle/modules/parameter_editor.py
index 0b8ccf387fd..65eee93c871 100644
--- a/release/scripts/freestyle/modules/parameter_editor.py
+++ b/release/scripts/freestyle/modules/parameter_editor.py
@@ -34,20 +34,20 @@ from freestyle.types import (
TVertex,
Material,
ViewEdge,
- )
+)
from freestyle.chainingiterators import (
ChainPredicateIterator,
ChainSilhouetteIterator,
pySketchyChainSilhouetteIterator,
pySketchyChainingIterator,
- )
+)
from freestyle.functions import (
Curvature2DAngleF0D,
Normal2DF0D,
QuantitativeInvisibilityF1D,
VertexOrientation2DF0D,
CurveMaterialF0D,
- )
+)
from freestyle.predicates import (
AndUP1D,
ContourUP1D,
@@ -67,7 +67,7 @@ from freestyle.predicates import (
pyProjectedXBP1D,
pyProjectedYBP1D,
pyZBP1D,
- )
+)
from freestyle.shaders import (
BackboneStretcherShader,
BezierCurveShader,
@@ -86,7 +86,7 @@ from freestyle.shaders import (
StrokeTextureStepShader,
ThicknessNoiseShader as thickness_noise,
TipRemoverShader,
- )
+)
from freestyle.utils import (
angle_x_normal,
bound,
@@ -103,12 +103,12 @@ from freestyle.utils import (
pairwise,
simplify,
stroke_normal,
- )
+)
from _freestyle import (
blendRamp,
evaluateColorRamp,
evaluateCurveMappingF,
- )
+)
import time
import bpy
@@ -608,7 +608,9 @@ class NoiseShader:
class ThicknessNoiseShader(ThicknessBlenderMixIn, ScalarBlendModifier, NoiseShader):
"""Thickness based on pseudo-noise"""
- def __init__(self, thickness_position, thickness_ratio, blend_type, influence, amplitude, period, seed=512, asymmetric=True):
+
+ def __init__(self, thickness_position, thickness_ratio, blend_type,
+ influence, amplitude, period, seed=512, asymmetric=True):
ScalarBlendModifier.__init__(self, blend_type, influence)
ThicknessBlenderMixIn.__init__(self, thickness_position, thickness_ratio)
NoiseShader.__init__(self, amplitude, period, seed)
diff --git a/release/scripts/freestyle/styles/anisotropic_diffusion.py b/release/scripts/freestyle/styles/anisotropic_diffusion.py
index fc136b23d82..48de802ba1b 100644
--- a/release/scripts/freestyle/styles/anisotropic_diffusion.py
+++ b/release/scripts/freestyle/styles/anisotropic_diffusion.py
@@ -29,13 +29,13 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
SamplingShader,
pyDiffusion2Shader,
- )
+)
from freestyle.types import Operators, Stroke
@@ -52,5 +52,5 @@ shaders_list = [
SamplingShader(2),
pyDiffusion2Shader(offset, nbIter),
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/apriori_and_causal_density.py b/release/scripts/freestyle/styles/apriori_and_causal_density.py
index 42fc3370488..d19a1cda0bc 100644
--- a/release/scripts/freestyle/styles/apriori_and_causal_density.py
+++ b/release/scripts/freestyle/styles/apriori_and_causal_density.py
@@ -31,11 +31,11 @@ from freestyle.predicates import (
TrueBP1D,
pyDensityUP1D,
pyHighViewMapDensityUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
- )
+)
from freestyle.types import IntegrationType, Operators
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.3, IntegrationType.LAST))
@@ -45,5 +45,5 @@ Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(Quan
shaders_list = [
ConstantThicknessShader(2),
ConstantColorShader(0, 0, 0, 1),
- ]
+]
Operators.create(pyDensityUP1D(1, 0.1, IntegrationType.MEAN), shaders_list)
diff --git a/release/scripts/freestyle/styles/apriori_density.py b/release/scripts/freestyle/styles/apriori_density.py
index ad5e610e422..833f04d487c 100644
--- a/release/scripts/freestyle/styles/apriori_density.py
+++ b/release/scripts/freestyle/styles/apriori_density.py
@@ -29,17 +29,17 @@ from freestyle.predicates import (
TrueBP1D,
TrueUP1D,
pyHighViewMapDensityUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
- )
+)
from freestyle.types import Operators
-Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.1,5)))
+Operators.select(AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.1, 5)))
bpred = TrueBP1D()
-upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.0007,5))
+upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyHighViewMapDensityUP1D(0.0007, 5))
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
shaders_list = [
ConstantThicknessShader(2),
diff --git a/release/scripts/freestyle/styles/blueprint_circles.py b/release/scripts/freestyle/styles/blueprint_circles.py
index f39cda5cff9..891d1b90c28 100644
--- a/release/scripts/freestyle/styles/blueprint_circles.py
+++ b/release/scripts/freestyle/styles/blueprint_circles.py
@@ -30,25 +30,25 @@ from freestyle.predicates import (
SameShapeIdBP1D,
TrueUP1D,
pyHigherLengthUP1D,
- )
+)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
pyBluePrintCirclesShader,
pyPerlinNoise1DShader,
- )
+)
from freestyle.types import Operators
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
bpred = SameShapeIdBP1D()
Operators.select(upred)
-Operators.bidirectional_chain(ChainPredicateIterator(upred,bpred), NotUP1D(upred))
+Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
Operators.select(pyHigherLengthUP1D(200))
shaders_list = [
ConstantThicknessShader(5),
pyBluePrintCirclesShader(3),
pyPerlinNoise1DShader(0.1, 15, 8),
IncreasingColorShader(0.8, 0.8, 0.3, 0.4, 0.3, 0.3, 0.3, 0.1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/blueprint_ellipses.py b/release/scripts/freestyle/styles/blueprint_ellipses.py
index 3d977a10d1c..4186c69ff20 100644
--- a/release/scripts/freestyle/styles/blueprint_ellipses.py
+++ b/release/scripts/freestyle/styles/blueprint_ellipses.py
@@ -30,13 +30,13 @@ from freestyle.predicates import (
SameShapeIdBP1D,
TrueUP1D,
pyHigherLengthUP1D,
- )
+)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
pyBluePrintEllipsesShader,
pyPerlinNoise1DShader,
- )
+)
from freestyle.types import Operators
@@ -50,5 +50,5 @@ shaders_list = [
pyBluePrintEllipsesShader(3),
pyPerlinNoise1DShader(0.1, 10, 8),
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.3, 0.3, 0.3, 0.1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/blueprint_squares.py b/release/scripts/freestyle/styles/blueprint_squares.py
index 7110fe413fc..cba53d8065c 100644
--- a/release/scripts/freestyle/styles/blueprint_squares.py
+++ b/release/scripts/freestyle/styles/blueprint_squares.py
@@ -30,13 +30,13 @@ from freestyle.predicates import (
SameShapeIdBP1D,
TrueUP1D,
pyHigherLengthUP1D,
- )
+)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
pyBluePrintSquaresShader,
pyPerlinNoise1DShader,
- )
+)
from freestyle.types import Operators
@@ -51,5 +51,5 @@ shaders_list = [
pyPerlinNoise1DShader(0.07, 10, 8),
IncreasingColorShader(0.6, 0.3, 0.3, 0.7, 0.6, 0.3, 0.3, 0.3),
ConstantThicknessShader(4),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/cartoon.py b/release/scripts/freestyle/styles/cartoon.py
index 87518bb832e..e8244803dd6 100644
--- a/release/scripts/freestyle/styles/cartoon.py
+++ b/release/scripts/freestyle/styles/cartoon.py
@@ -28,12 +28,12 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
BezierCurveShader,
ConstantThicknessShader,
pyMaterialColorShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
BezierCurveShader(3),
ConstantThicknessShader(4),
pyMaterialColorShader(0.8),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/contour.py b/release/scripts/freestyle/styles/contour.py
index c57d7d0d23a..eabd38abc20 100644
--- a/release/scripts/freestyle/styles/contour.py
+++ b/release/scripts/freestyle/styles/contour.py
@@ -29,11 +29,11 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
SameShapeIdBP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
- )
+)
from freestyle.types import Operators
@@ -43,6 +43,6 @@ upred = AndUP1D(QuantitativeInvisibilityUP1D(0), ContourUP1D())
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(QuantitativeInvisibilityUP1D(0)))
shaders_list = [
ConstantThicknessShader(5.0),
- IncreasingColorShader(0.8,0,0,1,0.1,0,0,1),
- ]
+ IncreasingColorShader(0.8, 0, 0, 1, 0.1, 0, 0, 1),
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/curvature2d.py b/release/scripts/freestyle/styles/curvature2d.py
index faf1223b735..84ee544242a 100644
--- a/release/scripts/freestyle/styles/curvature2d.py
+++ b/release/scripts/freestyle/styles/curvature2d.py
@@ -27,11 +27,11 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantThicknessShader,
py2DCurvatureColorShader,
- )
+)
from freestyle.types import Operators, Stroke
@@ -40,5 +40,5 @@ Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInv
shaders_list = [
ConstantThicknessShader(5),
py2DCurvatureColorShader()
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/external_contour.py b/release/scripts/freestyle/styles/external_contour.py
index 4d6c751cbfe..37d60dda827 100644
--- a/release/scripts/freestyle/styles/external_contour.py
+++ b/release/scripts/freestyle/styles/external_contour.py
@@ -29,11 +29,11 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
- )
+)
from freestyle.types import Operators
@@ -44,5 +44,5 @@ Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upre
shaders_list = [
ConstantThicknessShader(3),
ConstantColorShader(0.0, 0.0, 0.0, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/external_contour_sketchy.py b/release/scripts/freestyle/styles/external_contour_sketchy.py
index 6bccf23ac8d..c0efe8912dc 100644
--- a/release/scripts/freestyle/styles/external_contour_sketchy.py
+++ b/release/scripts/freestyle/styles/external_contour_sketchy.py
@@ -30,14 +30,14 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
SpatialNoiseShader,
- )
+)
from freestyle.types import Operators
@@ -50,5 +50,5 @@ shaders_list = [
IncreasingThicknessShader(4, 10),
SmoothingShader(400, 0.1, 0, 0.2, 0, 0, 0, 1),
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/external_contour_smooth.py b/release/scripts/freestyle/styles/external_contour_smooth.py
index 6cd73326a71..63e530e3aa0 100644
--- a/release/scripts/freestyle/styles/external_contour_smooth.py
+++ b/release/scripts/freestyle/styles/external_contour_smooth.py
@@ -29,13 +29,13 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueBP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
- )
+)
from freestyle.types import Operators
@@ -45,8 +45,8 @@ bpred = TrueBP1D()
Operators.bidirectional_chain(ChainPredicateIterator(upred, bpred), NotUP1D(upred))
shaders_list = [
SamplingShader(2),
- IncreasingThicknessShader(4,20),
- IncreasingColorShader(1.0, 0.0, 0.5,1, 0.5,1, 0.3, 1),
+ IncreasingThicknessShader(4, 20),
+ IncreasingColorShader(1.0, 0.0, 0.5, 1, 0.5, 1, 0.3, 1),
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/haloing.py b/release/scripts/freestyle/styles/haloing.py
index 34e4f65cf91..5f8a419b999 100644
--- a/release/scripts/freestyle/styles/haloing.py
+++ b/release/scripts/freestyle/styles/haloing.py
@@ -31,28 +31,28 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyIsOccludedByUP1D,
- )
+)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
TipRemoverShader,
pyTVertexRemoverShader,
- )
+)
from freestyle.types import Id, Operators
# id corresponds to the id of the target object
# (accessed by SHIFT+click)
-id = Id(3,0)
+id = Id(3, 0)
upred = AndUP1D(QuantitativeInvisibilityUP1D(0), pyIsOccludedByUP1D(id))
Operators.select(upred)
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
shaders_list = [
IncreasingThicknessShader(3, 5),
- IncreasingColorShader(1,0,0, 1,0,1,0,1),
+ IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
SamplingShader(1.0),
pyTVertexRemoverShader(),
TipRemoverShader(3.0),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/ignore_small_occlusions.py b/release/scripts/freestyle/styles/ignore_small_occlusions.py
index a01e9e5574f..efa228f4663 100644
--- a/release/scripts/freestyle/styles/ignore_small_occlusions.py
+++ b/release/scripts/freestyle/styles/ignore_small_occlusions.py
@@ -25,21 +25,21 @@ from freestyle.chainingiterators import pyFillOcclusionsAbsoluteChainingIterator
from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import Operators
Operators.select(QuantitativeInvisibilityUP1D(0))
-#Operators.bidirectional_chain(pyFillOcclusionsChainingIterator(0.1))
+# Operators.bidirectional_chain(pyFillOcclusionsChainingIterator(0.1))
Operators.bidirectional_chain(pyFillOcclusionsAbsoluteChainingIterator(12))
shaders_list = [
SamplingShader(5.0),
ConstantThicknessShader(3),
ConstantColorShader(0.0, 0.0, 0.0),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/invisible_lines.py b/release/scripts/freestyle/styles/invisible_lines.py
index 5506f4ef11f..8b23d346f62 100644
--- a/release/scripts/freestyle/styles/invisible_lines.py
+++ b/release/scripts/freestyle/styles/invisible_lines.py
@@ -27,12 +27,12 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
SamplingShader(5.0),
ConstantThicknessShader(3.0),
ConstantColorShader(0.7, 0.7, 0.7),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/japanese_bigbrush.py b/release/scripts/freestyle/styles/japanese_bigbrush.py
index a312bcd4358..b81a06daf0d 100644
--- a/release/scripts/freestyle/styles/japanese_bigbrush.py
+++ b/release/scripts/freestyle/styles/japanese_bigbrush.py
@@ -31,7 +31,7 @@ from freestyle.predicates import (
pyHigherNumberOfTurnsUP1D,
pyLengthBP1D,
pyParameterUP0D,
- )
+)
from freestyle.shaders import (
BezierCurveShader,
ConstantColorShader,
@@ -40,20 +40,20 @@ from freestyle.shaders import (
TipRemoverShader,
pyNonLinearVaryingThicknessShader,
pySamplingShader,
- )
+)
from freestyle.types import IntegrationType, Operators
Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
-## Splits strokes at points of highest 2D curvature
-## when there are too many abrupt turns in it
+# Splits strokes at points of highest 2D curvature
+# when there are too many abrupt turns in it
func = pyInverseCurvature2DAngleF0D()
Operators.recursive_split(func, pyParameterUP0D(0.2, 0.8), NotUP1D(pyHigherNumberOfTurnsUP1D(3, 0.5)), 2)
-## Keeps only long enough strokes
+# Keeps only long enough strokes
Operators.select(pyHigherLengthUP1D(100))
-## Sorts so as to draw the longest strokes first
-## (this will be done using the causal density)
+# Sorts so as to draw the longest strokes first
+# (this will be done using the causal density)
Operators.sort(pyLengthBP1D())
shaders_list = [
pySamplingShader(10),
@@ -61,8 +61,8 @@ shaders_list = [
SamplingShader(50),
ConstantThicknessShader(10),
pyNonLinearVaryingThicknessShader(4, 25, 0.6),
- ConstantColorShader(0.2, 0.2, 0.2,1.0),
+ ConstantColorShader(0.2, 0.2, 0.2, 1.0),
TipRemoverShader(10),
- ]
-## Use the causal density to avoid cluttering
+]
+# Use the causal density to avoid cluttering
Operators.create(pyDensityUP1D(8, 0.4, IntegrationType.MEAN), shaders_list)
diff --git a/release/scripts/freestyle/styles/long_anisotropically_dense.py b/release/scripts/freestyle/styles/long_anisotropically_dense.py
index bfd5910cefe..2e720416632 100644
--- a/release/scripts/freestyle/styles/long_anisotropically_dense.py
+++ b/release/scripts/freestyle/styles/long_anisotropically_dense.py
@@ -37,16 +37,16 @@ from freestyle.predicates import (
pyHighDensityAnisotropyUP1D,
pyHigherLengthUP1D,
pyLengthBP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import IntegrationType, Operators
-## custom density predicate
+# custom density predicate
class pyDensityUP1D(UnaryPredicate1D):
def __init__(self, wsize, threshold, integration=IntegrationType.MEAN, sampling=2.0):
UnaryPredicate1D.__init__(self)
@@ -61,21 +61,22 @@ class pyDensityUP1D(UnaryPredicate1D):
m = self._func2(inter)
if c < self._threshold:
return 1
- if m > 4*c:
- if c < 1.5*self._threshold:
+ if m > 4 * c:
+ if c < 1.5 * self._threshold:
return 1
return 0
+
Operators.select(QuantitativeInvisibilityUP1D(0))
-Operators.bidirectional_chain(ChainSilhouetteIterator(),NotUP1D(QuantitativeInvisibilityUP1D(0)))
+Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
Operators.select(pyHigherLengthUP1D(40))
-## selects lines having a high anisotropic a priori density
-Operators.select(pyHighDensityAnisotropyUP1D(0.3,4))
+# selects lines having a high anisotropic a priori density
+Operators.select(pyHighDensityAnisotropyUP1D(0.3, 4))
Operators.sort(pyLengthBP1D())
shaders_list = [
SamplingShader(2.0),
ConstantThicknessShader(2),
- ConstantColorShader(0.2,0.2,0.25,1),
- ]
-## uniform culling
-Operators.create(pyDensityUP1D(3.0,2.0e-2, IntegrationType.MEAN, 0.1), shaders_list)
+ ConstantColorShader(0.2, 0.2, 0.25, 1),
+]
+# uniform culling
+Operators.create(pyDensityUP1D(3.0, 2.0e-2, IntegrationType.MEAN, 0.1), shaders_list)
diff --git a/release/scripts/freestyle/styles/multiple_parameterization.py b/release/scripts/freestyle/styles/multiple_parameterization.py
index c03a61c9a81..98ed65d0bd1 100644
--- a/release/scripts/freestyle/styles/multiple_parameterization.py
+++ b/release/scripts/freestyle/styles/multiple_parameterization.py
@@ -31,26 +31,26 @@ from freestyle.chainingiterators import ChainSilhouetteIterator
from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
pyHLRShader,
- )
+)
from freestyle.types import Operators
Operators.select(QuantitativeInvisibilityUP1D(0))
-## Chain following the same nature, but without the restriction
-## of staying inside the selection (False).
+# Chain following the same nature, but without the restriction
+# of staying inside the selection (False).
Operators.bidirectional_chain(ChainSilhouetteIterator(False))
shaders_list = [
SamplingShader(20),
IncreasingThicknessShader(1.5, 30),
ConstantColorShader(0.0, 0.0, 0.0),
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
- pyHLRShader(), ## this shader draws only visible portions
- ]
+ pyHLRShader(), # this shader draws only visible portions
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/nature.py b/release/scripts/freestyle/styles/nature.py
index 1061f22017a..e8c4f4508b1 100644
--- a/release/scripts/freestyle/styles/nature.py
+++ b/release/scripts/freestyle/styles/nature.py
@@ -30,11 +30,11 @@ from freestyle.predicates import (
NotUP1D,
TrueUP1D,
pyNatureUP1D,
- )
+)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
- )
+)
from freestyle.types import Operators, Nature
@@ -43,5 +43,5 @@ Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(pyNatureUP1D(Na
shaders_list = [
IncreasingThicknessShader(3, 10),
IncreasingColorShader(0.0, 0.0, 0.0, 1, 0.8, 0, 0, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/near_lines.py b/release/scripts/freestyle/styles/near_lines.py
index 14c8d2f9e01..57de57347e7 100644
--- a/release/scripts/freestyle/styles/near_lines.py
+++ b/release/scripts/freestyle/styles/near_lines.py
@@ -29,11 +29,11 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyZSmallerUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
- )
+)
from freestyle.types import IntegrationType, Operators
@@ -43,5 +43,5 @@ Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
shaders_list = [
ConstantThicknessShader(5),
ConstantColorShader(0.0, 0.0, 0.0),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/occluded_by_specific_object.py b/release/scripts/freestyle/styles/occluded_by_specific_object.py
index d6f85aed0ac..0f12195eb14 100644
--- a/release/scripts/freestyle/styles/occluded_by_specific_object.py
+++ b/release/scripts/freestyle/styles/occluded_by_specific_object.py
@@ -28,18 +28,18 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyIsInOccludersListUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import Id, Operators
-## the id of the occluder (use SHIFT+click on the ViewMap to
-## retrieve ids)
-id = Id(3,0)
+# the id of the occluder (use SHIFT+click on the ViewMap to
+# retrieve ids)
+id = Id(3, 0)
upred = AndUP1D(NotUP1D(QuantitativeInvisibilityUP1D(0)), pyIsInOccludersListUP1D(id))
Operators.select(upred)
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
@@ -47,5 +47,5 @@ shaders_list = [
SamplingShader(5),
ConstantThicknessShader(3),
ConstantColorShader(0.3, 0.3, 0.3, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/polygonalize.py b/release/scripts/freestyle/styles/polygonalize.py
index 8eb6e5d56ee..b31cad8d7d5 100644
--- a/release/scripts/freestyle/styles/polygonalize.py
+++ b/release/scripts/freestyle/styles/polygonalize.py
@@ -26,13 +26,13 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
PolygonalizationShader,
SamplingShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
ConstantThicknessShader(3),
ConstantColorShader(0.0, 0.0, 0.0),
PolygonalizationShader(8),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/qi0.py b/release/scripts/freestyle/styles/qi0.py
index 53840f25e0f..a1e8a071236 100644
--- a/release/scripts/freestyle/styles/qi0.py
+++ b/release/scripts/freestyle/styles/qi0.py
@@ -27,12 +27,12 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import Operators
@@ -42,5 +42,5 @@ shaders_list = [
SamplingShader(5.0),
ConstantThicknessShader(4.0),
ConstantColorShader(0.0, 0.0, 0.0)
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/qi0_not_external_contour.py b/release/scripts/freestyle/styles/qi0_not_external_contour.py
index 3c9b8873485..1b3fb0644ad 100644
--- a/release/scripts/freestyle/styles/qi0_not_external_contour.py
+++ b/release/scripts/freestyle/styles/qi0_not_external_contour.py
@@ -29,14 +29,14 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
BackboneStretcherShader,
IncreasingColorShader,
IncreasingThicknessShader,
SamplingShader,
SpatialNoiseShader,
- )
+)
from freestyle.types import Operators
@@ -49,5 +49,5 @@ shaders_list = [
IncreasingThicknessShader(2, 5),
BackboneStretcherShader(20),
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/qi1.py b/release/scripts/freestyle/styles/qi1.py
index 4d87055eafb..60d210cd134 100644
--- a/release/scripts/freestyle/styles/qi1.py
+++ b/release/scripts/freestyle/styles/qi1.py
@@ -28,12 +28,12 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
SamplingShader(5.0),
ConstantThicknessShader(3),
ConstantColorShader(0.5, 0.5, 0.5, 1)
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/qi2.py b/release/scripts/freestyle/styles/qi2.py
index 937b5db590a..f2508241cad 100644
--- a/release/scripts/freestyle/styles/qi2.py
+++ b/release/scripts/freestyle/styles/qi2.py
@@ -28,12 +28,12 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
SamplingShader(10),
ConstantThicknessShader(1.5),
ConstantColorShader(0.7, 0.7, 0.7, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/sequentialsplit_sketchy.py b/release/scripts/freestyle/styles/sequentialsplit_sketchy.py
index 5755fd3b845..a128787b839 100644
--- a/release/scripts/freestyle/styles/sequentialsplit_sketchy.py
+++ b/release/scripts/freestyle/styles/sequentialsplit_sketchy.py
@@ -30,19 +30,19 @@ from freestyle.predicates import (
TrueUP1D,
pyBackTVertexUP0D,
pyVertexNatureUP0D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
SpatialNoiseShader,
- )
+)
from freestyle.types import Nature, Operators
upred = QuantitativeInvisibilityUP1D(0)
Operators.select(upred)
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
-## starting and stopping predicates:
+# starting and stopping predicates:
start = pyVertexNatureUP0D(Nature.NON_T_VERTEX)
stop = pyBackTVertexUP0D()
Operators.sequential_split(start, stop, 10)
@@ -50,5 +50,5 @@ shaders_list = [
SpatialNoiseShader(7, 120, 2, True, True),
IncreasingThicknessShader(5, 8),
ConstantColorShader(0.2, 0.2, 0.2, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py b/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py
index 8302ec8e4c3..c3bf7b12bcb 100644
--- a/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py
+++ b/release/scripts/freestyle/styles/sketchy_multiple_parameterization.py
@@ -27,7 +27,7 @@ from freestyle.chainingiterators import pySketchyChainSilhouetteIterator
from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
@@ -35,7 +35,7 @@ from freestyle.shaders import (
SmoothingShader,
SpatialNoiseShader,
pyHLRShader,
- )
+)
from freestyle.types import Operators
@@ -48,5 +48,5 @@ shaders_list = [
SmoothingShader(100, 0.05, 0, 0.2, 0, 0, 0, 1),
IncreasingColorShader(0, 0.2, 0, 1, 0.2, 0.7, 0.2, 1),
pyHLRShader(),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/sketchy_topology_broken.py b/release/scripts/freestyle/styles/sketchy_topology_broken.py
index 191d2d8bcbe..d0b66ff1f51 100644
--- a/release/scripts/freestyle/styles/sketchy_topology_broken.py
+++ b/release/scripts/freestyle/styles/sketchy_topology_broken.py
@@ -27,7 +27,7 @@ from freestyle.chainingiterators import pySketchyChainingIterator
from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
IncreasingColorShader,
IncreasingThicknessShader,
@@ -35,13 +35,13 @@ from freestyle.shaders import (
SmoothingShader,
SpatialNoiseShader,
pyBackboneStretcherNoCuspShader,
- )
+)
from freestyle.types import Operators
Operators.select(QuantitativeInvisibilityUP1D(0))
-## Chain 3 times each ViewEdge independently from the
-## initial objects topology
+# Chain 3 times each ViewEdge independently from the
+# initial objects topology
Operators.bidirectional_chain(pySketchyChainingIterator(3))
shaders_list = [
SamplingShader(4),
@@ -50,5 +50,5 @@ shaders_list = [
SmoothingShader(100, 0.1, 0, 0.2, 0, 0, 0, 1),
pyBackboneStretcherNoCuspShader(20),
IncreasingColorShader(0.2, 0.2, 0.2, 1, 0.5, 0.5, 0.5, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/sketchy_topology_preserved.py b/release/scripts/freestyle/styles/sketchy_topology_preserved.py
index 26c7fd37964..3f5f6acc9a8 100644
--- a/release/scripts/freestyle/styles/sketchy_topology_preserved.py
+++ b/release/scripts/freestyle/styles/sketchy_topology_preserved.py
@@ -27,14 +27,14 @@ from freestyle.chainingiterators import pySketchyChainSilhouetteIterator
from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
SamplingShader,
SmoothingShader,
SpatialNoiseShader,
- )
+)
from freestyle.types import Operators
@@ -47,5 +47,5 @@ shaders_list = [
IncreasingThicknessShader(4, 8),
SmoothingShader(300, 0.05, 0, 0.2, 0, 0, 0, 0.5),
ConstantColorShader(0.6, 0.2, 0.0),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/split_at_tvertices.py b/release/scripts/freestyle/styles/split_at_tvertices.py
index 8978b98f56b..84a51eb936b 100644
--- a/release/scripts/freestyle/styles/split_at_tvertices.py
+++ b/release/scripts/freestyle/styles/split_at_tvertices.py
@@ -27,22 +27,22 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyVertexNatureUP0D,
- )
+)
from freestyle.shaders import (
ConstantThicknessShader,
IncreasingColorShader,
- )
+)
from freestyle.types import Nature, Operators
Operators.select(QuantitativeInvisibilityUP1D(0))
Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(QuantitativeInvisibilityUP1D(0)))
start = pyVertexNatureUP0D(Nature.T_VERTEX)
-## use the same predicate to decide where to start and where to stop
-## the strokes:
+# use the same predicate to decide where to start and where to stop
+# the strokes:
Operators.sequential_split(start, start, 10)
shaders_list = [
ConstantThicknessShader(5),
IncreasingColorShader(1, 0, 0, 1, 0, 1, 0, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/suggestive.py b/release/scripts/freestyle/styles/suggestive.py
index 8a97cc0139b..b7cf5b8bc88 100644
--- a/release/scripts/freestyle/styles/suggestive.py
+++ b/release/scripts/freestyle/styles/suggestive.py
@@ -30,11 +30,11 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
TrueUP1D,
pyNatureUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
- )
+)
from freestyle.types import Nature, Operators
@@ -44,5 +44,5 @@ Operators.bidirectional_chain(ChainSilhouetteIterator(), NotUP1D(upred))
shaders_list = [
IncreasingThicknessShader(1, 3),
ConstantColorShader(0.2, 0.2, 0.2, 1),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/thickness_fof_depth_discontinuity.py b/release/scripts/freestyle/styles/thickness_fof_depth_discontinuity.py
index 25c196d4919..03738b268d1 100644
--- a/release/scripts/freestyle/styles/thickness_fof_depth_discontinuity.py
+++ b/release/scripts/freestyle/styles/thickness_fof_depth_discontinuity.py
@@ -26,13 +26,13 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
pyDepthDiscontinuityThicknessShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
ConstantThicknessShader(3),
ConstantColorShader(0.0, 0.0, 0.0),
pyDepthDiscontinuityThicknessShader(0.8, 6),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/tipremover.py b/release/scripts/freestyle/styles/tipremover.py
index bb070b11464..e5cea57845b 100644
--- a/release/scripts/freestyle/styles/tipremover.py
+++ b/release/scripts/freestyle/styles/tipremover.py
@@ -26,13 +26,13 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
TipRemoverShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
ConstantThicknessShader(3),
ConstantColorShader(0, 0, 0),
TipRemoverShader(20),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/tvertex_remover.py b/release/scripts/freestyle/styles/tvertex_remover.py
index d05e4dfc375..0756e7bab5f 100644
--- a/release/scripts/freestyle/styles/tvertex_remover.py
+++ b/release/scripts/freestyle/styles/tvertex_remover.py
@@ -26,13 +26,13 @@ from freestyle.predicates import (
NotUP1D,
QuantitativeInvisibilityUP1D,
TrueUP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
IncreasingThicknessShader,
SamplingShader,
pyTVertexRemoverShader,
- )
+)
from freestyle.types import Operators
@@ -43,5 +43,5 @@ shaders_list = [
ConstantColorShader(0.2, 0.2, 0.2, 1),
SamplingShader(10.0),
pyTVertexRemoverShader(),
- ]
+]
Operators.create(TrueUP1D(), shaders_list)
diff --git a/release/scripts/freestyle/styles/uniformpruning_zsort.py b/release/scripts/freestyle/styles/uniformpruning_zsort.py
index 64e808d9f8a..3ce2743c576 100644
--- a/release/scripts/freestyle/styles/uniformpruning_zsort.py
+++ b/release/scripts/freestyle/styles/uniformpruning_zsort.py
@@ -25,12 +25,12 @@ from freestyle.predicates import (
QuantitativeInvisibilityUP1D,
pyDensityUP1D,
pyZBP1D,
- )
+)
from freestyle.shaders import (
ConstantColorShader,
ConstantThicknessShader,
SamplingShader,
- )
+)
from freestyle.types import IntegrationType, Operators, Stroke
@@ -42,5 +42,5 @@ shaders_list = [
ConstantThicknessShader(3),
SamplingShader(5.0),
ConstantColorShader(0, 0, 0, 1),
- ]
+]
Operators.create(pyDensityUP1D(2, 0.05, IntegrationType.MEAN, 4), shaders_list)
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:
diff --git a/release/scripts/startup/bl_operators/gpencil_mesh_bake.py b/release/scripts/startup/bl_operators/gpencil_mesh_bake.py
index ec7ff970537..d4b1b11ed69 100644
--- a/release/scripts/startup/bl_operators/gpencil_mesh_bake.py
+++ b/release/scripts/startup/bl_operators/gpencil_mesh_bake.py
@@ -103,7 +103,7 @@ class GPENCIL_OT_mesh_bake(Operator):
name="Target Object",
description="Grease Pencil Object",
items=my_objlist_callback
- )
+ )
frame_target: IntProperty(
name="Target Frame",
description="Destination frame for the baked animation",
diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 5b9764eabfb..62d522fabd7 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -447,10 +447,10 @@ class QuickLiquid(Operator):
bl_options = {'REGISTER', 'UNDO'}
show_flows: BoolProperty(
- name="Render Liquid Objects",
- description="Keep the liquid objects visible during rendering",
- default=False,
- )
+ name="Render Liquid Objects",
+ description="Keep the liquid objects visible during rendering",
+ default=False,
+ )
def execute(self, context):
if not bpy.app.build_options.fluid:
@@ -625,6 +625,7 @@ class QuickParticles(Operator):
pointcloud_object.show_bounds = True
return {'FINISHED'}
+
classes = (
QuickExplode,
QuickFur,
diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py
index 989cacd8765..ca8999e9588 100644
--- a/release/scripts/startup/bl_operators/presets.py
+++ b/release/scripts/startup/bl_operators/presets.py
@@ -388,12 +388,12 @@ class AddPresetFluid(AddPresetBase, Operator):
preset_defines = [
"fluid = bpy.context.fluid"
- ]
+ ]
preset_values = [
"fluid.domain_settings.viscosity_base",
"fluid.domain_settings.viscosity_exponent",
- ]
+ ]
preset_subdir = "fluid"
diff --git a/release/scripts/startup/bl_operators/uvcalc_lightmap.py b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
index a4984359c90..e4edcbb62b3 100644
--- a/release/scripts/startup/bl_operators/uvcalc_lightmap.py
+++ b/release/scripts/startup/bl_operators/uvcalc_lightmap.py
@@ -559,7 +559,7 @@ def lightmap_uvpack(
def unwrap(operator, context, **kwargs):
- # switch to object mode
+ # switch to object mode
is_editmode = context.object and context.object.mode == 'EDIT'
if is_editmode:
bpy.ops.object.mode_set(mode='OBJECT', toggle=False)
diff --git a/release/scripts/startup/bl_operators/vertexpaint_dirt.py b/release/scripts/startup/bl_operators/vertexpaint_dirt.py
index 62ef3cb34b5..3f43571fee5 100644
--- a/release/scripts/startup/bl_operators/vertexpaint_dirt.py
+++ b/release/scripts/startup/bl_operators/vertexpaint_dirt.py
@@ -74,7 +74,7 @@ def applyVertexDirt(me, blur_iterations, blur_strength, clamp_dirt, clamp_clean,
tot_con = len(con[i])
if tot_con == 0:
- ang = pi / 2.0 # assume 90°, i. e. flat
+ ang = pi / 2.0 # assume 90°, i. e. flat
else:
vec /= tot_con
diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py
index 4a7a54bac28..968dc8e5dba 100644
--- a/release/scripts/startup/bl_operators/view3d.py
+++ b/release/scripts/startup/bl_operators/view3d.py
@@ -73,10 +73,10 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator):
bl_idname = "view3d.edit_mesh_extrude_move_normal"
dissolve_and_intersect: BoolProperty(
- name="dissolve_and_intersect",
- default=False,
- description="Dissolves adjacent faces and intersects new geometry"
- )
+ name="dissolve_and_intersect",
+ default=False,
+ description="Dissolves adjacent faces and intersects new geometry"
+ )
@classmethod
def poll(cls, context):
diff --git a/release/scripts/startup/bl_ui/properties_data_hair.py b/release/scripts/startup/bl_ui/properties_data_hair.py
index 58491f16c6e..2f52372eaed 100644
--- a/release/scripts/startup/bl_ui/properties_data_hair.py
+++ b/release/scripts/startup/bl_ui/properties_data_hair.py
@@ -56,7 +56,7 @@ class HAIR_MT_add_attribute(Menu):
@staticmethod
def add_standard_attribute(layout, hair, name, data_type, domain):
- exists = hair.attributes.get(name) != None
+ exists = hair.attributes.get(name) is not None
col = layout.column()
col.enabled = not exists
@@ -106,14 +106,21 @@ class DATA_PT_hair_attributes(DataButtonsPanel, Panel):
row = layout.row()
col = row.column()
- col.template_list("HAIR_UL_attributes", "attributes", hair, "attributes", hair.attributes, "active_index", rows=3)
+ col.template_list(
+ "HAIR_UL_attributes",
+ "attributes",
+ hair,
+ "attributes",
+ hair.attributes,
+ "active_index",
+ rows=3,
+ )
col = row.column(align=True)
col.menu("HAIR_MT_add_attribute", icon='ADD', text="")
col.operator("geometry.attribute_remove", icon='REMOVE', text="")
-
class DATA_PT_custom_props_hair(DataButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
_context_path = "object.data"
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 64bc694d5ca..ee41cfc28a5 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -478,7 +478,15 @@ class DATA_PT_sculpt_vertex_colors(MeshButtonsPanel, Panel):
row = layout.row()
col = row.column()
- col.template_list("MESH_UL_vcols", "svcols", me, "sculpt_vertex_colors", me.sculpt_vertex_colors, "active_index", rows=2)
+ col.template_list(
+ "MESH_UL_vcols",
+ "svcols",
+ me,
+ "sculpt_vertex_colors",
+ me.sculpt_vertex_colors,
+ "active_index",
+ rows=2,
+ )
col = row.column(align=True)
col.operator("mesh.sculpt_vertex_color_add", icon='ADD', text="")
diff --git a/release/scripts/startup/bl_ui/properties_data_pointcloud.py b/release/scripts/startup/bl_ui/properties_data_pointcloud.py
index d7ff7389fc3..f2464fb9765 100644
--- a/release/scripts/startup/bl_ui/properties_data_pointcloud.py
+++ b/release/scripts/startup/bl_ui/properties_data_pointcloud.py
@@ -56,7 +56,7 @@ class POINTCLOUD_MT_add_attribute(Menu):
@staticmethod
def add_standard_attribute(layout, pointcloud, name, data_type, domain):
- exists = pointcloud.attributes.get(name) != None
+ exists = pointcloud.attributes.get(name) is not None
col = layout.column()
col.enabled = not exists
@@ -105,14 +105,21 @@ class DATA_PT_pointcloud_attributes(DataButtonsPanel, Panel):
row = layout.row()
col = row.column()
- col.template_list("POINTCLOUD_UL_attributes", "attributes", pointcloud, "attributes", pointcloud.attributes, "active_index", rows=3)
+ col.template_list(
+ "POINTCLOUD_UL_attributes",
+ "attributes",
+ pointcloud,
+ "attributes",
+ pointcloud.attributes,
+ "active_index",
+ rows=3,
+ )
col = row.column(align=True)
col.menu("POINTCLOUD_MT_add_attribute", icon='ADD', text="")
col.operator("geometry.attribute_remove", icon='REMOVE', text="")
-
class DATA_PT_custom_props_pointcloud(DataButtonsPanel, PropertyPanel, Panel):
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
_context_path = "object.data"
diff --git a/release/scripts/startup/bl_ui/properties_data_volume.py b/release/scripts/startup/bl_ui/properties_data_volume.py
index 6032d0ab859..af2c94ad423 100644
--- a/release/scripts/startup/bl_ui/properties_data_volume.py
+++ b/release/scripts/startup/bl_ui/properties_data_volume.py
@@ -77,10 +77,10 @@ class DATA_PT_volume_file(DataButtonsPanel, Panel):
error_msg = volume.grids.error_message
if len(error_msg):
- layout.separator()
- col = layout.column(align=True)
- col.label(text="Failed to load volume:")
- col.label(text=error_msg)
+ layout.separator()
+ col = layout.column(align=True)
+ col.label(text="Failed to load volume:")
+ col.label(text=error_msg)
class VOLUME_UL_grids(UIList):
diff --git a/release/scripts/startup/bl_ui/properties_freestyle.py b/release/scripts/startup/bl_ui/properties_freestyle.py
index 54b1ca3d910..3a2b26aaebb 100644
--- a/release/scripts/startup/bl_ui/properties_freestyle.py
+++ b/release/scripts/startup/bl_ui/properties_freestyle.py
@@ -33,7 +33,7 @@ class RenderFreestyleButtonsPanel:
def poll(cls, context):
scene = context.scene
with_freestyle = bpy.app.build_options.freestyle
- return scene and with_freestyle and(context.engine in cls.COMPAT_ENGINES)
+ return scene and with_freestyle and (context.engine in cls.COMPAT_ENGINES)
class RENDER_PT_freestyle(RenderFreestyleButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
index f16528103ff..4107768a1c4 100644
--- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
+++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py
@@ -293,12 +293,12 @@ class GPENCIL_MT_snap_pie(Menu):
"gpencil.snap_to_cursor",
text="Selection to Cursor",
icon='RESTRICT_SELECT_OFF'
- ).use_offset = False
+ ).use_offset = False
pie.operator(
"gpencil.snap_to_cursor",
text="Selection to Cursor (Keep Offset)",
icon='RESTRICT_SELECT_OFF'
- ).use_offset = True
+ ).use_offset = True
pie.separator()
pie.operator("view3d.snap_cursor_to_center", text="Cursor to World Origin", icon='CURSOR')
pie.separator()
@@ -814,7 +814,7 @@ class GPENCIL_MT_layer_mask_menu(Menu):
for gpl in gpd.layers:
if gpl != gpl_active and gpl.info not in gpl_active.mask_layers:
done = True
- layout.operator("gpencil.layer_mask_add", text=gpl.info).name=gpl.info
+ layout.operator("gpencil.layer_mask_add", text=gpl.info).name = gpl.info
if done is False:
layout.label(text="No layers to add")
@@ -841,7 +841,7 @@ class GreasePencilLayerMasksPanel:
row = layout.row()
col = row.column()
col.template_list("GPENCIL_UL_masks", "", gpl, "mask_layers", gpl.mask_layers,
- "active_mask_index", rows=rows, sort_lock=True)
+ "active_mask_index", rows=rows, sort_lock=True)
col2 = row.column(align=True)
col2.menu("GPENCIL_MT_layer_mask_menu", icon='ADD', text="")
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 9f84751e835..e18651d8e8a 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -549,8 +549,8 @@ def brush_settings(layout, context, brush, popover=False):
row = layout.row(align=True)
row.prop(brush, "hardness", slider=True)
- row.prop(brush, "invert_hardness_pressure", text = "")
- row.prop(brush, "use_hardness_pressure", text = "")
+ row.prop(brush, "invert_hardness_pressure", text="")
+ row.prop(brush, "use_hardness_pressure", text="")
# auto_smooth_factor and use_inverse_smooth_pressure
if capabilities.has_auto_smooth:
@@ -648,9 +648,9 @@ def brush_settings(layout, context, brush, popover=False):
layout.prop(brush, "pose_offset")
layout.prop(brush, "pose_smooth_iterations")
if brush.pose_deform_type == 'ROTATE_TWIST' and brush.pose_origin_type in {'TOPOLOGY', 'FACE_SETS'}:
- layout.prop(brush, "pose_ik_segments")
+ layout.prop(brush, "pose_ik_segments")
if brush.pose_deform_type == 'SCALE_TRANSLATE':
- layout.prop(brush, "use_pose_lock_rotation")
+ layout.prop(brush, "use_pose_lock_rotation")
layout.prop(brush, "use_pose_ik_anchored")
layout.prop(brush, "use_connected_only")
layout.prop(brush, "disconnected_distance_max")
@@ -698,23 +698,23 @@ def brush_settings(layout, context, brush, popover=False):
elif sculpt_tool == 'PAINT':
row = layout.row(align=True)
row.prop(brush, "flow")
- row.prop(brush, "invert_flow_pressure", text = "")
- row.prop(brush, "use_flow_pressure", text= "")
+ row.prop(brush, "invert_flow_pressure", text="")
+ row.prop(brush, "use_flow_pressure", text="")
row = layout.row(align=True)
row.prop(brush, "wet_mix")
- row.prop(brush, "invert_wet_mix_pressure", text = "")
- row.prop(brush, "use_wet_mix_pressure", text = "")
+ row.prop(brush, "invert_wet_mix_pressure", text="")
+ row.prop(brush, "use_wet_mix_pressure", text="")
row = layout.row(align=True)
row.prop(brush, "wet_persistence")
- row.prop(brush, "invert_wet_persistence_pressure", text ="")
- row.prop(brush, "use_wet_persistence_pressure", text= "")
+ row.prop(brush, "invert_wet_persistence_pressure", text="")
+ row.prop(brush, "use_wet_persistence_pressure", text="")
row = layout.row(align=True)
row.prop(brush, "density")
- row.prop(brush, "invert_density_pressure", text = "")
- row.prop(brush, "use_density_pressure", text = "")
+ row.prop(brush, "invert_density_pressure", text="")
+ row.prop(brush, "use_density_pressure", text="")
row = layout.row()
row.prop(brush, "tip_roundness")
@@ -1218,7 +1218,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
if gp_settings.use_pressure and context.area.type == 'PROPERTIES':
col = layout.column()
col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
row = layout.row(align=True)
row.prop(gp_settings, "pen_strength", slider=True)
@@ -1227,7 +1227,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False)
if gp_settings.use_strength_pressure and context.area.type == 'PROPERTIES':
col = layout.column()
col.template_curve_mapping(gp_settings, "curve_strength", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
if brush.gpencil_tool == 'TINT':
row = layout.row(align=True)
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index 888eb40e27e..cdbd7f75193 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -1232,7 +1232,10 @@ class PHYSICS_PT_export(PhysicButtonsPanel, Panel):
@classmethod
def poll(cls, context):
domain = context.fluid.domain_settings
- if not PhysicButtonsPanel.poll_fluid_domain(context) or (domain.cache_data_format != 'OPENVDB' and bpy.app.debug_value != 3001):
+ if (
+ not PhysicButtonsPanel.poll_fluid_domain(context) or
+ (domain.cache_data_format != 'OPENVDB' and bpy.app.debug_value != 3001)
+ ):
return False
return (context.engine in cls.COMPAT_ENGINES)
diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index 23734601570..a9bb2e79762 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -43,7 +43,7 @@ class FILEBROWSER_HT_header(Header):
class FILEBROWSER_PT_display(Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'HEADER'
- bl_label = "Display Settings" # Shows as tooltip in popover
+ bl_label = "Display Settings" # Shows as tooltip in popover
bl_ui_units_x = 10
@classmethod
@@ -76,7 +76,7 @@ class FILEBROWSER_PT_display(Panel):
class FILEBROWSER_PT_filter(Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'HEADER'
- bl_label = "Filter Settings" # Shows as tooltip in popover
+ bl_label = "Filter Settings" # Shows as tooltip in popover
bl_ui_units_x = 8
@classmethod
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 2519b5a2f40..300f367ab27 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -1022,7 +1022,7 @@ class IMAGE_PT_view_display_uv_edit_overlays(Panel):
col = layout.column()
if context.preferences.experimental.use_image_editor_legacy_drawing:
- col.prop(uvedit, "show_smooth_edges", text="Smooth")
+ col.prop(uvedit, "show_smooth_edges", text="Smooth")
col.prop(uvedit, "show_modified_edges", text="Modified")
col.prop(uvedit, "uv_opacity")
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index 4f518d8e2d4..9e588acd50f 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -177,7 +177,7 @@ class TEXT_PT_find(Panel):
row = col.row(align=True)
row.operator("text.replace")
- row.operator("text.replace", text = "Replace all").all = True
+ row.operator("text.replace", text="Replace all").all = True
layout.separator()
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
index e6dcfa0a7ab..e021433bee3 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py
@@ -50,7 +50,7 @@ def generate_from_enum_ex(
attr,
cursor='DEFAULT',
tooldef_keywords={},
- exclude_filter = {}
+ exclude_filter={}
):
tool_defs = []
for enum in type.bl_rna.properties[attr].enum_items_static:
@@ -787,7 +787,6 @@ class _defs_edit_mesh:
col.prop(props, "mark_seam", text="Seam")
col.prop(props, "mark_sharp", text="Sharp")
-
col = layout.column()
col.active = edge_bevel
col.prop(props, "miter_outer", text="Miter Outer")
@@ -1215,7 +1214,7 @@ class _defs_sculpt:
icon_prefix="brush.sculpt.",
type=bpy.types.Brush,
attr="sculpt_tool",
- exclude_filter = exclude_filter,
+ exclude_filter=exclude_filter,
)
@ToolDef.from_fn
@@ -2079,10 +2078,10 @@ class _defs_gpencil_edit:
@ToolDef.from_fn
def transform_fill():
def draw_settings(context, layout, tool):
- props = tool.operator_properties("gpencil.transform_fill")
- row = layout.row()
- row.use_property_split = False
- row.prop(props, "mode", expand=True)
+ props = tool.operator_properties("gpencil.transform_fill")
+ row = layout.row()
+ row.use_property_split = False
+ row.prop(props, "mode", expand=True)
return dict(
idname="builtin.transform_fill",
@@ -2094,6 +2093,7 @@ class _defs_gpencil_edit:
draw_settings=draw_settings,
)
+
class _defs_gpencil_sculpt:
@staticmethod
@@ -2291,6 +2291,7 @@ class _defs_sequencer_select:
widget=None,
keymap="Sequencer Tool: Select",
)
+
@ToolDef.from_fn
def box():
def draw_settings(_context, layout, tool):
@@ -2858,6 +2859,8 @@ class VIEW3D_PT_tools_active(ToolSelectPanelHelper, Panel):
),
],
}
+
+
class SEQUENCER_PT_tools_active(ToolSelectPanelHelper, Panel):
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'TOOLS'
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 4f814802705..c6fad77352c 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -276,9 +276,8 @@ class _draw_tool_settings_context_mode:
layout.row().prop(brush, "direction", expand=True, text="")
if capabilities.has_color:
- UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text = "")
- layout.prop(brush, "blend", text="", expand = False)
-
+ UnifiedPaintPanel.prop_unified_color(layout, context, brush, "color", text="")
+ layout.prop(brush, "blend", text="", expand=False)
return True
@@ -1135,7 +1134,7 @@ class VIEW3D_MT_view(Menu):
props = layout.operator("render.opengl",
text="Viewport Render Keyframes",
icon='RENDER_ANIMATION',
- )
+ )
props.animation = True
props.render_keyed_only = True
@@ -3132,6 +3131,7 @@ class VIEW3D_MT_sculpt_set_pivot(Menu):
props = layout.operator("sculpt.set_pivot_position", text="Pivot to Surface Under Cursor")
props.mode = 'SURFACE'
+
class VIEW3D_MT_face_sets_init(Menu):
bl_label = "Face Sets Init"
@@ -5383,7 +5383,6 @@ class VIEW3D_PT_view3d_properties(Panel):
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
-
col = layout.column()
subcol = col.column()
@@ -6592,7 +6591,7 @@ class VIEW3D_PT_proportional_edit(Panel):
tool_settings = context.tool_settings
col = layout.column()
col.active = (tool_settings.use_proportional_edit_objects if context.mode == 'OBJECT'
- else tool_settings.use_proportional_edit)
+ else tool_settings.use_proportional_edit)
if context.mode != 'OBJECT':
col.prop(tool_settings, "use_proportional_connected")
@@ -6772,7 +6771,7 @@ class VIEW3D_PT_overlay_gpencil_options(Panel):
col = split.column()
col.prop(overlay, "use_gpencil_show_directions")
col = split.column()
- col.prop(overlay, "use_gpencil_show_material_name", text="Material Name")
+ col.prop(overlay, "use_gpencil_show_material_name", text="Material Name")
layout.prop(overlay, "vertex_opacity", text="Vertex Opacity", slider=True)
@@ -7059,26 +7058,26 @@ class VIEW3D_MT_gpencil_edit_context_menu(Menu):
def draw_gpencil_layer_active(context, layout):
- gpl = context.active_gpencil_layer
- if gpl:
- layout.label(text="Active Layer")
- row = layout.row(align=True)
- row.operator_context = 'EXEC_REGION_WIN'
- row.operator_menu_enum("gpencil.layer_change", "layer", text="", icon='GREASEPENCIL')
- row.prop(gpl, "info", text="")
- row.operator("gpencil.layer_remove", text="", icon='X')
+ gpl = context.active_gpencil_layer
+ if gpl:
+ layout.label(text="Active Layer")
+ row = layout.row(align=True)
+ row.operator_context = 'EXEC_REGION_WIN'
+ row.operator_menu_enum("gpencil.layer_change", "layer", text="", icon='GREASEPENCIL')
+ row.prop(gpl, "info", text="")
+ row.operator("gpencil.layer_remove", text="", icon='X')
def draw_gpencil_material_active(context, layout):
- ob = context.active_object
- if ob and len(ob.material_slots) > 0 and ob.active_material_index >= 0:
- ma = ob.material_slots[ob.active_material_index].material
- if ma:
- layout.label(text="Active Material")
- row = layout.row(align=True)
- row.operator_context = 'EXEC_REGION_WIN'
- row.operator_menu_enum("gpencil.material_set", "slot", text="", icon='MATERIAL')
- row.prop(ma, "name", text="")
+ ob = context.active_object
+ if ob and len(ob.material_slots) > 0 and ob.active_material_index >= 0:
+ ma = ob.material_slots[ob.active_material_index].material
+ if ma:
+ layout.label(text="Active Material")
+ row = layout.row(align=True)
+ row.operator_context = 'EXEC_REGION_WIN'
+ row.operator_menu_enum("gpencil.material_set", "slot", text="", icon='MATERIAL')
+ row.prop(ma, "name", text="")
class VIEW3D_PT_gpencil_sculpt_context_menu(Panel):
@@ -7396,6 +7395,7 @@ class TOPBAR_PT_gpencil_vertexcolor(GreasePencilVertexcolorPanel, Panel):
ob = context.object
return ob and ob.type == 'GPENCIL'
+
classes = (
VIEW3D_HT_header,
VIEW3D_HT_tool_header,
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 5f668bbc881..e9118a8be91 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1599,7 +1599,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
row.prop(gp_settings, "use_random_press_radius", text="", icon='STYLUS_PRESSURE')
if gp_settings.use_random_press_radius and self.is_popover is False:
col.template_curve_mapping(gp_settings, "curve_random_pressure", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
row = col.row(align=True)
row.prop(gp_settings, "random_strength", text="Strength", slider=True)
@@ -1607,7 +1607,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
row.prop(gp_settings, "use_random_press_strength", text="", icon='STYLUS_PRESSURE')
if gp_settings.use_random_press_strength and self.is_popover is False:
col.template_curve_mapping(gp_settings, "curve_random_strength", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
row = col.row(align=True)
row.prop(gp_settings, "uv_random", text="UV", slider=True)
@@ -1615,7 +1615,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
row.prop(gp_settings, "use_random_press_uv", text="", icon='STYLUS_PRESSURE')
if gp_settings.use_random_press_uv and self.is_popover is False:
col.template_curve_mapping(gp_settings, "curve_random_uv", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
col.separator()
@@ -1627,7 +1627,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
row.prop(gp_settings, "use_random_press_hue", text="", icon='STYLUS_PRESSURE')
if gp_settings.use_random_press_hue and self.is_popover is False:
col1.template_curve_mapping(gp_settings, "curve_random_hue", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
row = col1.row(align=True)
row.prop(gp_settings, "random_saturation_factor", slider=True)
@@ -1635,7 +1635,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
row.prop(gp_settings, "use_random_press_sat", text="", icon='STYLUS_PRESSURE')
if gp_settings.use_random_press_sat and self.is_popover is False:
col1.template_curve_mapping(gp_settings, "curve_random_saturation", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
row = col1.row(align=True)
row.prop(gp_settings, "random_value_factor", slider=True)
@@ -1643,7 +1643,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
row.prop(gp_settings, "use_random_press_val", text="", icon='STYLUS_PRESSURE')
if gp_settings.use_random_press_val and self.is_popover is False:
col1.template_curve_mapping(gp_settings, "curve_random_value", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
col.separator()
@@ -1652,7 +1652,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
row.prop(gp_settings, "use_jitter_pressure", text="", icon='STYLUS_PRESSURE')
if gp_settings.use_jitter_pressure and self.is_popover is False:
col.template_curve_mapping(gp_settings, "curve_jitter", brush=True,
- use_negative_slope=True)
+ use_negative_slope=True)
class VIEW3D_PT_tools_grease_pencil_brush_paint_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):
diff --git a/release/windows/msix/create_msix_package.py b/release/windows/msix/create_msix_package.py
index 88b80291ebe..dda09a10d4b 100644
--- a/release/windows/msix/create_msix_package.py
+++ b/release/windows/msix/create_msix_package.py
@@ -9,18 +9,64 @@ import subprocess
import zipfile
parser = argparse.ArgumentParser()
-parser.add_argument("--version", required=True, help="Version string in the form of 2.83.3.0")
-parser.add_argument("--url", required=True, help="Location of the release ZIP archive to download")
-parser.add_argument("--publisher", required=True, help="A string in the form of 'CN=PUBLISHER'")
-parser.add_argument("--pfx", required=False, help="Absolute path to the PFX file used for signing the resulting MSIX package")
-parser.add_argument("--password", required=False, default="blender", help="Password for the PFX file")
-parser.add_argument("--lts", required=False, help="If set this MSIX is for an LTS release", action='store_const', const=1)
-parser.add_argument("--skipdl", required=False, help="If set skip downloading of the specified URL as blender.zip. The tool assumes blender.zip exists", action='store_const', const=1)
-parser.add_argument("--leavezip", required=False, help="If set don't clean up the downloaded blender.zip", action='store_const', const=1)
-parser.add_argument("--overwrite", required=False, help="If set remove Content folder if it already exists", action='store_const', const=1)
+parser.add_argument(
+ "--version",
+ required=True,
+ help="Version string in the form of 2.83.3.0",
+)
+parser.add_argument(
+ "--url",
+ required=True,
+ help="Location of the release ZIP archive to download",
+)
+parser.add_argument(
+ "--publisher",
+ required=True,
+ help="A string in the form of 'CN=PUBLISHER'",
+)
+parser.add_argument(
+ "--pfx",
+ required=False,
+ help="Absolute path to the PFX file used for signing the resulting MSIX package",
+)
+parser.add_argument(
+ "--password",
+ required=False,
+ default="blender",
+ help="Password for the PFX file",
+)
+parser.add_argument(
+ "--lts",
+ required=False,
+ help="If set this MSIX is for an LTS release",
+ action='store_const',
+ const=1,
+)
+parser.add_argument(
+ "--skipdl",
+ required=False,
+ help="If set skip downloading of the specified URL as blender.zip. The tool assumes blender.zip exists",
+ action='store_const',
+ const=1,
+)
+parser.add_argument(
+ "--leavezip",
+ required=False,
+ help="If set don't clean up the downloaded blender.zip",
+ action='store_const',
+ const=1,
+)
+parser.add_argument(
+ "--overwrite",
+ required=False,
+ help="If set remove Content folder if it already exists",
+ action='store_const',
+ const=1,
+)
args = parser.parse_args()
-def execute_command(cmd : list, name : str, errcode : int):
+
+def execute_command(cmd: list, name: str, errcode: int):
"""
Execute given command in cmd. Output is captured. If an error
occurs name is used to print ERROR message, along with stderr and
@@ -29,8 +75,10 @@ def execute_command(cmd : list, name : str, errcode : int):
cmd_process = subprocess.run(cmd, capture_output=True, encoding="UTF-8")
if cmd_process.returncode != 0:
print(f"ERROR: {name} failed.")
- if cmd_process.stdout: print(cmd_process.stdout)
- if cmd_process.stderr: print(cmd_process.stderr)
+ if cmd_process.stdout:
+ print(cmd_process.stdout)
+ if cmd_process.stderr:
+ print(cmd_process.stderr)
exit(errcode)
@@ -106,7 +154,8 @@ print(f"Extracting files from ZIP to {content_blender_folder}...")
# ./Content/Blender/blender-2.83.3-windows64/blender.exe
with zipfile.ZipFile(local_blender_zip, "r") as blender_zip:
for entry in blender_zip.infolist():
- if entry.is_dir(): continue
+ if entry.is_dir():
+ continue
entry_location = pathlib.Path(entry.filename)
target_location = content_blender_folder.joinpath(*entry_location.parts[1:])
pathlib.Path(target_location.parent).mkdir(parents=True, exist_ok=True)
diff --git a/source/blender/datatoc/datatoc_icon.py b/source/blender/datatoc/datatoc_icon.py
index 6d8b24924f1..875e5359079 100755
--- a/source/blender/datatoc/datatoc_icon.py
+++ b/source/blender/datatoc/datatoc_icon.py
@@ -26,7 +26,10 @@ def write_png(buf, width, height):
import struct
# reverse the vertical line order and add null bytes at the start
width_byte_4 = width * 4
- raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range((height - 1) * width * 4, -1, - width_byte_4))
+ raw_data = b"".join(
+ b'\x00' + buf[span:span + width_byte_4]
+ for span in range((height - 1) * width * 4, -1, - width_byte_4)
+ )
def png_pack(png_tag, data):
chunk_head = png_tag + data
diff --git a/source/blender/datatoc/datatoc_icon_split_to_png.py b/source/blender/datatoc/datatoc_icon_split_to_png.py
index b583b10b9ff..f8ddcdd216f 100755
--- a/source/blender/datatoc/datatoc_icon_split_to_png.py
+++ b/source/blender/datatoc/datatoc_icon_split_to_png.py
@@ -26,7 +26,10 @@ def write_png(buf, width, height):
import struct
# reverse the vertical line order and add null bytes at the start
width_byte_4 = width * 4
- raw_data = b"".join(b'\x00' + buf[span:span + width_byte_4] for span in range((height - 1) * width * 4, -1, - width_byte_4))
+ raw_data = b"".join(
+ b'\x00' + buf[span:span + width_byte_4]
+ for span in range((height - 1) * width * 4, -1, - width_byte_4)
+ )
def png_pack(png_tag, data):
chunk_head = png_tag + data
diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner.py b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
index f107b5aee63..eaeca562e47 100755
--- a/source/blender/makesrna/rna_cleanup/rna_cleaner.py
+++ b/source/blender/makesrna/rna_cleanup/rna_cleaner.py
@@ -277,7 +277,8 @@ def write_files(basename, props_list, props_length_max):
indent = '# '
else:
indent = ' '
- rna += indent + '("%s", "%s", "%s", "%s", "%s"),\n' % tuple(props[2:5] + props[6:]) # description is already string formatted
+ # Description is already string formatted.
+ rna += indent + '("%s", "%s", "%s", "%s", "%s"),\n' % tuple(props[2:5] + props[6:])
# py
blanks = [' ' * (x[0] - x[1]) for x in zip(props_length_max, list(map(len, props)))]
props = [('"%s"%s' if props[-1] != x[0] else "%s%s") % (x[0], x[1]) for x in zip(props, blanks)]
diff --git a/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py b/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py
index 236313f1f5c..8d1ec0b324b 100755
--- a/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py
+++ b/source/blender/makesrna/rna_cleanup/rna_cleaner_merge.py
@@ -56,7 +56,10 @@ def main():
if mod_from_dict:
file_path = sys.argv[-2][:-3] + "_lost.py"
write_work_file(file_path, list(mod_from_dict.values()))
- print("Warning '%s' contains lost %d items from module %s.py" % (file_path, len(mod_from_dict), mod_from.__name__))
+ print(
+ "Warning '%s' contains lost %d items from module %s.py" %
+ (file_path, len(mod_from_dict), mod_from.__name__)
+ )
if __name__ == "__main__":
diff --git a/tests/python/alembic_export_tests.py b/tests/python/alembic_export_tests.py
index 1d34eb3fc81..9d1738691f0 100644
--- a/tests/python/alembic_export_tests.py
+++ b/tests/python/alembic_export_tests.py
@@ -592,7 +592,10 @@ class CustomPropertiesExportTest(AbstractAlembicTest):
def _run_export(self, tempdir: pathlib.Path) -> pathlib.Path:
abc = tempdir / 'custom-properties.abc'
- script = "import bpy; bpy.context.scene.frame_set(1); bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1)" % abc.as_posix()
+ script = (
+ "import bpy; bpy.context.scene.frame_set(1); "
+ "bpy.ops.wm.alembic_export(filepath='%s', start=1, end=1)" % abc.as_posix()
+ )
self.run_blender('custom-properties.blend', script)
return abc
diff --git a/tests/python/batch_import.py b/tests/python/batch_import.py
index 20d96a69a79..7e64081cfbb 100644
--- a/tests/python/batch_import.py
+++ b/tests/python/batch_import.py
@@ -150,10 +150,20 @@ def main():
# Example background utility, add some text and renders or saves it (with options)
# Possible types are: string, int, long, choice, float and complex.
- parser.add_option("-o", "--operator", dest="operator", help="This text will be used to render an image", type="string")
+ parser.add_option(
+ "-o",
+ "--operator",
+ dest="operator",
+ help="This text will be used to render an image",
+ type="string")
parser.add_option("-p", "--path", dest="path", help="Path to use for searching for files", type='string')
parser.add_option("-m", "--match", dest="match", help="Wildcard to match filename", type="string")
- parser.add_option("-s", "--save_path", dest="save_path", help="Save the input file to a blend file in a new location", metavar='string')
+ parser.add_option(
+ "-s",
+ "--save_path",
+ dest="save_path",
+ help="Save the input file to a blend file in a new location",
+ metavar='string')
parser.add_option("-S", "--start", dest="start", help="From collected files, start with this index", metavar='int')
parser.add_option("-E", "--end", dest="end", help="From collected files, end with this index", metavar='int')
diff --git a/tests/python/bl_alembic_io_test.py b/tests/python/bl_alembic_io_test.py
index b9eca3057e7..53a0879f160 100644
--- a/tests/python/bl_alembic_io_test.py
+++ b/tests/python/bl_alembic_io_test.py
@@ -313,13 +313,13 @@ class CameraExportImportTest(unittest.TestCase):
self.loc_rot_scale('CAM_Unit_Transform', (0, 0, 0), (0, 0, 0))
self.loc_rot_scale('CAM_Look_+Y', (2, 0, 0), (90, 0, 0))
- self.loc_rot_scale('CAM_Static_Child_Left', (2-0.15, 0, 0), (90, 0, 0))
- self.loc_rot_scale('CAM_Static_Child_Right', (2+0.15, 0, 0), (90, 0, 0))
+ self.loc_rot_scale('CAM_Static_Child_Left', (2 - 0.15, 0, 0), (90, 0, 0))
+ self.loc_rot_scale('CAM_Static_Child_Right', (2 + 0.15, 0, 0), (90, 0, 0))
self.loc_rot_scale('Static_Child', (2, 0, 1), (90, 0, 0))
self.loc_rot_scale('CAM_Animated', (4, 0, 0), (90, 0, 0))
- self.loc_rot_scale('CAM_Animated_Child_Left', (4-0.15, 0, 0), (90, 0, 0))
- self.loc_rot_scale('CAM_Animated_Child_Right', (4+0.15, 0, 0), (90, 0, 0))
+ self.loc_rot_scale('CAM_Animated_Child_Left', (4 - 0.15, 0, 0), (90, 0, 0))
+ self.loc_rot_scale('CAM_Animated_Child_Right', (4 + 0.15, 0, 0), (90, 0, 0))
self.loc_rot_scale('Animated_Child', (4, 0, 1), (90, 0, 0))
bpy.context.scene.frame_set(10)
diff --git a/tests/python/bl_animation_fcurves.py b/tests/python/bl_animation_fcurves.py
index 432cfa5f3ab..b5772b8d335 100644
--- a/tests/python/bl_animation_fcurves.py
+++ b/tests/python/bl_animation_fcurves.py
@@ -39,38 +39,38 @@ class FCurveEvaluationTest(unittest.TestCase):
'Test dir %s should exist' % self.testdir)
def test_fcurve_versioning_291(self):
- # See D8752.
- bpy.ops.wm.open_mainfile(filepath=str(self.testdir / "fcurve-versioning-291.blend"))
- cube = bpy.data.objects['Cube']
- fcurve = cube.animation_data.action.fcurves.find('location', index=0)
-
- self.assertAlmostEqual(0.0, fcurve.evaluate(1))
- self.assertAlmostEqual(0.019638698548078537, fcurve.evaluate(2))
- self.assertAlmostEqual(0.0878235399723053, fcurve.evaluate(3))
- self.assertAlmostEqual(0.21927043795585632, fcurve.evaluate(4))
- self.assertAlmostEqual(0.41515052318573, fcurve.evaluate(5))
- self.assertAlmostEqual(0.6332430243492126, fcurve.evaluate(6))
- self.assertAlmostEqual(0.8106040954589844, fcurve.evaluate(7))
- self.assertAlmostEqual(0.924369215965271, fcurve.evaluate(8))
- self.assertAlmostEqual(0.9830065965652466, fcurve.evaluate(9))
- self.assertAlmostEqual(1.0, fcurve.evaluate(10))
+ # See D8752.
+ bpy.ops.wm.open_mainfile(filepath=str(self.testdir / "fcurve-versioning-291.blend"))
+ cube = bpy.data.objects['Cube']
+ fcurve = cube.animation_data.action.fcurves.find('location', index=0)
+
+ self.assertAlmostEqual(0.0, fcurve.evaluate(1))
+ self.assertAlmostEqual(0.019638698548078537, fcurve.evaluate(2))
+ self.assertAlmostEqual(0.0878235399723053, fcurve.evaluate(3))
+ self.assertAlmostEqual(0.21927043795585632, fcurve.evaluate(4))
+ self.assertAlmostEqual(0.41515052318573, fcurve.evaluate(5))
+ self.assertAlmostEqual(0.6332430243492126, fcurve.evaluate(6))
+ self.assertAlmostEqual(0.8106040954589844, fcurve.evaluate(7))
+ self.assertAlmostEqual(0.924369215965271, fcurve.evaluate(8))
+ self.assertAlmostEqual(0.9830065965652466, fcurve.evaluate(9))
+ self.assertAlmostEqual(1.0, fcurve.evaluate(10))
def test_fcurve_extreme_handles(self):
- # See D8752.
- bpy.ops.wm.open_mainfile(filepath=str(self.testdir / "fcurve-extreme-handles.blend"))
- cube = bpy.data.objects['Cube']
- fcurve = cube.animation_data.action.fcurves.find('location', index=0)
-
- self.assertAlmostEqual(0.0, fcurve.evaluate(1))
- self.assertAlmostEqual(0.004713400732725859, fcurve.evaluate(2))
- self.assertAlmostEqual(0.022335870191454887, fcurve.evaluate(3))
- self.assertAlmostEqual(0.06331237405538559, fcurve.evaluate(4))
- self.assertAlmostEqual(0.16721539199352264, fcurve.evaluate(5))
- self.assertAlmostEqual(0.8327845335006714, fcurve.evaluate(6))
- self.assertAlmostEqual(0.9366875886917114, fcurve.evaluate(7))
- self.assertAlmostEqual(0.9776642322540283, fcurve.evaluate(8))
- self.assertAlmostEqual(0.9952865839004517, fcurve.evaluate(9))
- self.assertAlmostEqual(1.0, fcurve.evaluate(10))
+ # See D8752.
+ bpy.ops.wm.open_mainfile(filepath=str(self.testdir / "fcurve-extreme-handles.blend"))
+ cube = bpy.data.objects['Cube']
+ fcurve = cube.animation_data.action.fcurves.find('location', index=0)
+
+ self.assertAlmostEqual(0.0, fcurve.evaluate(1))
+ self.assertAlmostEqual(0.004713400732725859, fcurve.evaluate(2))
+ self.assertAlmostEqual(0.022335870191454887, fcurve.evaluate(3))
+ self.assertAlmostEqual(0.06331237405538559, fcurve.evaluate(4))
+ self.assertAlmostEqual(0.16721539199352264, fcurve.evaluate(5))
+ self.assertAlmostEqual(0.8327845335006714, fcurve.evaluate(6))
+ self.assertAlmostEqual(0.9366875886917114, fcurve.evaluate(7))
+ self.assertAlmostEqual(0.9776642322540283, fcurve.evaluate(8))
+ self.assertAlmostEqual(0.9952865839004517, fcurve.evaluate(9))
+ self.assertAlmostEqual(1.0, fcurve.evaluate(10))
def main():
diff --git a/tests/python/bl_blendfile_io.py b/tests/python/bl_blendfile_io.py
index 35b089f9bb2..49814ea5902 100644
--- a/tests/python/bl_blendfile_io.py
+++ b/tests/python/bl_blendfile_io.py
@@ -46,7 +46,7 @@ class TestBlendFileSaveLoadBasic(TestHelper):
TESTS = (
TestBlendFileSaveLoadBasic,
- )
+)
def argparse_create():
diff --git a/tests/python/bl_blendfile_liblink.py b/tests/python/bl_blendfile_liblink.py
index 70614c3502d..b48deb7bd7b 100644
--- a/tests/python/bl_blendfile_liblink.py
+++ b/tests/python/bl_blendfile_liblink.py
@@ -44,7 +44,7 @@ class TestBlendLibLinkSaveLoadBasic(TestHelper):
TESTS = (
TestBlendLibLinkSaveLoadBasic,
- )
+)
def argparse_create():
diff --git a/tests/python/bl_blendfile_utils.py b/tests/python/bl_blendfile_utils.py
index 48e24cd0684..c87b47e5ce7 100644
--- a/tests/python/bl_blendfile_utils.py
+++ b/tests/python/bl_blendfile_utils.py
@@ -15,7 +15,7 @@ class TestHelper:
@classmethod
def blender_data_to_tuple(cls, bdata, pprint_name=None):
ret = sorted(tuple((cls.id_to_uid(k), sorted(tuple(cls.id_to_uid(vv) for vv in v)))
- for k, v in bdata.user_map().items()))
+ for k, v in bdata.user_map().items()))
if pprint_name is not None:
print("\n%s:" % pprint_name)
pprint.pprint(ret)
diff --git a/tests/python/bl_constraints.py b/tests/python/bl_constraints.py
index 09c76bca6bd..4deabc5f541 100644
--- a/tests/python/bl_constraints.py
+++ b/tests/python/bl_constraints.py
@@ -85,7 +85,7 @@ class AbstractConstraintTests(unittest.TestCase):
actual = self.bone_matrix(object_name, bone_name)
self.assert_matrix(actual, expect, object_name)
- def constraint_context(self, constraint_name: str, owner_name: str='') -> dict:
+ def constraint_context(self, constraint_name: str, owner_name: str = '') -> dict:
"""Return a context suitable for calling object constraint operators.
Assumes the owner is called "{constraint_name}.owner" if owner_name=''.
@@ -100,7 +100,7 @@ class AbstractConstraintTests(unittest.TestCase):
}
return context
- def bone_constraint_context(self, constraint_name: str, owner_name: str='', bone_name: str='') -> dict:
+ def bone_constraint_context(self, constraint_name: str, owner_name: str = '', bone_name: str = '') -> dict:
"""Return a context suitable for calling bone constraint operators.
Assumes the owner's object is called "{constraint_name}.owner" if owner_name=''.
diff --git a/tests/python/bl_run_operators.py b/tests/python/bl_run_operators.py
index b8b534a0a11..26fe6dac93d 100644
--- a/tests/python/bl_run_operators.py
+++ b/tests/python/bl_run_operators.py
@@ -503,7 +503,7 @@ def main():
if __name__ == "__main__":
- # ~ for i in range(200):
- # ~ RANDOM_SEED[0] += 1
- #~ main()
+ # for i in range(200):
+ # RANDOM_SEED[0] += 1
+ # main()
main()
diff --git a/tests/python/eevee_render_tests.py b/tests/python/eevee_render_tests.py
index 2f66af2344f..4c3ca28402f 100644
--- a/tests/python/eevee_render_tests.py
+++ b/tests/python/eevee_render_tests.py
@@ -43,13 +43,13 @@ def setup():
# Simple probe setup
bpy.ops.object.lightprobe_add(type='CUBEMAP', location=(0.5, 0, 1.5))
cubemap = bpy.context.selected_objects[0]
- cubemap.scale = (2.5,2.5,1.0)
+ cubemap.scale = (2.5, 2.5, 1.0)
cubemap.data.falloff = 0
cubemap.data.clip_start = 2.4
bpy.ops.object.lightprobe_add(type='GRID', location=(0, 0, 0.25))
grid = bpy.context.selected_objects[0]
- grid.scale = (1.735,1.735,1.735)
+ grid.scale = (1.735, 1.735, 1.735)
grid.data.grid_resolution_x = 3
grid.data.grid_resolution_y = 3
grid.data.grid_resolution_z = 2
diff --git a/tests/python/modules/global_report.py b/tests/python/modules/global_report.py
index 7e6172c345a..f7f181c4736 100755
--- a/tests/python/modules/global_report.py
+++ b/tests/python/modules/global_report.py
@@ -22,7 +22,7 @@ def _write_html(output_dir):
filepath = os.path.join(output_dir, filename)
combined_reports += pathlib.Path(filepath).read_text()
- combined_reports += "<br/>\n";
+ combined_reports += "<br/>\n"
html = """
<html>
@@ -67,7 +67,7 @@ def add(output_dir, category, name, filepath, failed=None):
name=name,
filepath=filepath)
- dirpath = os.path.join(output_dir, "report", category);
+ dirpath = os.path.join(output_dir, "report", category)
os.makedirs(dirpath, exist_ok=True)
filepath = os.path.join(dirpath, name + ".data")
pathlib.Path(filepath).write_text(html)
diff --git a/tests/python/modules/mesh_test.py b/tests/python/modules/mesh_test.py
index e1585aaa7a2..c85e7acf4e8 100644
--- a/tests/python/modules/mesh_test.py
+++ b/tests/python/modules/mesh_test.py
@@ -128,7 +128,14 @@ class MeshTest:
the public method run_test().
"""
- def __init__(self, test_object_name: str, expected_object_name: str, operations_stack=None, apply_modifiers=False, threshold=None):
+ def __init__(
+ self,
+ test_object_name: str,
+ expected_object_name: str,
+ operations_stack=None,
+ apply_modifiers=False,
+ threshold=None,
+ ):
"""
Constructs a MeshTest object. Raises a KeyError if objects with names expected_object_name
or test_object_name don't exist.
@@ -259,7 +266,6 @@ class MeshTest:
if self.apply_modifier:
bpy.ops.object.modifier_apply(modifier=modifier_spec.modifier_name)
-
def _bake_current_simulation(self, obj, test_mod_type, test_mod_name, frame_end):
for scene in bpy.data.scenes:
for modifier in obj.modifiers:
@@ -296,11 +302,15 @@ class MeshTest:
scene.frame_set(physics_spec.frame_end + 1)
- self._bake_current_simulation(test_object, physics_spec.modifier_type, physics_spec.modifier_name, physics_spec.frame_end)
+ self._bake_current_simulation(
+ test_object,
+ physics_spec.modifier_type,
+ physics_spec.modifier_name,
+ physics_spec.frame_end,
+ )
if self.apply_modifier:
bpy.ops.object.modifier_apply(modifier=physics_spec.modifier_name)
-
def _apply_operator(self, test_object, operator: OperatorSpec):
"""
Apply operator on test object.
diff --git a/tests/python/modules/render_report.py b/tests/python/modules/render_report.py
index 9e0c8ad6509..832d3849f01 100755
--- a/tests/python/modules/render_report.py
+++ b/tests/python/modules/render_report.py
@@ -31,7 +31,7 @@ COLORS = COLORS_DUMMY
# NOTE: Keep everything lowercase.
BLACKLIST = (
- # 'file_to_blacklist.blend',
+ # 'file_to_blacklist.blend',
)
diff --git a/tests/python/operators.py b/tests/python/operators.py
index 626aaedc724..901820c7b2d 100644
--- a/tests/python/operators.py
+++ b/tests/python/operators.py
@@ -146,7 +146,7 @@ def main():
"expectedCubeInsetDepth", "inset", {"thickness": 0.2, "depth": 0.2}],
["FACE", {35, 36, 37, 45, 46, 47, 55, 56, 57}, "testGridInsetRelativeOffset", "expectedGridInsetRelativeOffset",
"inset", {"thickness": 0.4, "use_relative_offset": True}],
- ]
+ ]
operators_test = OperatorTest(tests)
diff --git a/tests/python/rna_array.py b/tests/python/rna_array.py
index e0d63cf75ea..623766aa0a1 100644
--- a/tests/python/rna_array.py
+++ b/tests/python/rna_array.py
@@ -164,7 +164,8 @@ class TestMArray(unittest.TestCase):
def test_assign_item(self):
# arr[i] = x
- for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
+ for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"),
+ (rand_float, rand_int, rand_bool) * 2):
rval = make_random_2d_array((4, 5), func)
for i in range(3):
@@ -172,7 +173,8 @@ class TestMArray(unittest.TestCase):
self.assertEqual(prop_to_list(getattr(test, arr)[i]), rval)
# arr[i][j] = x
- for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"), (rand_float, rand_int, rand_bool) * 2):
+ for arr, func in zip(("fmarr", "imarr", "bmarr", "fdmarr", "idmarr", "bdmarr"),
+ (rand_float, rand_int, rand_bool) * 2):
arr = getattr(test, arr)
rval = make_random_array(5, func)
@@ -283,7 +285,10 @@ def prop_to_list(prop):
def suite():
- return unittest.TestSuite([unittest.TestLoader().loadTestsFromTestCase(TestArray), unittest.TestLoader().loadTestsFromTestCase(TestMArray)])
+ return unittest.TestSuite([
+ unittest.TestLoader().loadTestsFromTestCase(TestArray),
+ unittest.TestLoader().loadTestsFromTestCase(TestMArray),
+ ])
if __name__ == "__main__":
diff --git a/tests/python/rna_info_dump.py b/tests/python/rna_info_dump.py
index 01cbe8d290b..bca912f39cf 100644
--- a/tests/python/rna_info_dump.py
+++ b/tests/python/rna_info_dump.py
@@ -81,7 +81,10 @@ def api_dump(use_properties=True, use_functions=True):
for prop in v.properties:
if prop.collection_type:
- funcs = [(prop.identifier + "." + func.identifier, func) for func in prop.collection_type.functions]
+ funcs = [
+ (prop.identifier + "." + func.identifier, func)
+ for func in prop.collection_type.functions
+ ]
for func_id, func in funcs:
data.append(func_to_str(struct_id_str, func_id, func))
data.sort()
@@ -100,7 +103,10 @@ def api_dump(use_properties=True, use_functions=True):
for prop in v.properties:
if prop.collection_type:
- props = [(prop.identifier + "." + prop_sub.identifier, prop_sub) for prop_sub in prop.collection_type.properties]
+ props = [
+ (prop.identifier + "." + prop_sub.identifier, prop_sub)
+ for prop_sub in prop.collection_type.properties
+ ]
for prop_sub_id, prop_sub in props:
data.append(prop_to_str(struct_id_str, prop_sub_id, prop_sub))
data.sort()