diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 05:01:40 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-20 05:11:04 +0300 |
commit | e71d489254c9d9639902e3ae8d2393a902eb11c8 (patch) | |
tree | 38f62429ed1331123658fdcf1e0fdfc64f1aec5f /release | |
parent | 592165665543607bf43fdb13c4d2d7e51b37e8c6 (diff) |
Cleanup: style
Diffstat (limited to 'release')
16 files changed, 44 insertions, 31 deletions
diff --git a/release/scripts/startup/bl_operators/view3d.py b/release/scripts/startup/bl_operators/view3d.py index 58ddc50c808..9e27edaa3be 100644 --- a/release/scripts/startup/bl_operators/view3d.py +++ b/release/scripts/startup/bl_operators/view3d.py @@ -187,7 +187,7 @@ class VIEW3D_OT_select_or_deselect_all(Operator): def invoke(self, context, event): retval = bpy.ops.view3d.select( 'INVOKE_DEFAULT', - True, # undo push + True, # undo push extend=self.extend, deselect=self.deselect, toggle=self.toggle, diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index bf968de8641..4461812cc2e 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -1124,7 +1124,6 @@ class WM_OT_properties_edit(Operator): return value_eval - def get_default_eval(self): try: default_eval = eval(self.default) @@ -1135,7 +1134,6 @@ class WM_OT_properties_edit(Operator): return default_eval - def execute(self, context): from rna_prop_ui import ( rna_idprop_ui_prop_get, @@ -1252,7 +1250,7 @@ class WM_OT_properties_edit(Operator): # default default value prop_type = type(self.get_value_eval()) - if prop_type in {int,float}: + if prop_type in {int, float}: self.default = str(prop_type(0)) else: self.default = "" @@ -1315,7 +1313,7 @@ class WM_OT_properties_edit(Operator): layout.prop(self, "value") row = layout.row() - row.enabled = type(self.get_value_eval()) in {int,float} + row.enabled = type(self.get_value_eval()) in {int, float} row.prop(self, "default") row = layout.row(align=True) @@ -2396,6 +2394,7 @@ class WM_OT_toolbar(Operator): if use_toolbar_release_hack: _key_held = None + def invoke(self, context, event): WM_OT_toolbar._key_held = event.type return self.execute(context) @@ -2520,7 +2519,7 @@ class WM_OT_studiolight_new(Operator): except: traceback.print_exc() - finalpath = str(path_studiolights.joinpath(self.filename)); + finalpath = str(path_studiolights.joinpath(self.filename)) if pathlib.Path(finalpath + ".sl").is_file(): if not self.ask_overide: self.ask_overide = True @@ -2678,7 +2677,7 @@ class WM_MT_splash(Menu): #sub = col.split(factor=0.35) #row = sub.row() #row.alignment = 'RIGHT' - #row.label(text="Language:") + # row.label(text="Language:") #userpref = context.user_preferences #sub.prop(userpref.system, "language", text="") @@ -2808,6 +2807,7 @@ class WM_OT_drop_blend_file(Operator): col.operator("wm.link", text="Link...", icon='LINK_BLEND').filepath = self.filepath col.operator("wm.append", text="Append...", icon='APPEND_BLEND').filepath = self.filepath + classes = ( WM_OT_addon_disable, WM_OT_addon_enable, diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py index 56612c3aa1b..f1205b05f3d 100644 --- a/release/scripts/startup/bl_ui/properties_data_gpencil.py +++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py @@ -143,7 +143,7 @@ class DATA_PT_gpencil_datapanel(Panel): srow = col.row(align=True) srow.prop(gpl, "opacity", text="Opacity", slider=True) srow.prop(gpl, "clamp_layer", text="", - icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE') + icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE') col = row.column() diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index 7641851b183..3d4f3037a84 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -615,7 +615,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): layout.separator() col = layout.column() - flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) col.label(text="Textures:") @@ -635,7 +634,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel): col.prop(md, "offset_u") col.prop(md, "offset_v") - def MULTIRES(self, layout, ob, md): layout.row().prop(md, "subdivision_type", expand=True) 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 9ba2c0645d1..11aeb741352 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -983,8 +983,8 @@ class GPENCIL_UL_layer(UIList): row = layout.row(align=True) row.prop(gpl, "clamp_layer", text="", - icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE', - emboss=False) + icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE', + emboss=False) row.prop(gpl, "lock", text="", emboss=False) row.prop(gpl, "hide", text="", emboss=False) diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index 76eee827553..72f48457faa 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -311,6 +311,7 @@ def brush_mask_texture_settings(layout, brush): col.prop(mask_tex_slot, "offset") col.prop(mask_tex_slot, "scale") + classes = ( VIEW3D_MT_tools_projectpaint_clone, ) diff --git a/release/scripts/startup/bl_ui/properties_render.py b/release/scripts/startup/bl_ui/properties_render.py index 9f24945573b..a45c2bc0d27 100644 --- a/release/scripts/startup/bl_ui/properties_render.py +++ b/release/scripts/startup/bl_ui/properties_render.py @@ -148,6 +148,7 @@ class RENDER_PT_eevee_ambient_occlusion(RenderButtonsPanel, Panel): col.prop(props, "use_gtao_bent_normals") col.prop(props, "use_gtao_bounce") + class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel): bl_label = "Motion Blur" bl_options = {'DEFAULT_CLOSED'} @@ -505,7 +506,6 @@ class RENDER_PT_eevee_film(RenderButtonsPanel, Panel): col.prop(rd, "alpha_mode", text="Alpha") - class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel): bl_label = "Hair" bl_options = {'DEFAULT_CLOSED'} diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 47c5de861ca..f0f8cf1028d 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -423,6 +423,7 @@ class DOPESHEET_MT_marker(Menu): ####################################### # Keyframe Editing + class DOPESHEET_MT_channel(Menu): bl_label = "Channel" diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index 6b407daaccb..73afb62567c 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -145,7 +145,6 @@ class NODE_HT_header(Header): layout.template_ID(snode, "node_tree", new="node.new_node_tree") - layout.prop(snode, "pin", text="") layout.separator_spacer() @@ -576,9 +575,11 @@ class EEVEE_NODE_PT_material_settings(Panel): @classmethod def poll(cls, context): snode = context.space_data - return (context.engine in cls.COMPAT_ENGINES) and \ - snode.tree_type == 'ShaderNodeTree' and snode.id and \ - snode.id.bl_rna.identifier == 'Material' + return ( + (context.engine in cls.COMPAT_ENGINES) and + (snode.tree_type == 'ShaderNodeTree' and snode.id) and + (snode.id.bl_rna.identifier == 'Material') + ) def draw(self, context): material = context.space_data.id @@ -595,8 +596,10 @@ class NODE_PT_material_viewport(Panel): @classmethod def poll(cls, context): snode = context.space_data - return snode.tree_type == 'ShaderNodeTree' and snode.id and \ - snode.id.bl_rna.identifier == 'Material' + return ( + (snode.tree_type == 'ShaderNodeTree' and snode.id) and + (snode.id.bl_rna.identifier == "Material") + ) def draw(self, context): material = context.space_data.id diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index a018a64e91c..b6c42d9208d 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -99,7 +99,7 @@ class SEQUENCER_HT_header(Header): if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}: layout.separator() - layout.operator("sequencer.refresh_all", icon="FILE_REFRESH", text="") + layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="") if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}: layout.prop(st, "display_mode", text="", icon_only=True) @@ -408,7 +408,7 @@ class SEQUENCER_MT_add_effect(Menu): col.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER' col.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER' col.operator("sequencer.effect_strip_add", text="Color Mix").type = 'COLORMIX' - col.enabled = sel_sequences(context) >=2 + col.enabled = sel_sequences(context) >= 2 layout.separator() diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py index d8a8c2a268e..9d13bd93c86 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_common.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py @@ -631,6 +631,7 @@ def _activate_by_item(context, space_type, item, index): handle = WindowManager.draw_cursor_add(handle_fn, (context, item, tool), space_type) handle_map[space_type] = handle + _activate_by_item._cursor_draw_handle = {} diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 24af3ce1318..a4ca27e8f48 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -32,6 +32,7 @@ from .space_toolsystem_common import ( ToolDef, ) + def generate_from_enum_ex( context, *, icon_prefix, @@ -873,6 +874,7 @@ class _defs_vertex_paint: attr="vertex_tool", ) + class _defs_texture_paint: @staticmethod @@ -1108,6 +1110,7 @@ class _defs_gpencil_paint: keymap=(), ) + class _defs_gpencil_edit: @ToolDef.from_fn def bend(): diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py index 7b666d86dc1..67530ba71ee 100644 --- a/release/scripts/startup/bl_ui/space_topbar.py +++ b/release/scripts/startup/bl_ui/space_topbar.py @@ -540,7 +540,7 @@ class TOPBAR_PT_gpencil_layers(Panel): srow = col.row(align=True) srow.prop(gpl, "opacity", text="Opacity", slider=True) srow.prop(gpl, "clamp_layer", text="", - icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE') + icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE') col = row.column() diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 88bfa8a2e24..541158796e5 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -1571,7 +1571,7 @@ class USERPREF_PT_studiolight_light_editor(Panel): row = layout.row() row.prop(system, "edit_studio_light", toggle=True) - row.operator("wm.studiolight_new", text="Save as Studio light", icon="FILE_TICK") + row.operator("wm.studiolight_new", text="Save as Studio light", icon='FILE_TICK') layout.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index d6f27a3e0bc..3507ddb6c1f 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -4417,7 +4417,7 @@ class VIEW3D_PT_shading_lighting(Panel): sub.scale_y = 0.6 # smaller studiolight preview sub.template_icon_view(shading, "studio_light", scale=3) else: - sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon="NONE", toggle=True) + sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon='NONE', toggle=True) col = split.column() col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES') @@ -4426,7 +4426,7 @@ class VIEW3D_PT_shading_lighting(Panel): col = split.column() row = col.row() - row.prop(shading, "use_world_space_lighting", text="", icon="WORLD", toggle=True) + row.prop(shading, "use_world_space_lighting", text="", icon='WORLD', toggle=True) row = row.row() row.active = shading.use_world_space_lighting row.prop(shading, "studiolight_rotate_z", text="Rotation") @@ -5263,7 +5263,7 @@ class VIEW3D_PT_transform_orientations(Panel): if orientation: row = layout.row(align=False) - row.prop(orientation, "name", text="", icon="OBJECT_ORIGIN") + row.prop(orientation, "name", text="", icon='OBJECT_ORIGIN') row.operator("transform.delete_orientation", text="", icon='X', emboss=False) diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 24ce5c5788d..5d7d9f3a675 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -631,13 +631,12 @@ class VIEW3D_PT_tools_brush_overlay(Panel, View3DPaintPanel): col = layout.column() - row = col.row(align=True) sub = row.row(align=True) sub.prop(brush, "cursor_overlay_alpha", text="Curve Alpha") sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA') - row.prop(brush,"use_cursor_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON') + row.prop(brush, "use_cursor_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON') col.active = brush.brush_capabilities.has_overlay @@ -925,6 +924,8 @@ class VIEW3D_PT_sculpt_dyntopo_remesh(Panel, View3DPaintPanel): col.operator("sculpt.detail_flood_fill") # TODO, move to space_view3d.py + + class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): bl_context = ".sculpt_mode" # dot on purpose (access from topbar) bl_label = "Options" @@ -972,6 +973,7 @@ class VIEW3D_PT_sculpt_options_unified(Panel, View3DPaintPanel): self.unified_paint_settings(layout, context) + class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel): bl_context = ".sculpt_mode" # dot on purpose (access from topbar) bl_parent_id = "VIEW3D_PT_sculpt_options" @@ -1302,6 +1304,7 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel): col = flow.column() col.prop(ipaint, "use_backface_culling") + class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel): bl_context = ".imagepaint" # dot on purpose (access from topbar) bl_parent_id = "VIEW3D_PT_tools_projectpaint" @@ -1314,6 +1317,7 @@ class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel): self.unified_paint_settings(layout, context) + class VIEW3D_PT_tools_projectpaint_cavity(View3DPaintPanel, Panel): bl_context = ".imagepaint" # dot on purpose (access from topbar) bl_label = "Cavity Mask" @@ -1454,6 +1458,8 @@ class VIEW3D_PT_tools_normal(View3DPanel, Panel): # ********** grease pencil object tool panels **************** # Grease Pencil drawing brushes + + class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel): bl_context = ".greasepencil_paint" bl_label = "Brush" @@ -1702,7 +1708,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves(View3DPanel, Panel): class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel): bl_context = ".greasepencil_paint" bl_label = "Sensitivity" - bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves" + bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves" @staticmethod def draw(self, context): @@ -1718,7 +1724,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel): class VIEW3D_PT_tools_grease_pencil_brushcurves_strength(View3DPanel, Panel): bl_context = ".greasepencil_paint" bl_label = "Strength" - bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves" + bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves" @staticmethod def draw(self, context): @@ -1734,7 +1740,7 @@ class VIEW3D_PT_tools_grease_pencil_brushcurves_strength(View3DPanel, Panel): class VIEW3D_PT_tools_grease_pencil_brushcurves_jitter(View3DPanel, Panel): bl_context = ".greasepencil_paint" bl_label = "Jitter" - bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves" + bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves" @staticmethod def draw(self, context): |