[Bf-blender-cvs] [cc6bdac921e] master: Cleanup: format
Campbell Barton
noreply at git.blender.org
Mon Dec 5 03:05:37 CET 2022
Commit: cc6bdac921e7cf15d85ef94d353eda8a04d4ec60
Author: Campbell Barton
Date: Mon Dec 5 12:54:00 2022 +1100
Branches: master
https://developer.blender.org/rBcc6bdac921e7cf15d85ef94d353eda8a04d4ec60
Cleanup: format
===================================================================
M build_files/utils/make_bpy_wheel.py
M intern/cycles/blender/addon/properties.py
M release/scripts/modules/bpy_extras/anim_utils.py
M release/scripts/startup/bl_operators/anim.py
M release/scripts/startup/bl_operators/wm.py
M release/scripts/startup/bl_ui/properties_data_mesh.py
M release/scripts/startup/bl_ui/properties_workspace.py
M release/scripts/startup/bl_ui/space_node.py
M tests/python/bl_blendfile_liblink.py
===================================================================
diff --git a/build_files/utils/make_bpy_wheel.py b/build_files/utils/make_bpy_wheel.py
index a0ac1306dda..9a33c9c1b68 100755
--- a/build_files/utils/make_bpy_wheel.py
+++ b/build_files/utils/make_bpy_wheel.py
@@ -69,6 +69,7 @@ Thanks to Tyler Alden Gubala for maintaining the original version of this packag
# ------------------------------------------------------------------------------
# Generic Functions
+
def find_dominating_file(
path: str,
search: Sequence[str],
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index b8fb67deb52..2a04a7a4b5f 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -87,11 +87,26 @@ enum_sampling_pattern = (
)
enum_emission_sampling = (
- ('NONE', 'None', "Do not use this surface as a light for sampling", 0),
- ('AUTO', 'Auto', "Automatically determine if the surface should be treated as a light for sampling, based on estimated emission intensity", 1),
- ('FRONT', 'Front', "Treat only front side of the surface as a light, usually for closed meshes whose interior is not visible", 2),
- ('BACK', 'Back', "Treat only back side of the surface as a light for sampling", 3),
- ('FRONT_BACK', 'Front and Back', "Treat surface as a light for sampling, emitting from both the front and back side", 4),
+ ('NONE',
+ 'None',
+ "Do not use this surface as a light for sampling",
+ 0),
+ ('AUTO',
+ 'Auto',
+ "Automatically determine if the surface should be treated as a light for sampling, based on estimated emission intensity",
+ 1),
+ ('FRONT',
+ 'Front',
+ "Treat only front side of the surface as a light, usually for closed meshes whose interior is not visible",
+ 2),
+ ('BACK',
+ 'Back',
+ "Treat only back side of the surface as a light for sampling",
+ 3),
+ ('FRONT_BACK',
+ 'Front and Back',
+ "Treat surface as a light for sampling, emitting from both the front and back side",
+ 4),
)
enum_volume_sampling = (
diff --git a/release/scripts/modules/bpy_extras/anim_utils.py b/release/scripts/modules/bpy_extras/anim_utils.py
index 7bc9125a767..cfa7c2aa134 100644
--- a/release/scripts/modules/bpy_extras/anim_utils.py
+++ b/release/scripts/modules/bpy_extras/anim_utils.py
@@ -9,7 +9,7 @@ __all__ = (
)
import bpy
-from typing import Mapping, List, Tuple, Sequence
+from typing import Mapping, List, Tuple, Sequence
# (fcurve.data_path, fcurve.array_index)
FCurveKey = Tuple[str, int]
@@ -17,6 +17,7 @@ FCurveKey = Tuple[str, int]
ListKeyframes = List[float]
Action = bpy.types.Action
+
def bake_action(
obj,
*,
@@ -430,6 +431,7 @@ def bake_action_iter(
yield action
+
class KeyframesCo:
"""A buffer for keyframe Co unpacked values per FCurveKey. FCurveKeys are added using
add_paths(), Co values stored using extend_co_values(), then finally use
diff --git a/release/scripts/startup/bl_operators/anim.py b/release/scripts/startup/bl_operators/anim.py
index e9a0b62cd60..cb301b4bece 100644
--- a/release/scripts/startup/bl_operators/anim.py
+++ b/release/scripts/startup/bl_operators/anim.py
@@ -112,7 +112,10 @@ class ANIM_OT_keying_set_export(Operator):
break
if not found:
- self.report({'WARN'}, tip_("Could not find material or light using Shader Node Tree - %s") % (ksp.id))
+ self.report(
+ {'WARN'},
+ tip_("Could not find material or light using Shader Node Tree - %s") %
+ (ksp.id))
elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"):
# Find compositor nodetree using this node tree...
for scene in bpy.data.scenes:
@@ -335,7 +338,7 @@ class ClearUselessActions(Operator):
removed += 1
self.report({'INFO'}, tip_("Removed %d empty and/or fake-user only Actions")
- % removed)
+ % removed)
return {'FINISHED'}
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py
index 0483a20cb29..14af0f5339e 100644
--- a/release/scripts/startup/bl_operators/wm.py
+++ b/release/scripts/startup/bl_operators/wm.py
@@ -3083,7 +3083,13 @@ class WM_MT_splash_quick_setup(Menu):
old_version = bpy.types.PREFERENCES_OT_copy_prev.previous_version()
if bpy.types.PREFERENCES_OT_copy_prev.poll(context) and old_version:
- sub.operator("preferences.copy_prev", text=iface_("Load %d.%d Settings", "Operator") % old_version, translate=False)
+ sub.operator(
+ "preferences.copy_prev",
+ text=iface_(
+ "Load %d.%d Settings",
+ "Operator") %
+ old_version,
+ translate=False)
sub.operator("wm.save_userpref", text="Save New Settings")
else:
sub.label()
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index 5d7e7cd77b1..e4473cf461f 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -8,6 +8,7 @@ from bpy.app.translations import (
pgettext_tip as tip_,
)
+
class MESH_MT_vertex_group_context_menu(Menu):
bl_label = "Vertex Group Specials"
diff --git a/release/scripts/startup/bl_ui/properties_workspace.py b/release/scripts/startup/bl_ui/properties_workspace.py
index 558707c8461..4ea3db73bb6 100644
--- a/release/scripts/startup/bl_ui/properties_workspace.py
+++ b/release/scripts/startup/bl_ui/properties_workspace.py
@@ -68,7 +68,7 @@ class WORKSPACE_PT_addons(WorkSpaceButtonsPanel, Panel):
row.operator(
"wm.owner_disable" if is_enabled else "wm.owner_enable",
icon='CHECKBOX_HLT' if is_enabled else 'CHECKBOX_DEHLT',
- text=iface_("%s: %s" ) % (iface_(info["category"]), iface_(info["name"])),
+ text=iface_("%s: %s") % (iface_(info["category"]), iface_(info["name"])),
translate=False,
emboss=False,
).owner_id = module_name
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index 194f40e9434..3eed3ee5cd3 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -354,7 +354,6 @@ class NODE_MT_node(Menu):
layout.operator("node.options_toggle")
layout.operator("node.collapse_hide_unused_toggle")
-
if is_compositor:
layout.separator()
diff --git a/tests/python/bl_blendfile_liblink.py b/tests/python/bl_blendfile_liblink.py
index f3c2a3c9e17..d467c749ddf 100644
--- a/tests/python/bl_blendfile_liblink.py
+++ b/tests/python/bl_blendfile_liblink.py
@@ -214,12 +214,13 @@ class TestBlendLibLinkIndirect(TestBlendLibLinkHelper):
assert material.library is not None
assert material.use_fake_user is True
assert material.users == 2 # Fake user is not cleared when linking.
- assert material.is_library_indirect == True
+ assert material.is_library_indirect
assert mesh.library is not None
assert mesh.use_fake_user is False
assert mesh.users == 0
- assert mesh.is_library_indirect == False # IDs explicitely linked by the user are forcefully considered directly linked.
+ # IDs explicitely linked by the user are forcefully considered directly linked.
+ assert mesh.is_library_indirect == False
ob = bpy.data.objects.new("LocalMesh", mesh)
coll = bpy.data.collections.new("LocalMesh")
@@ -227,7 +228,7 @@ class TestBlendLibLinkIndirect(TestBlendLibLinkHelper):
bpy.context.scene.collection.children.link(coll)
assert material.users == 2
- assert material.is_library_indirect == True
+ assert material.is_library_indirect
assert mesh.users == 1
assert mesh.is_library_indirect == False
@@ -240,14 +241,15 @@ class TestBlendLibLinkIndirect(TestBlendLibLinkHelper):
ob.material_slots[0].material = None
assert material.users == 2
- assert material.is_library_indirect == False # This is not properly updated whene removing a local user of linked data.
+ # This is not properly updated whene removing a local user of linked data.
+ assert material.is_library_indirect == False
output_work_path = os.path.join(output_dir, self.unique_blendfile_name("blendfile"))
bpy.ops.wm.save_as_mainfile(filepath=output_work_path, check_existing=False, compress=False)
assert material.users == 2
# Currently linked data which has no more local user never gets reset to indirectly linked status.
- assert material.is_library_indirect == True
+ assert material.is_library_indirect
bpy.ops.wm.open_mainfile(filepath=output_work_path, load_ui=False)
@@ -264,7 +266,7 @@ class TestBlendLibLinkIndirect(TestBlendLibLinkHelper):
assert material.users == 2 # Fake user is not cleared when linking.
# Currently even re-reading the .blend file will not properly reset tag for indirectly linked data,
# if their reference was written in the .blend file.
- assert material.is_library_indirect == True
+ assert material.is_library_indirect
assert mesh.library is not None
assert mesh.use_fake_user is False
More information about the Bf-blender-cvs
mailing list