From d07d6f1c1026cbd46d7a2800fc30e20c9ed30fdc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 15 Mar 2024 10:04:03 +1100 Subject: [PATCH] Cleanup: un-wrap lines that fit within 120 width for Python scripts --- .../startup/bl_operators/add_mesh_torus.py | 3 +- scripts/startup/bl_operators/clip.py | 6 +- scripts/startup/bl_operators/console.py | 15 +-- scripts/startup/bl_operators/mesh.py | 4 +- scripts/startup/bl_operators/node.py | 3 +- scripts/startup/bl_operators/object.py | 12 +-- scripts/startup/bl_operators/object_align.py | 11 +-- .../bl_operators/object_quick_effects.py | 7 +- .../object_randomize_transform.py | 12 +-- scripts/startup/bl_operators/presets.py | 17 +--- .../startup/bl_operators/uvcalc_transform.py | 3 +- scripts/startup/bl_operators/view3d.py | 3 +- scripts/startup/bl_operators/wm.py | 3 +- .../startup/bl_ui/properties_collection.py | 6 +- .../startup/bl_ui/properties_data_armature.py | 13 +-- scripts/startup/bl_ui/properties_data_bone.py | 15 +-- .../startup/bl_ui/properties_data_camera.py | 3 +- scripts/startup/bl_ui/properties_data_mesh.py | 3 +- scripts/startup/bl_ui/properties_freestyle.py | 3 +- .../startup/bl_ui/properties_mask_common.py | 6 +- .../startup/bl_ui/properties_paint_common.py | 15 +-- scripts/startup/bl_ui/properties_particle.py | 4 +- .../startup/bl_ui/properties_view_layer.py | 15 +-- scripts/startup/bl_ui/space_clip.py | 43 +++------ scripts/startup/bl_ui/space_console.py | 4 +- scripts/startup/bl_ui/space_dopesheet.py | 3 +- scripts/startup/bl_ui/space_filebrowser.py | 33 +++---- scripts/startup/bl_ui/space_image.py | 3 +- scripts/startup/bl_ui/space_info.py | 4 +- scripts/startup/bl_ui/space_outliner.py | 3 +- scripts/startup/bl_ui/space_text.py | 15 +-- .../startup/bl_ui/space_toolsystem_common.py | 3 +- scripts/startup/bl_ui/space_topbar.py | 96 ++++++------------- scripts/startup/bl_ui/space_userpref.py | 3 +- scripts/startup/bl_ui/space_view3d.py | 53 ++++------ scripts/startup/bl_ui/space_view3d_toolbar.py | 48 ++++------ 36 files changed, 154 insertions(+), 339 deletions(-) diff --git a/scripts/startup/bl_operators/add_mesh_torus.py b/scripts/startup/bl_operators/add_mesh_torus.py index cc45cb9d7d7..c80457cc9cd 100644 --- a/scripts/startup/bl_operators/add_mesh_torus.py +++ b/scripts/startup/bl_operators/add_mesh_torus.py @@ -147,8 +147,7 @@ class AddTorus(Operator, object_utils.AddObjectHelper): ) major_radius: FloatProperty( name="Major Radius", - description=("Radius from the origin to the " - "center of the cross sections"), + description="Radius from the origin to the center of the cross sections", soft_min=0.0, soft_max=100.0, min=0.0, max=10_000.0, default=1.0, diff --git a/scripts/startup/bl_operators/clip.py b/scripts/startup/bl_operators/clip.py index 99aa2b8043c..374fb92e23a 100644 --- a/scripts/startup/bl_operators/clip.py +++ b/scripts/startup/bl_operators/clip.py @@ -760,8 +760,7 @@ class CLIP_OT_setup_tracking_scene(Operator): def setup_space(space): space.show_backdrop = True - CLIP_spaces_walk(context, True, 'NODE_EDITOR', 'NODE_EDITOR', - setup_space) + CLIP_spaces_walk(context, True, 'NODE_EDITOR', 'NODE_EDITOR', setup_space) sc = context.space_data scene = context.scene @@ -812,8 +811,7 @@ class CLIP_OT_setup_tracking_scene(Operator): tree.links.new(movieclip.outputs["Image"], distortion.inputs["Image"]) if need_stabilization: - tree.links.new(distortion.outputs["Image"], - stabilize.inputs["Image"]) + tree.links.new(distortion.outputs["Image"], stabilize.inputs["Image"]) tree.links.new(stabilize.outputs["Image"], scale.inputs["Image"]) else: tree.links.new(distortion.outputs["Image"], scale.inputs["Image"]) diff --git a/scripts/startup/bl_operators/console.py b/scripts/startup/bl_operators/console.py index 682fbf5023b..a15831b7cd0 100644 --- a/scripts/startup/bl_operators/console.py +++ b/scripts/startup/bl_operators/console.py @@ -42,8 +42,7 @@ class ConsoleExec(Operator): if execute is not None: return execute(context, self.interactive) else: - print("Error: bpy.ops.console.execute_%s - not found" % - sc.language) + print("Error: bpy.ops.console.execute_%s - not found" % sc.language) return {'FINISHED'} @@ -65,8 +64,7 @@ class ConsoleAutocomplete(Operator): if autocomplete: return autocomplete(context) else: - print("Error: bpy.ops.console.autocomplete_%s - not found" % - sc.language) + print("Error: bpy.ops.console.autocomplete_%s - not found" % sc.language) return {'FINISHED'} @@ -88,8 +86,7 @@ class ConsoleCopyAsScript(Operator): if copy_as_script: return copy_as_script(context) else: - print("Error: copy_as_script - not found for %r" % - sc.language) + print("Error: copy_as_script - not found for %r" % sc.language) return {'FINISHED'} @@ -115,8 +112,7 @@ class ConsoleBanner(Operator): if banner: return banner(context) else: - print("Error: bpy.ops.console.banner_%s - not found" % - sc.language) + print("Error: bpy.ops.console.banner_%s - not found" % sc.language) return {'FINISHED'} @@ -144,8 +140,7 @@ class ConsoleLanguage(Operator): bpy.ops.console.banner() # insert a new blank line - bpy.ops.console.history_append(text="", current_character=0, - remove_duplicates=True) + bpy.ops.console.history_append(text="", current_character=0, remove_duplicates=True) return {'FINISHED'} diff --git a/scripts/startup/bl_operators/mesh.py b/scripts/startup/bl_operators/mesh.py index e4110f04eb7..5058b91ad3e 100644 --- a/scripts/startup/bl_operators/mesh.py +++ b/scripts/startup/bl_operators/mesh.py @@ -171,9 +171,7 @@ class MeshMirrorUV(Operator): self.report({'WARNING'}, rpt_("%d mesh(es) with no active UV layer, " "%d duplicates found in %d mesh(es), mirror may be incomplete") - % (total_no_active_UV, - total_duplicates, - meshes_with_duplicates)) + % (total_no_active_UV, total_duplicates, meshes_with_duplicates)) elif total_no_active_UV: self.report({'WARNING'}, rpt_("%d mesh(es) with no active UV layer") diff --git a/scripts/startup/bl_operators/node.py b/scripts/startup/bl_operators/node.py index 9a49cc8467e..133ff608db7 100644 --- a/scripts/startup/bl_operators/node.py +++ b/scripts/startup/bl_operators/node.py @@ -58,8 +58,7 @@ class NodeAddOperator: # convert mouse position to the View2D for later node placement if context.region.type == 'WINDOW': # convert mouse position to the View2D for later node placement - space.cursor_location_from_region( - event.mouse_region_x, event.mouse_region_y) + space.cursor_location_from_region(event.mouse_region_x, event.mouse_region_y) else: space.cursor_location = tree.view_center diff --git a/scripts/startup/bl_operators/object.py b/scripts/startup/bl_operators/object.py index bc6d2bd346a..f0c9b9ebdd2 100644 --- a/scripts/startup/bl_operators/object.py +++ b/scripts/startup/bl_operators/object.py @@ -223,8 +223,7 @@ class SubdivisionSet(Operator): ) relative: BoolProperty( name="Relative", - description=("Apply the subdivision surface level as an offset " - "relative to the current level"), + description="Apply the subdivision surface level as an offset relative to the current level", default=False, ) @@ -288,8 +287,7 @@ class SubdivisionSet(Operator): mod = obj.modifiers.new("Subdivision", 'SUBSURF') mod.levels = level except BaseException: - self.report({'WARNING'}, - "Modifiers cannot be added to object: " + obj.name) + self.report({'WARNING'}, "Modifiers cannot be added to object: " + obj.name) for obj in context.selected_editable_objects: set_object_subd(obj) @@ -325,8 +323,7 @@ class ShapeTransfer(Operator): ) use_clamp: BoolProperty( name="Clamp Offset", - description=("Clamp the transformation to the distance each " - "vertex moves in the original shape"), + description="Clamp the transformation to the distance each vertex moves in the original shape", default=False, ) @@ -447,8 +444,7 @@ class ShapeTransfer(Operator): if use_clamp: # clamp to the same movement as the original # breaks copy between different scaled meshes. - len_from = (orig_shape_coords[i] - - orig_coords[i]).length + len_from = (orig_shape_coords[i] - orig_coords[i]).length ofs = co - target_coords[i] ofs.length = len_from co = target_coords[i] + ofs diff --git a/scripts/startup/bl_operators/object_align.py b/scripts/startup/bl_operators/object_align.py index 0a45f5aadac..824d606dbc5 100644 --- a/scripts/startup/bl_operators/object_align.py +++ b/scripts/startup/bl_operators/object_align.py @@ -101,13 +101,7 @@ def worldspace_bounds_from_object_data(depsgraph, obj): return Vector((left, front, up)), Vector((right, back, down)) -def align_objects(context, - align_x, - align_y, - align_z, - align_mode, - relative_to, - bb_quality): +def align_objects(context, align_x, align_y, align_z, align_mode, relative_to, bb_quality): depsgraph = context.evaluated_depsgraph_get() scene = context.scene @@ -115,8 +109,7 @@ def align_objects(context, cursor = scene.cursor.location # We are accessing runtime data such as evaluated bounding box, so we need to - # be sure it is properly updated and valid (bounding box might be lost on operator - # redo). + # be sure it is properly updated and valid (bounding box might be lost on operator redo). context.view_layer.update() Left_Front_Up_SEL = [0.0, 0.0, 0.0] diff --git a/scripts/startup/bl_operators/object_quick_effects.py b/scripts/startup/bl_operators/object_quick_effects.py index a46e08cc44a..51d0f651a5e 100644 --- a/scripts/startup/bl_operators/object_quick_effects.py +++ b/scripts/startup/bl_operators/object_quick_effects.py @@ -277,9 +277,7 @@ class QuickExplode(ObjectModeOperator, Operator): for obj in mesh_objects: if obj.particle_systems: - self.report({'ERROR'}, - rpt_("Object %r already has a " - "particle system") % obj.name) + self.report({'ERROR'}, rpt_("Object %r already has a " "particle system") % obj.name) return {'CANCELLED'} @@ -518,8 +516,7 @@ class QuickSmoke(ObjectModeOperator, Operator): # Add Principled Volume node_principled = nodes.new(type='ShaderNodeVolumePrincipled') node_principled.location = grid_location(4, 1) - links.new(node_principled.outputs["Volume"], - node_out.inputs["Volume"]) + links.new(node_principled.outputs["Volume"], node_out.inputs["Volume"]) node_principled.inputs["Density"].default_value = 5.0 diff --git a/scripts/startup/bl_operators/object_randomize_transform.py b/scripts/startup/bl_operators/object_randomize_transform.py index 748034125b7..9a94fcfc405 100644 --- a/scripts/startup/bl_operators/object_randomize_transform.py +++ b/scripts/startup/bl_operators/object_randomize_transform.py @@ -6,8 +6,7 @@ from bpy.types import Operator from mathutils import Vector -def randomize_selected(context, seed, delta, - loc, rot, scale, scale_even, _scale_min): +def randomize_selected(context, seed, delta, loc, rot, scale, scale_even, _scale_min): import random from random import uniform @@ -100,8 +99,7 @@ class RandomizeLocRotSize(Operator): ) use_delta: BoolProperty( name="Transform Delta", - description=("Randomize delta transform values " - "instead of regular transform"), + description="Randomize delta transform values instead of regular transform", default=False, ) use_loc: BoolProperty( @@ -111,8 +109,7 @@ class RandomizeLocRotSize(Operator): ) loc: FloatVectorProperty( name="Location", - description=("Maximum distance the objects " - "can spread over each axis"), + description="Maximum distance the objects can spread over each axis", min=-100.0, max=100.0, default=(0.0, 0.0, 0.0), @@ -174,8 +171,7 @@ class RandomizeLocRotSize(Operator): # scale_min = self.scale_min scale_min = 0 - randomize_selected(context, seed, delta, - loc, rot, scale, scale_even, scale_min) + randomize_selected(context, seed, delta, loc, rot, scale, scale_even, scale_min) return {'FINISHED'} diff --git a/scripts/startup/bl_operators/presets.py b/scripts/startup/bl_operators/presets.py index d75723c0406..a10e75875e1 100644 --- a/scripts/startup/bl_operators/presets.py +++ b/scripts/startup/bl_operators/presets.py @@ -120,9 +120,7 @@ class AddPresetBase: if is_xml: import rna_xml - rna_xml.xml_file_write(context, - filepath, - preset_menu_class.preset_xml_map) + rna_xml.xml_file_write(context, filepath, preset_menu_class.preset_xml_map) else: def rna_recursive_attr_expand(value, rna_path_step, level): @@ -169,15 +167,10 @@ class AddPresetBase: name = preset_menu_class.bl_label # fairly sloppy but convenient. - filepath = bpy.utils.preset_find(name, - self.preset_subdir, - ext=ext) + filepath = bpy.utils.preset_find(name, self.preset_subdir, ext=ext) if not filepath: - filepath = bpy.utils.preset_find(name, - self.preset_subdir, - display_name=True, - ext=ext) + filepath = bpy.utils.preset_find(name, self.preset_subdir, display_name=True, ext=ext) if not filepath: return {'CANCELLED'} @@ -257,9 +250,7 @@ class ExecutePreset(Operator): elif ext == ".xml": import rna_xml - rna_xml.xml_file_run(context, - filepath, - preset_class.preset_xml_map) + rna_xml.xml_file_run(context, filepath, preset_class.preset_xml_map) if hasattr(preset_class, "post_cb"): preset_class.post_cb(context) diff --git a/scripts/startup/bl_operators/uvcalc_transform.py b/scripts/startup/bl_operators/uvcalc_transform.py index 567ea614a28..67f3edb7ebf 100644 --- a/scripts/startup/bl_operators/uvcalc_transform.py +++ b/scripts/startup/bl_operators/uvcalc_transform.py @@ -434,8 +434,7 @@ class RandomizeUVTransform(Operator): ) loc: FloatVectorProperty( name="Location", - description=("Maximum distance the objects " - "can spread over each axis"), + description="Maximum distance the objects can spread over each axis", min=-100.0, max=100.0, size=2, diff --git a/scripts/startup/bl_operators/view3d.py b/scripts/startup/bl_operators/view3d.py index 6c3f23b2d34..bb09082d218 100644 --- a/scripts/startup/bl_operators/view3d.py +++ b/scripts/startup/bl_operators/view3d.py @@ -155,8 +155,7 @@ class VIEW3D_OT_edit_mesh_extrude_move(Operator): return {'FINISHED'} def execute(self, context): - return VIEW3D_OT_edit_mesh_extrude_move.extrude_region( - self, context, False, self.dissolve_and_intersect) + return VIEW3D_OT_edit_mesh_extrude_move.extrude_region(self, context, False, self.dissolve_and_intersect) def invoke(self, context, _event): return self.execute(context) diff --git a/scripts/startup/bl_operators/wm.py b/scripts/startup/bl_operators/wm.py index 42d5fa6c726..17daf58346e 100644 --- a/scripts/startup/bl_operators/wm.py +++ b/scripts/startup/bl_operators/wm.py @@ -2084,8 +2084,7 @@ class WM_OT_properties_edit_value(Operator): rna_item = eval("context.%s" % self.data_path) if WM_OT_properties_edit.get_property_type(rna_item, self.property_name) == 'PYTHON': - self.eval_string = WM_OT_properties_edit.convert_custom_property_to_string(rna_item, - self.property_name) + self.eval_string = WM_OT_properties_edit.convert_custom_property_to_string(rna_item, self.property_name) else: self.eval_string = "" diff --git a/scripts/startup/bl_ui/properties_collection.py b/scripts/startup/bl_ui/properties_collection.py index 3ee2e7b5df2..80278781799 100644 --- a/scripts/startup/bl_ui/properties_collection.py +++ b/scripts/startup/bl_ui/properties_collection.py @@ -24,10 +24,8 @@ class CollectionButtonsPanel: def lineart_make_line_type_entry(col, line_type, text_disp, expand, search_from): col.prop(line_type, "use", text=text_disp) if line_type.use and expand: - col.prop_search(line_type, "layer", search_from, - "layers", icon='GREASEPENCIL') - col.prop_search(line_type, "material", search_from, - "materials", icon='SHADING_TEXTURE') + col.prop_search(line_type, "layer", search_from, "layers", icon='GREASEPENCIL') + col.prop_search(line_type, "material", search_from, "materials", icon='SHADING_TEXTURE') class COLLECTION_PT_collection_flags(CollectionButtonsPanel, Panel): diff --git a/scripts/startup/bl_ui/properties_data_armature.py b/scripts/startup/bl_ui/properties_data_armature.py index d565c0cb7b7..7f14f4bd75b 100644 --- a/scripts/startup/bl_ui/properties_data_armature.py +++ b/scripts/startup/bl_ui/properties_data_armature.py @@ -87,20 +87,13 @@ class DATA_UL_bone_collections(UIList): active_bone = armature.edit_bones.active or armature.bones.active has_active_bone = active_bone and bcoll.name in active_bone.collections - layout.prop(bcoll, "name", text="", emboss=False, - icon='DOT' if has_active_bone else 'BLANK1') + layout.prop(bcoll, "name", text="", emboss=False, icon='DOT' if has_active_bone else 'BLANK1') if armature.override_library: icon = 'LIBRARY_DATA_OVERRIDE' if bcoll.is_local_override else 'BLANK1' - layout.prop( - bcoll, - "is_local_override", - text="", - emboss=False, - icon=icon) + layout.prop(bcoll, "is_local_override", text="", emboss=False, icon=icon) - layout.prop(bcoll, "is_visible", text="", emboss=False, - icon='HIDE_OFF' if bcoll.is_visible else 'HIDE_ON') + layout.prop(bcoll, "is_visible", text="", emboss=False, icon='HIDE_OFF' if bcoll.is_visible else 'HIDE_ON') class DATA_PT_bone_collections(ArmatureButtonsPanel, Panel): diff --git a/scripts/startup/bl_ui/properties_data_bone.py b/scripts/startup/bl_ui/properties_data_bone.py index 94859ad0c4d..c776316d7f0 100644 --- a/scripts/startup/bl_ui/properties_data_bone.py +++ b/scripts/startup/bl_ui/properties_data_bone.py @@ -289,15 +289,12 @@ class BONE_PT_collections(BoneButtonsPanel, Panel): # Sub-layout that's dimmed when the bone collection's own visibility flag doesn't matter. sub_visible = row.row(align=True) sub_visible.active = (not is_solo_active) and bcoll.is_visible_ancestors - sub_visible.prop(bcoll, "is_visible", text="", - icon='HIDE_OFF' if bcoll.is_visible else 'HIDE_ON') + sub_visible.prop(bcoll, "is_visible", text="", icon='HIDE_OFF' if bcoll.is_visible else 'HIDE_ON') - row.prop(bcoll, "is_solo", text="", - icon='SOLO_ON' if bcoll.is_solo else 'SOLO_OFF') + row.prop(bcoll, "is_solo", text="", icon='SOLO_ON' if bcoll.is_solo else 'SOLO_OFF') # Unassignment operator, less safe so with a bit of spacing. - props = bcoll_row.operator("armature.collection_unassign_named", - text="", icon='X') + props = bcoll_row.operator("armature.collection_unassign_named", text="", icon='X') props.name = bcoll.name props.bone_name = bone.name @@ -410,8 +407,7 @@ class BONE_PT_display_custom_shape(BoneButtonsPanel, Panel): sub.prop(pchan, "custom_shape_translation", text="Translation") sub.prop(pchan, "custom_shape_rotation_euler", text="Rotation") - sub.prop_search(pchan, "custom_shape_transform", - ob.pose, "bones", text="Override Transform") + sub.prop_search(pchan, "custom_shape_transform", ob.pose, "bones", text="Override Transform") sub.prop(pchan, "use_custom_shape_bone_size") sub.separator() @@ -559,8 +555,7 @@ class BONE_PT_custom_props(BoneButtonsPanel, rna_prop_ui.PropertyPanel, Panel): @classmethod def _poll(cls, context): context_path = cls._get_context_path(context) - rna_item, _context_member = rna_prop_ui.rna_idprop_context_value( - context, context_path, cls._property_type) + rna_item, _context_member = rna_prop_ui.rna_idprop_context_value(context, context_path, cls._property_type) return bool(rna_item) def draw(self, context): diff --git a/scripts/startup/bl_ui/properties_data_camera.py b/scripts/startup/bl_ui/properties_data_camera.py index 77512370159..240e613fed9 100644 --- a/scripts/startup/bl_ui/properties_data_camera.py +++ b/scripts/startup/bl_ui/properties_data_camera.py @@ -156,8 +156,7 @@ class DATA_PT_camera_stereoscopy(CameraButtonsPanel, Panel): @classmethod def poll(cls, context): render = context.scene.render - return (super().poll(context) and render.use_multiview and - render.views_format == 'STEREO_3D') + return (super().poll(context) and render.use_multiview and render.views_format == 'STEREO_3D') def draw(self, context): layout = self.layout diff --git a/scripts/startup/bl_ui/properties_data_mesh.py b/scripts/startup/bl_ui/properties_data_mesh.py index 2ab74162e81..596d09f512b 100644 --- a/scripts/startup/bl_ui/properties_data_mesh.py +++ b/scripts/startup/bl_ui/properties_data_mesh.py @@ -637,8 +637,7 @@ class MESH_UL_color_attributes(UIList, ColorAttributesListBase): sub = split.row() sub.alignment = 'RIGHT' sub.active = False - sub.label(text="%s ▶ %s" % (iface_(domain_name), iface_(data_type.name)), - translate=False) + sub.label(text="%s ▶ %s" % (iface_(domain_name), iface_(data_type.name)), translate=False) active_render = _index == data.color_attributes.render_color_index diff --git a/scripts/startup/bl_ui/properties_freestyle.py b/scripts/startup/bl_ui/properties_freestyle.py index 0be97539e26..a3c7fffe744 100644 --- a/scripts/startup/bl_ui/properties_freestyle.py +++ b/scripts/startup/bl_ui/properties_freestyle.py @@ -754,8 +754,7 @@ class VIEWLAYER_PT_freestyle_linestyle_color(ViewLayerFreestyleLineStyle, Panel) elif modifier.type == 'MATERIAL': row = box.row() - row.prop(modifier, "material_attribute", - text="Material Attribute") + row.prop(modifier, "material_attribute", text="Material Attribute") sub = box.column() sub.prop(modifier, "use_ramp") if modifier.material_attribute in {'LINE', 'DIFF', 'SPEC'}: diff --git a/scripts/startup/bl_ui/properties_mask_common.py b/scripts/startup/bl_ui/properties_mask_common.py index 4401de9cae8..dfc32ac2419 100644 --- a/scripts/startup/bl_ui/properties_mask_common.py +++ b/scripts/startup/bl_ui/properties_mask_common.py @@ -36,8 +36,7 @@ def draw_mask_context_menu(layout, _context): class MASK_UL_layers(UIList): - def draw_item(self, _context, layout, _data, item, icon, - _active_data, _active_propname, _index): + def draw_item(self, _context, layout, _data, item, icon, _active_data, _active_propname, _index): # assert(isinstance(item, bpy.types.MaskLayer) mask = item if self.layout_type in {'DEFAULT', 'COMPACT'}: @@ -204,8 +203,7 @@ class MASK_PT_point: row = col.row() row.prop(parent, "type", expand=True) - col.prop_search(parent, "parent", tracking, - "objects", icon='OBJECT_DATA', text="Object") + col.prop_search(parent, "parent", tracking, "objects", icon='OBJECT_DATA', text="Object") tracks_list = "tracks" if parent.type == 'POINT_TRACK' else "plane_tracks" diff --git a/scripts/startup/bl_ui/properties_paint_common.py b/scripts/startup/bl_ui/properties_paint_common.py index b2fcdc44275..c3a3fb97afc 100644 --- a/scripts/startup/bl_ui/properties_paint_common.py +++ b/scripts/startup/bl_ui/properties_paint_common.py @@ -391,8 +391,7 @@ class SmoothStrokePanel(BrushPanel): brush = settings.brush self.layout.use_property_split = False - self.layout.prop(brush, "use_smooth_stroke", - text=self.bl_label if self.is_popover else "") + self.layout.prop(brush, "use_smooth_stroke", text=self.bl_label if self.is_popover else "") def draw(self, context): layout = self.layout @@ -1344,8 +1343,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False) if gp_settings.use_pressure and not compact: col = layout.column() - col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True, - use_negative_slope=True) + col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True, use_negative_slope=True) row = layout.row(align=True) row.prop(gp_settings, "pen_strength", slider=True) @@ -1353,8 +1351,7 @@ def brush_basic_gpencil_paint_settings(layout, context, brush, *, compact=False) if gp_settings.use_strength_pressure and not compact: col = layout.column() - col.template_curve_mapping(gp_settings, "curve_strength", brush=True, - use_negative_slope=True) + col.template_curve_mapping(gp_settings, "curve_strength", brush=True, use_negative_slope=True) if brush.gpencil_tool == 'TINT': row = layout.row(align=True) @@ -1415,8 +1412,7 @@ def brush_basic_grease_pencil_paint_settings(layout, context, brush, *, compact= if brush.use_pressure_size and not compact: col = layout.column() - col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True, - use_negative_slope=True) + col.template_curve_mapping(gp_settings, "curve_sensitivity", brush=True, use_negative_slope=True) UnifiedPaintPanel.prop_unified( layout, @@ -1431,8 +1427,7 @@ def brush_basic_grease_pencil_paint_settings(layout, context, brush, *, compact= if brush.use_pressure_strength and not compact: col = layout.column() - col.template_curve_mapping(gp_settings, "curve_strength", brush=True, - use_negative_slope=True) + col.template_curve_mapping(gp_settings, "curve_strength", brush=True, use_negative_slope=True) if grease_pencil_tool == 'DRAW': layout.prop(gp_settings, "active_smooth_factor") diff --git a/scripts/startup/bl_ui/properties_particle.py b/scripts/startup/bl_ui/properties_particle.py index ead9116ad55..6e06c935c0e 100644 --- a/scripts/startup/bl_ui/properties_particle.py +++ b/scripts/startup/bl_ui/properties_particle.py @@ -87,9 +87,7 @@ class PARTICLE_MT_context_menu(Menu): props.remove_target_particles = True if psys is not None and psys.settings.type == 'HAIR': - layout.operator( - "curves.convert_from_particle_system", - text="Convert to Curves") + layout.operator("curves.convert_from_particle_system", text="Convert to Curves") layout.separator() diff --git a/scripts/startup/bl_ui/properties_view_layer.py b/scripts/startup/bl_ui/properties_view_layer.py index e07692a8d5d..1fc2d57851f 100644 --- a/scripts/startup/bl_ui/properties_view_layer.py +++ b/scripts/startup/bl_ui/properties_view_layer.py @@ -151,8 +151,7 @@ class VIEWLAYER_PT_eevee_layer_passes_light(ViewLayerButtonsPanel, Panel): col.prop(view_layer, "use_pass_emit", text="Emission") col.prop(view_layer, "use_pass_environment") col.prop(view_layer, "use_pass_shadow") - col.prop(view_layer, "use_pass_ambient_occlusion", - text="Ambient Occlusion") + col.prop(view_layer, "use_pass_ambient_occlusion", text="Ambient Occlusion") class VIEWLAYER_PT_eevee_next_layer_passes_light(ViewLayerButtonsPanel, Panel): @@ -184,8 +183,7 @@ class VIEWLAYER_PT_eevee_next_layer_passes_light(ViewLayerButtonsPanel, Panel): col.prop(view_layer, "use_pass_emit", text="Emission") col.prop(view_layer, "use_pass_environment") col.prop(view_layer, "use_pass_shadow") - col.prop(view_layer, "use_pass_ambient_occlusion", - text="Ambient Occlusion") + col.prop(view_layer, "use_pass_ambient_occlusion", text="Ambient Occlusion") col = layout.column() col.active = view_layer.use_pass_ambient_occlusion @@ -230,8 +228,7 @@ class ViewLayerAOVPanel(ViewLayerButtonsPanel, Panel): row = layout.row() col = row.column() - col.template_list("VIEWLAYER_UL_aov", "aovs", view_layer, - "aovs", view_layer, "active_aov_index", rows=3) + col.template_list("VIEWLAYER_UL_aov", "aovs", view_layer, "aovs", view_layer, "active_aov_index", rows=3) col = row.column() sub = col.column(align=True) @@ -240,8 +237,7 @@ class ViewLayerAOVPanel(ViewLayerButtonsPanel, Panel): aov = view_layer.active_aov if aov and not aov.is_valid: - layout.label( - text="Conflicts with another render pass with the same name", icon='ERROR') + layout.label(text="Conflicts with another render pass with the same name", icon='ERROR') class VIEWLAYER_PT_layer_passes_aov(ViewLayerAOVPanel): @@ -271,8 +267,7 @@ class ViewLayerCryptomattePanel(ViewLayerButtonsPanel, Panel): col.prop(view_layer, "pass_cryptomatte_depth", text="Levels") if context.engine == 'BLENDER_EEVEE': - col.prop(view_layer, "use_pass_cryptomatte_accurate", - text="Accurate Mode") + col.prop(view_layer, "use_pass_cryptomatte_accurate", text="Accurate Mode") class VIEWLAYER_PT_layer_passes_cryptomatte(ViewLayerCryptomattePanel, Panel): diff --git a/scripts/startup/bl_ui/space_clip.py b/scripts/startup/bl_ui/space_clip.py index a609d8b9e4b..719161b9069 100644 --- a/scripts/startup/bl_ui/space_clip.py +++ b/scripts/startup/bl_ui/space_clip.py @@ -17,8 +17,7 @@ from bl_ui.properties_grease_pencil_common import ( class CLIP_UL_tracking_objects(UIList): - def draw_item(self, _context, layout, _data, item, _icon, - _active_data, _active_propname, _index): + def draw_item(self, _context, layout, _data, item, _icon, _active_data, _active_propname, _index): # assert(isinstance(item, bpy.types.MovieTrackingObject) tobj = item if self.layout_type in {'DEFAULT', 'COMPACT'}: @@ -142,8 +141,7 @@ class CLIP_HT_header(Header): props = row.operator("clip.track_markers", text="", icon='TRACKING_BACKWARDS_SINGLE') props.backwards = True props.sequence = False - props = row.operator("clip.track_markers", text="", - icon='TRACKING_BACKWARDS') + props = row.operator("clip.track_markers", text="", icon='TRACKING_BACKWARDS') props.backwards = True props.sequence = True props = row.operator("clip.track_markers", text="", icon='TRACKING_FORWARDS') @@ -171,9 +169,7 @@ class CLIP_HT_header(Header): r = active_object.reconstruction if r.is_valid and sc.view == 'CLIP': - layout.label(text=rpt_("Solve error: %.2f px") % - (r.average_error), - translate=False) + layout.label(text=rpt_("Solve error: %.2f px") % (r.average_error), translate=False) row = layout.row() row.prop(sc, "pivot_point", text="", icon_only=True) @@ -433,16 +429,12 @@ class CLIP_PT_tracking_settings(CLIP_PT_tracking_panel, Panel): row = col.row(align=True) row.use_property_split = False - row.prop(settings, "use_default_red_channel", - text="R", toggle=True) - row.prop(settings, "use_default_green_channel", - text="G", toggle=True) - row.prop(settings, "use_default_blue_channel", - text="B", toggle=True) + row.prop(settings, "use_default_red_channel", text="R", toggle=True) + row.prop(settings, "use_default_green_channel", text="G", toggle=True) + row.prop(settings, "use_default_blue_channel", text="B", toggle=True) col.separator() - col.operator("clip.track_settings_as_default", - text="Copy from Active Track") + col.operator("clip.track_settings_as_default", text="Copy from Active Track") class CLIP_PT_tracking_settings_extras(CLIP_PT_tracking_panel, Panel): @@ -486,8 +478,7 @@ class CLIP_PT_tools_tracking(CLIP_PT_tracking_panel, Panel): props = row.operator("clip.track_markers", text="", icon='TRACKING_BACKWARDS_SINGLE') props.backwards = True props.sequence = False - props = row.operator("clip.track_markers", text="", - icon='TRACKING_BACKWARDS') + props = row.operator("clip.track_markers", text="", icon='TRACKING_BACKWARDS') props.backwards = True props.sequence = True props = row.operator("clip.track_markers", text="", icon='TRACKING_FORWARDS') @@ -712,8 +703,7 @@ class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel): tracking = sc.clip.tracking row = layout.row() - row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects", - tracking, "active_object_index", rows=1) + row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects", tracking, "active_object_index", rows=1) sub = row.column(align=True) @@ -765,8 +755,7 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel): row.prop(act_track, "use_grayscale_preview", text="B/W", toggle=True) row.separator() - row.prop(act_track, "use_alpha_preview", - text="", toggle=True, icon='IMAGE_ALPHA') + row.prop(act_track, "use_alpha_preview", text="", toggle=True, icon='IMAGE_ALPHA') layout.prop(act_track, "weight") layout.prop(act_track, "weight_stab") @@ -810,8 +799,7 @@ class CLIP_PT_plane_track(CLIP_PT_tracking_panel, Panel): layout.prop(active_track, "name") layout.prop(active_track, "use_auto_keying") row = layout.row() - row.template_ID( - active_track, "image", new="image.new", open="image.open") + row.template_ID(active_track, "image", new="image.new", open="image.open") row.menu("CLIP_MT_plane_track_image_context_menu", icon='DOWNARROW_HLT', text="") row = layout.row() @@ -1642,10 +1630,8 @@ class CLIP_MT_tracking_context_menu(Menu): layout.separator() - layout.operator("clip.disable_markers", - text="Disable Markers").action = 'DISABLE' - layout.operator("clip.disable_markers", - text="Enable Markers").action = 'ENABLE' + layout.operator("clip.disable_markers", text="Disable Markers").action = 'DISABLE' + layout.operator("clip.disable_markers", text="Enable Markers").action = 'ENABLE' layout.separator() @@ -1655,8 +1641,7 @@ class CLIP_MT_tracking_context_menu(Menu): layout.separator() layout.operator("clip.lock_tracks", text="Lock Tracks").action = 'LOCK' - layout.operator("clip.lock_tracks", - text="Unlock Tracks").action = 'UNLOCK' + layout.operator("clip.lock_tracks", text="Unlock Tracks").action = 'UNLOCK' layout.separator() diff --git a/scripts/startup/bl_ui/space_console.py b/scripts/startup/bl_ui/space_console.py index 3a18838ff1b..453bc5c0fe8 100644 --- a/scripts/startup/bl_ui/space_console.py +++ b/scripts/startup/bl_ui/space_console.py @@ -73,9 +73,7 @@ class CONSOLE_MT_language(Menu): languages.sort() for language in languages: - layout.operator("console.language", - text=language.title(), - translate=False).language = language + layout.operator("console.language", text=language.title(), translate=False).language = language class CONSOLE_MT_console(Menu): diff --git a/scripts/startup/bl_ui/space_dopesheet.py b/scripts/startup/bl_ui/space_dopesheet.py index 00e6400e124..d6d78764012 100644 --- a/scripts/startup/bl_ui/space_dopesheet.py +++ b/scripts/startup/bl_ui/space_dopesheet.py @@ -179,8 +179,7 @@ class DOPESHEET_PT_filters(DopesheetFilterPopoverBase, Panel): if ds_mode in {'DOPESHEET', 'ACTION', 'GPENCIL'}: layout.separator() generic_filters_only = ds_mode != 'DOPESHEET' - DopesheetFilterPopoverBase.draw_search_filters(context, layout, - generic_filters_only=generic_filters_only) + DopesheetFilterPopoverBase.draw_search_filters(context, layout, generic_filters_only=generic_filters_only) if ds_mode == 'DOPESHEET': layout.separator() diff --git a/scripts/startup/bl_ui/space_filebrowser.py b/scripts/startup/bl_ui/space_filebrowser.py index 4a834fa662e..2c509697e89 100644 --- a/scripts/startup/bl_ui/space_filebrowser.py +++ b/scripts/startup/bl_ui/space_filebrowser.py @@ -142,12 +142,10 @@ class FILEBROWSER_PT_filter(FileBrowserPanel, Panel): else: row = col.row() row.label(icon='FILE_BLEND') - row.prop(params, "use_filter_blender", - text=".blend Files", toggle=False) + row.prop(params, "use_filter_blender", text=".blend Files", toggle=False) row = col.row() row.label(icon='FILE_BACKUP') - row.prop(params, "use_filter_backup", - text="Backup .blend Files", toggle=False) + row.prop(params, "use_filter_backup", text="Backup .blend Files", toggle=False) row = col.row() row.label(icon='FILE_IMAGE') row.prop(params, "use_filter_image", text="Image Files", toggle=False) @@ -156,8 +154,7 @@ class FILEBROWSER_PT_filter(FileBrowserPanel, Panel): row.prop(params, "use_filter_movie", text="Movie Files", toggle=False) row = col.row() row.label(icon='FILE_SCRIPT') - row.prop(params, "use_filter_script", - text="Script Files", toggle=False) + row.prop(params, "use_filter_script", text="Script Files", toggle=False) row = col.row() row.label(icon='FILE_FONT') row.prop(params, "use_filter_font", text="Font Files", toggle=False) @@ -176,8 +173,7 @@ class FILEBROWSER_PT_filter(FileBrowserPanel, Panel): if is_lib_browser: row = col.row() row.label(icon='BLANK1') # Indentation - row.prop(params, "use_filter_blendid", - text="Blender IDs", toggle=False) + row.prop(params, "use_filter_blendid", text="Blender IDs", toggle=False) if params.use_filter_blendid: row = col.row() row.label(icon='BLANK1') # Indentation @@ -281,10 +277,8 @@ class FILEBROWSER_MT_bookmarks_context_menu(Menu): layout.operator("file.bookmark_cleanup", icon='X', text="Cleanup") layout.separator() - layout.operator("file.bookmark_move", icon='TRIA_UP_BAR', - text="Move to Top").direction = 'TOP' - layout.operator("file.bookmark_move", icon='TRIA_DOWN_BAR', - text="Move to Bottom").direction = 'BOTTOM' + layout.operator("file.bookmark_move", icon='TRIA_UP_BAR', text="Move to Top").direction = 'TOP' + layout.operator("file.bookmark_move", icon='TRIA_DOWN_BAR', text="Move to Bottom").direction = 'BOTTOM' class FILEBROWSER_PT_bookmarks_favorites(FileBrowserPanel, Panel): @@ -314,15 +308,12 @@ class FILEBROWSER_PT_bookmarks_favorites(FileBrowserPanel, Panel): col = row.column(align=True) col.operator("file.bookmark_add", icon='ADD', text="") col.operator("file.bookmark_delete", icon='REMOVE', text="") - col.menu("FILEBROWSER_MT_bookmarks_context_menu", - icon='DOWNARROW_HLT', text="") + col.menu("FILEBROWSER_MT_bookmarks_context_menu", icon='DOWNARROW_HLT', text="") if num_rows > 1: col.separator() - col.operator("file.bookmark_move", icon='TRIA_UP', - text="").direction = 'UP' - col.operator("file.bookmark_move", icon='TRIA_DOWN', - text="").direction = 'DOWN' + col.operator("file.bookmark_move", icon='TRIA_UP', text="").direction = 'UP' + col.operator("file.bookmark_move", icon='TRIA_DOWN', text="").direction = 'DOWN' else: layout.operator("file.bookmark_add", icon='ADD') @@ -553,10 +544,8 @@ class FILEBROWSER_MT_context_menu(FileBrowserMenu, Menu): layout.separator() - layout.operator("file.filenum", text="Increase Number", - icon='ADD').increment = 1 - layout.operator("file.filenum", text="Decrease Number", - icon='REMOVE').increment = -1 + layout.operator("file.filenum", text="Increase Number", icon='ADD').increment = 1 + layout.operator("file.filenum", text="Decrease Number", icon='REMOVE').increment = -1 layout.separator() diff --git a/scripts/startup/bl_ui/space_image.py b/scripts/startup/bl_ui/space_image.py index 511c6b45d1a..4608a501d0a 100644 --- a/scripts/startup/bl_ui/space_image.py +++ b/scripts/startup/bl_ui/space_image.py @@ -194,8 +194,7 @@ class IMAGE_MT_image(Menu): ima = sima.image show_render = sima.show_render - layout.operator("image.new", text="New", - text_ctxt=i18n_contexts.id_image) + layout.operator("image.new", text="New", text_ctxt=i18n_contexts.id_image) layout.operator("image.open", text="Open...", icon='FILE_FOLDER') layout.operator("image.read_viewlayers") diff --git a/scripts/startup/bl_ui/space_info.py b/scripts/startup/bl_ui/space_info.py index c865565c454..7d690fb6b45 100644 --- a/scripts/startup/bl_ui/space_info.py +++ b/scripts/startup/bl_ui/space_info.py @@ -81,9 +81,7 @@ class INFO_MT_area(Menu): layout.separator() layout.operator("screen.screen_full_area") - layout.operator( - "screen.screen_full_area", - text="Toggle Fullscreen Area").use_hide_panels = True + layout.operator("screen.screen_full_area", text="Toggle Fullscreen Area").use_hide_panels = True layout.operator("screen.area_dupli") layout.separator() diff --git a/scripts/startup/bl_ui/space_outliner.py b/scripts/startup/bl_ui/space_outliner.py index 2459bc35392..9849c625f7f 100644 --- a/scripts/startup/bl_ui/space_outliner.py +++ b/scripts/startup/bl_ui/space_outliner.py @@ -223,8 +223,7 @@ class OUTLINER_MT_collection(Menu): space = context.space_data - layout.operator("outliner.collection_new", text="New", - text_ctxt=i18n_contexts.id_collection).nested = True + layout.operator("outliner.collection_new", text="New", text_ctxt=i18n_contexts.id_collection).nested = True layout.operator("outliner.collection_duplicate", text="Duplicate Collection") layout.operator("outliner.collection_duplicate_linked", text="Duplicate Linked") layout.operator("outliner.id_copy", text="Copy", icon='COPYDOWN') diff --git a/scripts/startup/bl_ui/space_text.py b/scripts/startup/bl_ui/space_text.py index 4263d96bf61..f4017ac54aa 100644 --- a/scripts/startup/bl_ui/space_text.py +++ b/scripts/startup/bl_ui/space_text.py @@ -31,14 +31,12 @@ class TEXT_HT_header(Header): row.operator("text.resolve_conflict", text="", icon='QUESTION') row = layout.row(align=True) - row.template_ID(st, "text", new="text.new", - unlink="text.unlink", open="text.open") + row.template_ID(st, "text", new="text.new", unlink="text.unlink", open="text.open") if text: is_osl = text.name.endswith((".osl", ".osl")) if is_osl: - row.operator("node.shader_script_update", - text="", icon='FILE_REFRESH') + row.operator("node.shader_script_update", text="", icon='FILE_REFRESH') else: row = layout.row() row.active = is_syntax_highlight_supported @@ -174,10 +172,8 @@ class TEXT_PT_find(Panel): row = layout.row(align=True) if not st.text: row.active = False - row.prop(st, "use_match_case", text="Case", - text_ctxt=i18n_contexts.id_text, toggle=True) - row.prop(st, "use_find_wrap", text="Wrap", - text_ctxt=i18n_contexts.id_text, toggle=True) + row.prop(st, "use_match_case", text="Case", text_ctxt=i18n_contexts.id_text, toggle=True) + row.prop(st, "use_find_wrap", text="Wrap", text_ctxt=i18n_contexts.id_text, toggle=True) row.prop(st, "use_find_all", text="All", toggle=True) @@ -253,8 +249,7 @@ class TEXT_MT_text(Menu): st = context.space_data text = st.text - layout.operator("text.new", text="New", - text_ctxt=i18n_contexts.id_text, icon='FILE_NEW') + layout.operator("text.new", text="New", text_ctxt=i18n_contexts.id_text, icon='FILE_NEW') layout.operator("text.open", text="Open...", icon='FILE_FOLDER') if text: diff --git a/scripts/startup/bl_ui/space_toolsystem_common.py b/scripts/startup/bl_ui/space_toolsystem_common.py index 119d99d2939..a2d78a923b3 100644 --- a/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/scripts/startup/bl_ui/space_toolsystem_common.py @@ -226,8 +226,7 @@ class ToolSelectPanelHelper: @staticmethod def _tool_class_from_space_type(space_type): return next( - (cls for cls in ToolSelectPanelHelper.__subclasses__() - if cls.bl_space_type == space_type), + (cls for cls in ToolSelectPanelHelper.__subclasses__() if cls.bl_space_type == space_type), None, ) diff --git a/scripts/startup/bl_ui/space_topbar.py b/scripts/startup/bl_ui/space_topbar.py index 89c8faa607a..ea82fd692ce 100644 --- a/scripts/startup/bl_ui/space_topbar.py +++ b/scripts/startup/bl_ui/space_topbar.py @@ -33,17 +33,9 @@ class TOPBAR_HT_upper_bar(Header): layout.separator() if not screen.show_fullscreen: - layout.template_ID_tabs( - window, "workspace", - new="workspace.add", - menu="TOPBAR_MT_workspace_menu", - ) + layout.template_ID_tabs(window, "workspace", new="workspace.add", menu="TOPBAR_MT_workspace_menu") else: - layout.operator( - "screen.back_to_previous", - icon='SCREEN_BACK', - text="Back to Previous", - ) + layout.operator("screen.back_to_previous", icon='SCREEN_BACK', text="Back to Previous") def draw_right(self, context): layout = self.layout @@ -58,8 +50,7 @@ class TOPBAR_HT_upper_bar(Header): layout.template_running_jobs() # Active workspace view-layer is retrieved through window, not through workspace. - layout.template_ID(window, "scene", new="scene.new", - unlink="scene.delete") + layout.template_ID(window, "scene", new="scene.new", unlink="scene.delete") row = layout.row(align=True) row.template_search( @@ -84,11 +75,9 @@ class TOPBAR_PT_tool_settings_extra(Panel): layout = self.layout # Get the active tool - space_type, mode = ToolSelectPanelHelper._tool_key_from_context( - context) + space_type, mode = ToolSelectPanelHelper._tool_key_from_context(context) cls = ToolSelectPanelHelper._tool_class_from_space_type(space_type) - item, tool, _ = cls._tool_get_active( - context, space_type, mode, with_icon=True) + item, tool, _ = cls._tool_get_active(context, space_type, mode, with_icon=True) if item is None: return @@ -110,8 +99,7 @@ class TOPBAR_PT_tool_fallback(Panel): ToolSelectPanelHelper.draw_fallback_tool_items(layout, context) if tool_settings.workspace_tool_type == 'FALLBACK': tool = context.tool - ToolSelectPanelHelper.draw_active_tool_fallback( - context, layout, tool) + ToolSelectPanelHelper.draw_active_tool_fallback(context, layout, tool) class TOPBAR_PT_gpencil_layers(Panel): @@ -156,8 +144,7 @@ class TOPBAR_PT_gpencil_layers(Panel): srow = col.row(align=True) srow.prop(gpl, "opacity", text="Opacity", slider=True) - srow.prop(gpl, "use_mask_layer", text="", - icon='CLIPUV_DEHLT' if gpl.use_mask_layer else 'CLIPUV_HLT') + srow.prop(gpl, "use_mask_layer", text="", icon='CLIPUV_DEHLT' if gpl.use_mask_layer else 'CLIPUV_HLT') srow = col.row(align=True) srow.prop(gpl, "use_lights", text="Lights") @@ -170,25 +157,20 @@ class TOPBAR_PT_gpencil_layers(Panel): gpl = context.active_gpencil_layer if gpl: - sub.menu("GPENCIL_MT_layer_context_menu", - icon='DOWNARROW_HLT', text="") + sub.menu("GPENCIL_MT_layer_context_menu", icon='DOWNARROW_HLT', text="") if len(gpd.layers) > 1: col.separator() sub = col.column(align=True) - sub.operator("gpencil.layer_move", - icon='TRIA_UP', text="").type = 'UP' - sub.operator("gpencil.layer_move", - icon='TRIA_DOWN', text="").type = 'DOWN' + sub.operator("gpencil.layer_move", icon='TRIA_UP', text="").type = 'UP' + sub.operator("gpencil.layer_move", icon='TRIA_DOWN', text="").type = 'DOWN' col.separator() sub = col.column(align=True) - sub.operator("gpencil.layer_isolate", icon='HIDE_OFF', - text="").affect_visibility = True - sub.operator("gpencil.layer_isolate", icon='LOCKED', - text="").affect_visibility = False + sub.operator("gpencil.layer_isolate", icon='HIDE_OFF', text="").affect_visibility = True + sub.operator("gpencil.layer_isolate", icon='LOCKED', text="").affect_visibility = False class TOPBAR_MT_editor_menus(Menu): @@ -224,8 +206,7 @@ class TOPBAR_MT_blender(Menu): layout.separator() - layout.operator("preferences.app_template_install", - text="Install Application Template...") + layout.operator("preferences.app_template_install", text="Install Application Template...") layout.separator() @@ -343,16 +324,11 @@ class TOPBAR_MT_file_new(Menu): # Draw application templates. if not use_more: - props = layout.operator( - "wm.read_homefile", text="General", icon=icon) + props = layout.operator("wm.read_homefile", text="General", icon=icon) props.app_template = "" for d in paths: - props = layout.operator( - "wm.read_homefile", - text=bpy.path.display_name(iface_(d)), - icon=icon, - ) + props = layout.operator("wm.read_homefile", text=bpy.path.display_name(iface_(d)), icon=icon) props.app_template = d layout.operator_context = 'EXEC_DEFAULT' @@ -396,8 +372,7 @@ class TOPBAR_MT_file_defaults(Menu): layout.operator("wm.save_homefile") if app_template: display_name = bpy.path.display_name(iface_(app_template)) - props = layout.operator("wm.read_factory_settings", - text="Load Factory Blender Settings") + props = layout.operator("wm.read_factory_settings", text="Load Factory Blender Settings") props.app_template = app_template props = layout.operator("wm.read_factory_settings", text=iface_("Load Factory %s Settings", @@ -435,8 +410,7 @@ class TOPBAR_MT_templates_more(Menu): bl_label = "Templates" def draw(self, context): - bpy.types.TOPBAR_MT_file_new.draw_ex( - self.layout, context, use_more=True) + bpy.types.TOPBAR_MT_file_new.draw_ex(self.layout, context, use_more=True) class TOPBAR_MT_file_import(Menu): @@ -550,10 +524,8 @@ class TOPBAR_MT_render(Menu): rd = context.scene.render - layout.operator("render.render", text="Render Image", - icon='RENDER_STILL').use_viewport = True - props = layout.operator( - "render.render", text="Render Animation", icon='RENDER_ANIMATION') + layout.operator("render.render", text="Render Image", icon='RENDER_STILL').use_viewport = True + props = layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION') props.animation = True props.use_viewport = True @@ -612,8 +584,7 @@ class TOPBAR_MT_edit(Menu): layout.separator() - layout.operator("screen.userpref_show", - text="Preferences...", icon='PREFERENCES') + layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES') class TOPBAR_MT_window(Menu): @@ -634,10 +605,8 @@ class TOPBAR_MT_window(Menu): layout.separator() - layout.operator("screen.workspace_cycle", - text="Next Workspace").direction = 'NEXT' - layout.operator("screen.workspace_cycle", - text="Previous Workspace").direction = 'PREV' + layout.operator("screen.workspace_cycle", text="Next Workspace").direction = 'NEXT' + layout.operator("screen.workspace_cycle", text="Previous Workspace").direction = 'PREV' layout.separator() @@ -718,8 +687,7 @@ class TOPBAR_MT_file_context_menu(Menu): layout.separator() - layout.operator("screen.userpref_show", - text="Preferences...", icon='PREFERENCES') + layout.operator("screen.userpref_show", text="Preferences...", icon='PREFERENCES') class TOPBAR_MT_workspace_menu(Menu): @@ -728,26 +696,21 @@ class TOPBAR_MT_workspace_menu(Menu): def draw(self, _context): layout = self.layout - layout.operator("workspace.duplicate", - text="Duplicate", icon='DUPLICATE') + layout.operator("workspace.duplicate", text="Duplicate", icon='DUPLICATE') if len(bpy.data.workspaces) > 1: layout.operator("workspace.delete", text="Delete", icon='REMOVE') layout.separator() - layout.operator("workspace.reorder_to_front", - text="Reorder to Front", icon='TRIA_LEFT_BAR') - layout.operator("workspace.reorder_to_back", - text="Reorder to Back", icon='TRIA_RIGHT_BAR') + layout.operator("workspace.reorder_to_front", text="Reorder to Front", icon='TRIA_LEFT_BAR') + layout.operator("workspace.reorder_to_back", text="Reorder to Back", icon='TRIA_RIGHT_BAR') layout.separator() # For key binding discoverability. - props = layout.operator("screen.workspace_cycle", - text="Previous Workspace") + props = layout.operator("screen.workspace_cycle", text="Previous Workspace") props.direction = 'PREV' - props = layout.operator( - "screen.workspace_cycle", text="Next Workspace") + props = layout.operator("screen.workspace_cycle", text="Next Workspace") props.direction = 'NEXT' @@ -762,8 +725,7 @@ class TOPBAR_PT_gpencil_primitive(Panel): layout = self.layout # Curve - layout.template_curve_mapping( - settings, "thickness_primitive_curve", brush=True) + layout.template_curve_mapping(settings, "thickness_primitive_curve", brush=True) # Only a popover diff --git a/scripts/startup/bl_ui/space_userpref.py b/scripts/startup/bl_ui/space_userpref.py index 0ade2836ab5..80e61b94da2 100644 --- a/scripts/startup/bl_ui/space_userpref.py +++ b/scripts/startup/bl_ui/space_userpref.py @@ -1021,8 +1021,7 @@ class USERPREF_PT_theme_interface_transparent_checker(ThemePanel, CenterAlignMix theme = context.preferences.themes[0] ui = theme.user_interface - flow = layout.grid_flow( - row_major=False, columns=0, even_columns=True, even_rows=False, align=False) + flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False) col = flow.column(align=True) col.prop(ui, "transparent_checker_primary") diff --git a/scripts/startup/bl_ui/space_view3d.py b/scripts/startup/bl_ui/space_view3d.py index 3a09f2759fd..64a44d34bea 100644 --- a/scripts/startup/bl_ui/space_view3d.py +++ b/scripts/startup/bl_ui/space_view3d.py @@ -843,8 +843,7 @@ class VIEW3D_HT_header(Header): # Curve edit sub-mode. row = layout.row(align=True) - row.prop(gpd, "use_curve_edit", text="", - icon='IPO_BEZIER') + row.prop(gpd, "use_curve_edit", text="", icon='IPO_BEZIER') sub = row.row(align=True) sub.active = gpd.use_curve_edit sub.popover( @@ -974,8 +973,7 @@ class VIEW3D_HT_header(Header): row.popover(panel="VIEW3D_PT_slots_projectpaint", icon=icon) row.popover( panel="VIEW3D_PT_mask", - icon=VIEW3D_HT_header._texture_mask_icon( - tool_settings.image_paint), + icon=VIEW3D_HT_header._texture_mask_icon(tool_settings.image_paint), text="") else: # Transform settings depending on tool header visibility @@ -3138,9 +3136,7 @@ class VIEW3D_MT_object_apply(Menu): text_ctxt=i18n_contexts.default, ).target = 'MESH' layout.operator("object.duplicates_make_real") - layout.operator("object.parent_inverse_apply", - text="Parent Inverse", - text_ctxt=i18n_contexts.default) + layout.operator("object.parent_inverse_apply", text="Parent Inverse", text_ctxt=i18n_contexts.default) layout.template_node_operator_asset_menu_items(catalog_path="Object/Apply") @@ -4113,8 +4109,7 @@ class VIEW3D_MT_bone_collections(Menu): layout.separator() layout.operator("armature.collection_show_all") - props = layout.operator("armature.collection_create_and_assign", - text="Assign to New Collection") + props = layout.operator("armature.collection_create_and_assign", text="Assign to New Collection") props.name = "New Collection" @@ -4496,12 +4491,9 @@ class VIEW3D_MT_edit_mesh_context_menu(Menu): col.separator() - col.operator("view3d.edit_mesh_extrude_move_normal", - text="Extrude Faces") - col.operator("view3d.edit_mesh_extrude_move_shrink_fatten", - text="Extrude Faces Along Normals") - col.operator("mesh.extrude_faces_move", - text="Extrude Individual Faces") + col.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Faces") + col.operator("view3d.edit_mesh_extrude_move_shrink_fatten", text="Extrude Faces Along Normals") + col.operator("mesh.extrude_faces_move", text="Extrude Individual Faces") col.operator("mesh.inset") col.operator("mesh.poke") @@ -4561,23 +4553,16 @@ class VIEW3D_MT_edit_mesh_extrude(Menu): mesh = context.object.data if mesh.total_face_sel: - layout.operator("view3d.edit_mesh_extrude_move_normal", - text="Extrude Faces") - layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten", - text="Extrude Faces Along Normals") - layout.operator( - "mesh.extrude_faces_move", - text="Extrude Individual Faces") - layout.operator("view3d.edit_mesh_extrude_manifold_normal", - text="Extrude Manifold") + layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Faces") + layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten", text="Extrude Faces Along Normals") + layout.operator("mesh.extrude_faces_move", text="Extrude Individual Faces") + layout.operator("view3d.edit_mesh_extrude_manifold_normal", text="Extrude Manifold") if mesh.total_edge_sel and (select_mode[0] or select_mode[1]): - layout.operator("mesh.extrude_edges_move", - text="Extrude Edges") + layout.operator("mesh.extrude_edges_move", text="Extrude Edges") if mesh.total_vert_sel and select_mode[0]: - layout.operator("mesh.extrude_vertices_move", - text="Extrude Vertices") + layout.operator("mesh.extrude_vertices_move", text="Extrude Vertices") layout.separator() @@ -4742,10 +4727,8 @@ class VIEW3D_MT_edit_mesh_faces(Menu): layout.operator_context = 'INVOKE_REGION_WIN' - layout.operator("view3d.edit_mesh_extrude_move_normal", - text="Extrude Faces") - layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten", - text="Extrude Faces Along Normals") + layout.operator("view3d.edit_mesh_extrude_move_normal", text="Extrude Faces") + layout.operator("view3d.edit_mesh_extrude_move_shrink_fatten", text="Extrude Faces Along Normals") layout.operator("mesh.extrude_faces_move", text="Extrude Individual Faces") layout.separator() @@ -5665,8 +5648,7 @@ class VIEW3D_MT_edit_gpencil_stroke(Menu): layout.separator() - layout.operator_menu_enum("gpencil.stroke_join", "type", text="Join", - text_ctxt=i18n_contexts.id_gpencil) + layout.operator_menu_enum("gpencil.stroke_join", "type", text="Join", text_ctxt=i18n_contexts.id_gpencil) layout.separator() @@ -8156,8 +8138,7 @@ class VIEW3D_MT_gpencil_edit_context_menu(Menu): # Removal Operators col.operator("gpencil.stroke_merge_by_distance").use_unselected = True - col.operator_menu_enum("gpencil.stroke_join", "type", text="Join", - text_ctxt=i18n_contexts.id_gpencil) + col.operator_menu_enum("gpencil.stroke_join", "type", text="Join", text_ctxt=i18n_contexts.id_gpencil) col.operator("gpencil.stroke_split", text="Split") col.operator("gpencil.stroke_separate", text="Separate").mode = 'STROKE' diff --git a/scripts/startup/bl_ui/space_view3d_toolbar.py b/scripts/startup/bl_ui/space_view3d_toolbar.py index fc11aca7ef3..babbb5f1cc6 100644 --- a/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -743,8 +743,7 @@ class VIEW3D_PT_stencil_projectpaint(Panel): def draw_header(self, context): ipaint = context.tool_settings.image_paint - self.layout.prop(ipaint, "use_stencil_layer", - text=self.bl_label if self.is_popover else "") + self.layout.prop(ipaint, "use_stencil_layer", text=self.bl_label if self.is_popover else "") def draw(self, context): layout = self.layout @@ -926,8 +925,7 @@ class VIEW3D_PT_tools_brush_falloff_frontface(View3DPaintPanel, Panel): settings = self.paint_settings(context) brush = settings.brush - self.layout.prop(brush, "use_frontface_falloff", - text=self.bl_label if self.is_popover else "") + self.layout.prop(brush, "use_frontface_falloff", text=self.bl_label if self.is_popover else "") def draw(self, context): settings = self.paint_settings(context) @@ -956,8 +954,7 @@ class VIEW3D_PT_tools_brush_falloff_normal(View3DPaintPanel, Panel): tool_settings = context.tool_settings ipaint = tool_settings.image_paint - self.layout.prop(ipaint, "use_normal_falloff", - text=self.bl_label if self.is_popover else "") + self.layout.prop(ipaint, "use_normal_falloff", text=self.bl_label if self.is_popover else "") def draw(self, context): tool_settings = context.tool_settings @@ -1406,8 +1403,7 @@ class VIEW3D_PT_tools_imagepaint_options_cavity(Panel): tool_settings = context.tool_settings ipaint = tool_settings.image_paint - self.layout.prop(ipaint, "use_cavity", - text=self.bl_label if self.is_popover else "") + self.layout.prop(ipaint, "use_cavity", text=self.bl_label if self.is_popover else "") def draw(self, context): layout = self.layout @@ -1417,8 +1413,7 @@ class VIEW3D_PT_tools_imagepaint_options_cavity(Panel): layout.active = ipaint.use_cavity - layout.template_curve_mapping(ipaint, "cavity_curve", brush=True, - use_negative_slope=True) + layout.template_curve_mapping(ipaint, "cavity_curve", brush=True, use_negative_slope=True) # TODO, move to space_view3d.py @@ -1706,8 +1701,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_advanced(View3DPanel, Panel): elif brush.gpencil_tool == 'FILL': row = col.row(align=True) - row.prop(gp_settings, "fill_draw_mode", text="Boundary", - text_ctxt=i18n_contexts.id_gpencil) + row.prop(gp_settings, "fill_draw_mode", text="Boundary", text_ctxt=i18n_contexts.id_gpencil) row.prop( gp_settings, "show_fill_boundary", @@ -1771,8 +1765,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_stabilizer(Panel, View3DPanel): brush = context.tool_settings.gpencil_paint.brush gp_settings = brush.gpencil_settings self.layout.use_property_split = False - self.layout.prop(gp_settings, "use_settings_stabilizer", - text=self.bl_label if self.is_popover else "") + self.layout.prop(gp_settings, "use_settings_stabilizer", text=self.bl_label if self.is_popover else "") def draw(self, context): layout = self.layout @@ -1805,8 +1798,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_post_processing(View3DPanel, Panel): brush = context.tool_settings.gpencil_paint.brush gp_settings = brush.gpencil_settings self.layout.use_property_split = False - self.layout.prop(gp_settings, "use_settings_postprocess", - text=self.bl_label if self.is_popover else "") + self.layout.prop(gp_settings, "use_settings_postprocess", text=self.bl_label if self.is_popover else "") def draw(self, context): layout = self.layout @@ -1861,8 +1853,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel): brush = context.tool_settings.gpencil_paint.brush gp_settings = brush.gpencil_settings self.layout.use_property_split = False - self.layout.prop(gp_settings, "use_settings_random", - text=self.bl_label if self.is_popover else "") + self.layout.prop(gp_settings, "use_settings_random", text=self.bl_label if self.is_popover else "") def draw(self, context): layout = self.layout @@ -1882,24 +1873,21 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel): row.prop(gp_settings, "use_stroke_random_radius", text="", icon='GP_SELECT_STROKES') 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) + col.template_curve_mapping(gp_settings, "curve_random_pressure", brush=True, use_negative_slope=True) row = col.row(align=True) row.prop(gp_settings, "random_strength", text="Strength", slider=True) row.prop(gp_settings, "use_stroke_random_strength", text="", icon='GP_SELECT_STROKES') 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) + col.template_curve_mapping(gp_settings, "curve_random_strength", brush=True, use_negative_slope=True) row = col.row(align=True) row.prop(gp_settings, "uv_random", text="UV", slider=True) row.prop(gp_settings, "use_stroke_random_uv", text="", icon='GP_SELECT_STROKES') 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) + col.template_curve_mapping(gp_settings, "curve_random_uv", brush=True, use_negative_slope=True) col.separator() @@ -1910,24 +1898,21 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel): row.prop(gp_settings, "use_stroke_random_hue", text="", icon='GP_SELECT_STROKES') 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) + col1.template_curve_mapping(gp_settings, "curve_random_hue", brush=True, use_negative_slope=True) row = col1.row(align=True) row.prop(gp_settings, "random_saturation_factor", slider=True) row.prop(gp_settings, "use_stroke_random_sat", text="", icon='GP_SELECT_STROKES') 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) + col1.template_curve_mapping(gp_settings, "curve_random_saturation", brush=True, use_negative_slope=True) row = col1.row(align=True) row.prop(gp_settings, "random_value_factor", slider=True) row.prop(gp_settings, "use_stroke_random_val", text="", icon='GP_SELECT_STROKES') 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) + col1.template_curve_mapping(gp_settings, "curve_random_value", brush=True, use_negative_slope=True) col.separator() @@ -1935,8 +1920,7 @@ class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel): row.prop(gp_settings, "pen_jitter", slider=True) 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) + col.template_curve_mapping(gp_settings, "curve_jitter", brush=True, use_negative_slope=True) class VIEW3D_PT_tools_grease_pencil_brush_paint_falloff(GreasePencilBrushFalloff, Panel, View3DPaintPanel):