diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-17 09:20:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-17 09:22:50 +0300 |
commit | 42b9df5907d041a5a68585308b1e11b2eac2c947 (patch) | |
tree | 571862dcfcafbd707a44eb2b7d5b98718c012d9b /release/scripts | |
parent | 98f43ba3e4cb0a26eb62ea98e27a313265f8948c (diff) |
Cleanup: use 'tool_settings' name everywhere in UI scripts
Diffstat (limited to 'release/scripts')
-rw-r--r-- | release/scripts/startup/bl_operators/wm.py | 4 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_grease_pencil_common.py | 32 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_paint_common.py | 14 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_clip.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_dopesheet.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_graph.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 116 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_node.py | 10 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 8 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_time.py | 22 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 98 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 66 |
12 files changed, 201 insertions, 193 deletions
diff --git a/release/scripts/startup/bl_operators/wm.py b/release/scripts/startup/bl_operators/wm.py index 0f3052f64c2..cc40ca2cb66 100644 --- a/release/scripts/startup/bl_operators/wm.py +++ b/release/scripts/startup/bl_operators/wm.py @@ -171,10 +171,10 @@ class BRUSH_OT_active_index_set(Operator): if attr is None: return {'CANCELLED'} - toolsettings = context.tool_settings + tool_settings = context.tool_settings for i, brush in enumerate((cur for cur in bpy.data.brushes if getattr(cur, attr))): if i == self.index: - getattr(toolsettings, self.mode).brush = brush + getattr(tool_settings, self.mode).brush = brush return {'FINISHED'} return {'CANCELLED'} 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 373e3797f71..099de6e5e42 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -33,30 +33,30 @@ def gpencil_stroke_placement_settings(context, layout): else: propname = "gpencil_stroke_placement_view2d" - ts = context.tool_settings + tool_settings = context.tool_settings col = layout.column(align=True) col.label(text="Stroke Placement:") row = col.row(align=True) - row.prop_enum(ts, propname, 'VIEW') - row.prop_enum(ts, propname, 'CURSOR') + row.prop_enum(tool_settings, propname, 'VIEW') + row.prop_enum(tool_settings, propname, 'CURSOR') if context.space_data.type == 'VIEW_3D': row = col.row(align=True) - row.prop_enum(ts, propname, 'SURFACE') - row.prop_enum(ts, propname, 'STROKE') + row.prop_enum(tool_settings, propname, 'SURFACE') + row.prop_enum(tool_settings, propname, 'STROKE') row = col.row(align=False) - row.active = getattr(ts, propname) in {'SURFACE', 'STROKE'} - row.prop(ts, "use_gpencil_stroke_endpoints") + row.active = getattr(tool_settings, propname) in {'SURFACE', 'STROKE'} + row.prop(tool_settings, "use_gpencil_stroke_endpoints") if context.scene.tool_settings.gpencil_stroke_placement_view3d == 'CURSOR': row = col.row(align=True) row.label("Lock axis:") row = col.row(align=True) - row.prop(ts.gpencil_sculpt, "lockaxis", expand=True) + row.prop(tool_settings.gpencil_sculpt, "lockaxis", expand=True) def gpencil_active_brush_settings_simple(context, layout): @@ -313,12 +313,20 @@ class GreasePencilBrushPanel: row = layout.row() col = row.column() - ts = context.scene.tool_settings - if len(ts.gpencil_brushes) >= 2: + tool_settings = context.scene.tool_settings + if len(tool_settings.gpencil_brushes) >= 2: brows = 3 else: brows = 2 - col.template_list("GPENCIL_UL_brush", "", ts, "gpencil_brushes", ts.gpencil_brushes, "active_index", rows=brows) + col.template_list( + "GPENCIL_UL_brush", + "", + tool_settings, + "gpencil_brushes", + tool_settings.gpencil_brushes, + "active_index", + rows=brows, + ) col = row.column() @@ -328,7 +336,7 @@ class GreasePencilBrushPanel: sub.menu("GPENCIL_MT_brush_specials", icon='DOWNARROW_HLT', text="") brush = context.active_gpencil_brush if brush: - if len(ts.gpencil_brushes) > 1: + if len(tool_settings.gpencil_brushes) > 1: col.separator() sub = col.column(align=True) sub.operator("gpencil.brush_move", icon='TRIA_UP', text="").type = 'UP' diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py index b4049bf7b68..bda926f63db 100644 --- a/release/scripts/startup/bl_ui/properties_paint_common.py +++ b/release/scripts/startup/bl_ui/properties_paint_common.py @@ -27,21 +27,21 @@ class UnifiedPaintPanel: @staticmethod def paint_settings(context): - toolsettings = context.tool_settings + tool_settings = context.tool_settings if context.sculpt_object: - return toolsettings.sculpt + return tool_settings.sculpt elif context.vertex_paint_object: - return toolsettings.vertex_paint + return tool_settings.vertex_paint elif context.weight_paint_object: - return toolsettings.weight_paint + return tool_settings.weight_paint elif context.image_paint_object: - if (toolsettings.image_paint and toolsettings.image_paint.detect_data()): - return toolsettings.image_paint + if (tool_settings.image_paint and tool_settings.image_paint.detect_data()): + return tool_settings.image_paint return None elif context.particle_edit_object: - return toolsettings.particle_edit + return tool_settings.particle_edit return None diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index acc91edc410..d4a3f924238 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -119,7 +119,7 @@ class CLIP_HT_header(Header): def _draw_masking(self, context): layout = self.layout - toolsettings = context.tool_settings + tool_settings = context.tool_settings sc = context.space_data clip = sc.clip @@ -140,10 +140,10 @@ class CLIP_HT_header(Header): layout.prop(sc, "pivot_point", text="", icon_only=True) row = layout.row(align=True) - row.prop(toolsettings, "use_proportional_edit_mask", + row.prop(tool_settings, "use_proportional_edit_mask", text="", icon_only=True) - if toolsettings.use_proportional_edit_mask: - row.prop(toolsettings, "proportional_edit_falloff", + if tool_settings.use_proportional_edit_mask: + row.prop(tool_settings, "proportional_edit_falloff", text="", icon_only=True) def draw(self, context): diff --git a/release/scripts/startup/bl_ui/space_dopesheet.py b/release/scripts/startup/bl_ui/space_dopesheet.py index 731032bafa8..4683b108e37 100644 --- a/release/scripts/startup/bl_ui/space_dopesheet.py +++ b/release/scripts/startup/bl_ui/space_dopesheet.py @@ -114,7 +114,7 @@ class DOPESHEET_HT_header(Header): layout = self.layout st = context.space_data - toolsettings = context.tool_settings + tool_settings = context.tool_settings row = layout.row(align=True) row.template_header() @@ -158,10 +158,10 @@ class DOPESHEET_HT_header(Header): row.prop(st.dopesheet, "use_multi_word_filter", text="") row = layout.row(align=True) - row.prop(toolsettings, "use_proportional_action", + row.prop(tool_settings, "use_proportional_action", text="", icon_only=True) - if toolsettings.use_proportional_action: - row.prop(toolsettings, "proportional_edit_falloff", + if tool_settings.use_proportional_action: + row.prop(tool_settings, "proportional_edit_falloff", text="", icon_only=True) # Grease Pencil mode doesn't need snapping, as it's frame-aligned only diff --git a/release/scripts/startup/bl_ui/space_graph.py b/release/scripts/startup/bl_ui/space_graph.py index 5ed58a57e47..7a920435b18 100644 --- a/release/scripts/startup/bl_ui/space_graph.py +++ b/release/scripts/startup/bl_ui/space_graph.py @@ -29,7 +29,7 @@ class GRAPH_HT_header(Header): from .space_dopesheet import dopesheet_filter layout = self.layout - toolsettings = context.tool_settings + tool_settings = context.tool_settings st = context.space_data @@ -50,10 +50,10 @@ class GRAPH_HT_header(Header): row = layout.row(align=True) - row.prop(toolsettings, "use_proportional_fcurve", + row.prop(tool_settings, "use_proportional_fcurve", text="", icon_only=True) - if toolsettings.use_proportional_fcurve: - row.prop(toolsettings, "proportional_edit_falloff", + if tool_settings.use_proportional_fcurve: + row.prop(tool_settings, "proportional_edit_falloff", text="", icon_only=True) layout.prop(st, "auto_snap", text="") diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 9a2215969cf..eb903f25f79 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -50,8 +50,8 @@ class BrushButtonsPanel(UnifiedPaintPanel): @classmethod def poll(cls, context): sima = context.space_data - toolsettings = context.tool_settings.image_paint - return sima.show_paint and toolsettings.brush + tool_settings = context.tool_settings.image_paint + return sima.show_paint and tool_settings.brush class UVToolsPanel: @@ -73,8 +73,8 @@ class IMAGE_MT_view(Menu): sima = context.space_data uv = sima.uv_editor - toolsettings = context.tool_settings - paint = toolsettings.image_paint + tool_settings = context.tool_settings + paint = tool_settings.image_paint show_uvedit = sima.show_uvedit show_render = sima.show_render @@ -86,13 +86,13 @@ class IMAGE_MT_view(Menu): layout.prop(sima, "use_realtime_update") if show_uvedit: - layout.prop(toolsettings, "show_uv_local_view") + layout.prop(tool_settings, "show_uv_local_view") layout.prop(uv, "show_other_objects") layout.prop(uv, "show_metadata") if paint.brush and (context.image_paint_object or sima.mode == 'PAINT'): layout.prop(uv, "show_texpaint") - layout.prop(toolsettings, "show_uv_local_view", text="Show Same Material") + layout.prop(tool_settings, "show_uv_local_view", text="Show Same Material") layout.separator() @@ -170,8 +170,8 @@ class IMAGE_MT_brush(Menu): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - settings = toolsettings.image_paint + tool_settings = context.tool_settings + settings = tool_settings.image_paint brush = settings.brush ups = context.tool_settings.unified_paint_settings @@ -343,14 +343,14 @@ class IMAGE_MT_uvs(Menu): sima = context.space_data uv = sima.uv_editor - toolsettings = context.tool_settings + tool_settings = context.tool_settings layout.prop(uv, "use_snap_to_pixels") layout.prop(uv, "lock_bounds") layout.separator() - layout.prop(toolsettings, "use_uv_sculpt") + layout.prop(tool_settings, "use_uv_sculpt") layout.separator() @@ -393,11 +393,11 @@ class IMAGE_MT_uvs_select_mode(Menu): layout = self.layout layout.operator_context = 'INVOKE_REGION_WIN' - toolsettings = context.tool_settings + tool_settings = context.tool_settings # do smart things depending on whether uv_select_sync is on - if toolsettings.use_uv_select_sync: + if tool_settings.use_uv_select_sync: props = layout.operator("wm.context_set_value", text="Vertex", icon='VERTEXSEL') props.value = "(True, False, False)" props.data_path = "tool_settings.mesh_select_mode" @@ -437,7 +437,7 @@ class IMAGE_HT_header(Header): sima = context.space_data ima = sima.image iuser = sima.image_user - toolsettings = context.tool_settings + tool_settings = context.tool_settings mode = sima.mode show_render = sima.show_render @@ -465,24 +465,24 @@ class IMAGE_HT_header(Header): if show_uvedit: uvedit = sima.uv_editor - layout.prop(toolsettings, "use_uv_select_sync", text="") + layout.prop(tool_settings, "use_uv_select_sync", text="") - if toolsettings.use_uv_select_sync: + if tool_settings.use_uv_select_sync: layout.template_edit_mode_selection() else: - layout.prop(toolsettings, "uv_select_mode", text="", expand=True) + layout.prop(tool_settings, "uv_select_mode", text="", expand=True) layout.prop(uvedit, "sticky_select_mode", icon_only=True) row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - if toolsettings.proportional_edit != 'DISABLED': - row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + if tool_settings.proportional_edit != 'DISABLED': + row.prop(tool_settings, "proportional_edit_falloff", icon_only=True) row = layout.row(align=True) - row.prop(toolsettings, "use_snap", text="") - row.prop(toolsettings, "snap_uv_element", icon_only=True) - if toolsettings.snap_uv_element != 'INCREMENT': - row.prop(toolsettings, "snap_target", text="") + row.prop(tool_settings, "use_snap", text="") + row.prop(tool_settings, "snap_uv_element", icon_only=True) + if tool_settings.snap_uv_element != 'INCREMENT': + row.prop(tool_settings, "snap_target", text="") mesh = context.edit_object.data layout.prop_search(mesh.uv_textures, "active", mesh, "uv_textures", text="") @@ -848,8 +848,8 @@ class IMAGE_PT_tools_brush_overlay(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + tool_settings = context.tool_settings.image_paint + brush = tool_settings.brush tex_slot = brush.texture_slot tex_slot_mask = brush.mask_texture_slot @@ -902,8 +902,8 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + tool_settings = context.tool_settings.image_paint + brush = tool_settings.brush col = layout.column() col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8) @@ -935,8 +935,8 @@ class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + tool_settings = context.tool_settings.image_paint + brush = tool_settings.brush layout.prop(brush, "image_tool", text="") @@ -955,8 +955,8 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + tool_settings = context.tool_settings.image_paint + brush = tool_settings.brush col = layout.column() @@ -1012,7 +1012,7 @@ class IMAGE_PT_paint_stroke(BrushButtonsPanel, Panel): col.separator() - col.prop(toolsettings, "input_samples") + col.prop(tool_settings, "input_samples") class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): @@ -1023,8 +1023,8 @@ class IMAGE_PT_paint_curve(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + tool_settings = context.tool_settings.image_paint + brush = tool_settings.brush layout.template_curve_mapping(brush, "curve") @@ -1047,8 +1047,8 @@ class IMAGE_PT_tools_imagepaint_symmetry(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - ipaint = toolsettings.image_paint + tool_settings = context.tool_settings + ipaint = tool_settings.image_paint col = layout.column(align=True) row = col.row(align=True) @@ -1064,8 +1064,8 @@ class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint - brush = toolsettings.brush + tool_settings = context.tool_settings.image_paint + brush = tool_settings.brush if brush is None: # unlikely but can happen layout.label(text="Brush Unset") @@ -1073,9 +1073,9 @@ class IMAGE_PT_tools_brush_appearance(BrushButtonsPanel, Panel): col = layout.column(align=True) - col.prop(toolsettings, "show_brush") + col.prop(tool_settings, "show_brush") sub = col.column() - sub.active = toolsettings.show_brush + sub.active = tool_settings.show_brush sub.prop(brush, "cursor_color_add", text="") col.separator() @@ -1093,10 +1093,10 @@ class IMAGE_PT_tools_paint_options(BrushButtonsPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - # brush = toolsettings.image_paint.brush + tool_settings = context.tool_settings + # brush = tool_settings.image_paint.brush - ups = toolsettings.unified_paint_settings + ups = tool_settings.unified_paint_settings col = layout.column(align=True) col.label(text="Unified Settings:") @@ -1116,14 +1116,14 @@ class IMAGE_PT_uv_sculpt_curve(Panel): @classmethod def poll(cls, context): sima = context.space_data - toolsettings = context.tool_settings.image_paint - return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) + tool_settings = context.tool_settings.image_paint + return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and tool_settings.brush) def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - uvsculpt = toolsettings.uv_sculpt + tool_settings = context.tool_settings + uvsculpt = tool_settings.uv_sculpt brush = uvsculpt.brush layout.template_curve_mapping(brush, "curve") @@ -1146,14 +1146,14 @@ class IMAGE_PT_uv_sculpt(Panel, ImagePaintPanel): @classmethod def poll(cls, context): sima = context.space_data - toolsettings = context.tool_settings.image_paint - return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and toolsettings.brush) + tool_settings = context.tool_settings.image_paint + return sima.show_uvedit and context.tool_settings.use_uv_sculpt and not (sima.show_paint and tool_settings.brush) def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - uvsculpt = toolsettings.uv_sculpt + tool_settings = context.tool_settings + uvsculpt = tool_settings.uv_sculpt brush = uvsculpt.brush if brush: @@ -1168,12 +1168,12 @@ class IMAGE_PT_uv_sculpt(Panel, ImagePaintPanel): self.prop_unified_strength(row, context, brush, "use_pressure_strength") col = layout.column() - col.prop(toolsettings, "uv_sculpt_lock_borders") - col.prop(toolsettings, "uv_sculpt_all_islands") + col.prop(tool_settings, "uv_sculpt_lock_borders") + col.prop(tool_settings, "uv_sculpt_all_islands") - col.prop(toolsettings, "uv_sculpt_tool") - if toolsettings.uv_sculpt_tool == 'RELAX': - col.prop(toolsettings, "uv_relax_method") + col.prop(tool_settings, "uv_sculpt_tool") + if tool_settings.uv_sculpt_tool == 'RELAX': + col.prop(tool_settings, "uv_relax_method") col.prop(uvsculpt, "show_brush") @@ -1192,10 +1192,10 @@ class IMAGE_PT_options_uvs(Panel, UVToolsPanel): sima = context.space_data uv = sima.uv_editor - toolsettings = context.tool_settings + tool_settings = context.tool_settings col = layout.column(align=True) - col.prop(toolsettings, "use_uv_sculpt") + col.prop(tool_settings, "use_uv_sculpt") col.prop(uv, "use_live_unwrap") col.prop(uv, "use_snap_to_pixels") col.prop(uv, "lock_bounds") diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py index c2735998d2c..e14708e651d 100644 --- a/release/scripts/startup/bl_ui/space_node.py +++ b/release/scripts/startup/bl_ui/space_node.py @@ -43,7 +43,7 @@ class NODE_HT_header(Header): snode = context.space_data snode_id = snode.id id_from = snode.id_from - toolsettings = context.tool_settings + tool_settings = context.tool_settings row = layout.row(align=True) row.template_header() @@ -123,10 +123,10 @@ class NODE_HT_header(Header): # Snap row = layout.row(align=True) - row.prop(toolsettings, "use_snap", text="") - row.prop(toolsettings, "snap_node_element", icon_only=True) - if toolsettings.snap_node_element != 'GRID': - row.prop(toolsettings, "snap_target", text="") + row.prop(tool_settings, "use_snap", text="") + row.prop(tool_settings, "snap_node_element", icon_only=True) + if tool_settings.snap_node_element != 'GRID': + row.prop(tool_settings, "snap_target", text="") row = layout.row(align=True) row.operator("node.clipboard_copy", text="", icon='COPYDOWN') diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index c3ca26efcb7..afdae718654 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -119,14 +119,14 @@ class SEQUENCER_HT_header(Header): if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}: gpd = context.gpencil_data - toolsettings = context.tool_settings + tool_settings = context.tool_settings # Proportional editing if gpd and gpd.use_stroke_edit_mode: row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - if toolsettings.proportional_edit != 'DISABLED': - row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + if tool_settings.proportional_edit != 'DISABLED': + row.prop(tool_settings, "proportional_edit_falloff", icon_only=True) row = layout.row(align=True) row.operator("render.opengl", text="", icon='RENDER_STILL').sequencer = True diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 9026a93aa99..89058b85355 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -28,7 +28,7 @@ class TIME_HT_header(Header): layout = self.layout scene = context.scene - toolsettings = context.tool_settings + tool_settings = context.tool_settings screen = context.screen userprefs = context.user_preferences @@ -82,15 +82,15 @@ class TIME_HT_header(Header): layout.separator() row = layout.row(align=True) - row.prop(toolsettings, "use_keyframe_insert_auto", text="", toggle=True) - if toolsettings.use_keyframe_insert_auto: - row.prop(toolsettings, "use_keyframe_insert_keyingset", text="", toggle=True) + row.prop(tool_settings, "use_keyframe_insert_auto", text="", toggle=True) + if tool_settings.use_keyframe_insert_auto: + row.prop(tool_settings, "use_keyframe_insert_keyingset", text="", toggle=True) if screen.is_animation_playing and not userprefs.edit.use_keyframe_insert_available: subsub = row.row(align=True) - subsub.prop(toolsettings, "use_record_with_nla", toggle=True) + subsub.prop(tool_settings, "use_record_with_nla", toggle=True) - layout.prop(toolsettings, "keyframe_type", text="", icon_only=True) + layout.prop(tool_settings, "keyframe_type", text="", icon_only=True) row = layout.row(align=True) row.prop_search(scene.keying_sets_all, "active", scene, "keying_sets_all", text="") @@ -232,10 +232,10 @@ class TIME_MT_autokey(Menu): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings + tool_settings = context.tool_settings - layout.prop_enum(toolsettings, "auto_keying_mode", 'ADD_REPLACE_KEYS') - layout.prop_enum(toolsettings, "auto_keying_mode", 'REPLACE_KEYS') + layout.prop_enum(tool_settings, "auto_keying_mode", 'ADD_REPLACE_KEYS') + layout.prop_enum(tool_settings, "auto_keying_mode", 'REPLACE_KEYS') def marker_menu_generic(layout): @@ -266,8 +266,8 @@ def marker_menu_generic(layout): layout.operator("screen.marker_jump", text="Jump to Previous Marker").next = False layout.separator() - ts = context.tool_settings - layout.prop(ts, "lock_markers") + tool_settings = context.tool_settings + layout.prop(tool_settings, "lock_markers") classes = ( diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 2381309bc3d..528d5fb3e45 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -36,7 +36,7 @@ class VIEW3D_HT_header(Header): view = context.space_data # mode_string = context.mode obj = context.active_object - toolsettings = context.tool_settings + tool_settings = context.tool_settings row = layout.row(align=True) row.template_header() @@ -51,7 +51,7 @@ class VIEW3D_HT_header(Header): mode = obj.mode # Particle edit if mode == 'PARTICLE_EDIT': - row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True) + row.prop(tool_settings.particle_edit, "select_mode", text="", expand=True) # Occlude geometry if ((view.viewport_shade not in {'BOUNDBOX', 'WIREFRAME'} and (mode == 'PARTICLE_EDIT' or (mode == 'EDIT' and obj.type == 'MESH'))) or @@ -61,26 +61,26 @@ class VIEW3D_HT_header(Header): # Proportional editing if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - if toolsettings.proportional_edit != 'DISABLED': - row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + if tool_settings.proportional_edit != 'DISABLED': + row.prop(tool_settings, "proportional_edit_falloff", icon_only=True) elif mode in {'EDIT', 'PARTICLE_EDIT'}: row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - if toolsettings.proportional_edit != 'DISABLED': - row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + if tool_settings.proportional_edit != 'DISABLED': + row.prop(tool_settings, "proportional_edit_falloff", icon_only=True) elif mode == 'OBJECT': row = layout.row(align=True) - row.prop(toolsettings, "use_proportional_edit_objects", icon_only=True) - if toolsettings.use_proportional_edit_objects: - row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) + row.prop(tool_settings, "use_proportional_edit_objects", icon_only=True) + if tool_settings.use_proportional_edit_objects: + row.prop(tool_settings, "proportional_edit_falloff", icon_only=True) else: # Proportional editing if context.gpencil_data and context.gpencil_data.use_stroke_edit_mode: row = layout.row(align=True) - row.prop(toolsettings, "proportional_edit", icon_only=True) - if toolsettings.proportional_edit != 'DISABLED': - row.prop(toolsettings, "proportional_edit_falloff", icon_only=True) + row.prop(tool_settings, "proportional_edit", icon_only=True) + if tool_settings.proportional_edit != 'DISABLED': + row.prop(tool_settings, "proportional_edit_falloff", icon_only=True) # Snap show_snap = False @@ -97,29 +97,29 @@ class VIEW3D_HT_header(Header): show_snap = True if show_snap: - snap_element = toolsettings.snap_element + snap_element = tool_settings.snap_element row = layout.row(align=True) - row.prop(toolsettings, "use_snap", text="") - row.prop(toolsettings, "snap_element", icon_only=True) + row.prop(tool_settings, "use_snap", text="") + row.prop(tool_settings, "snap_element", icon_only=True) if snap_element == 'INCREMENT': - row.prop(toolsettings, "use_snap_grid_absolute", text="") + row.prop(tool_settings, "use_snap_grid_absolute", text="") else: - row.prop(toolsettings, "snap_target", text="") + row.prop(tool_settings, "snap_target", text="") if obj: if mode == 'EDIT': - row.prop(toolsettings, "use_snap_self", text="") + row.prop(tool_settings, "use_snap_self", text="") if mode in {'OBJECT', 'POSE', 'EDIT'} and snap_element != 'VOLUME': - row.prop(toolsettings, "use_snap_align_rotation", text="") + row.prop(tool_settings, "use_snap_align_rotation", text="") if snap_element == 'VOLUME': - row.prop(toolsettings, "use_snap_peel_object", text="") + row.prop(tool_settings, "use_snap_peel_object", text="") elif snap_element == 'FACE': - row.prop(toolsettings, "use_snap_project", text="") + row.prop(tool_settings, "use_snap_project", text="") # AutoMerge editing if obj: if (mode == 'EDIT' and obj.type == 'MESH'): - layout.prop(toolsettings, "use_mesh_automerge", text="", icon='AUTOMERGE_ON') + layout.prop(tool_settings, "use_mesh_automerge", text="", icon='AUTOMERGE_ON') # OpenGL render row = layout.row(align=True) @@ -2032,8 +2032,8 @@ class VIEW3D_MT_sculpt(Menu): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - sculpt = toolsettings.sculpt + tool_settings = context.tool_settings + sculpt = tool_settings.sculpt layout.menu("VIEW3D_MT_undo_redo") @@ -2467,7 +2467,7 @@ class VIEW3D_MT_edit_mesh(Menu): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings + tool_settings = context.tool_settings layout.menu("VIEW3D_MT_undo_redo") @@ -2510,7 +2510,7 @@ class VIEW3D_MT_edit_mesh(Menu): layout.separator() - layout.prop(toolsettings, "use_mesh_automerge") + layout.prop(tool_settings, "use_mesh_automerge") layout.menu("VIEW3D_MT_edit_proportional") layout.separator() @@ -3279,7 +3279,7 @@ class VIEW3D_MT_edit_gpencil(Menu): bl_label = "GPencil" def draw(self, context): - toolsettings = context.tool_settings + tool_settings = context.tool_settings layout = self.layout @@ -3298,7 +3298,7 @@ class VIEW3D_MT_edit_gpencil(Menu): layout.separator() layout.operator("gpencil.brush_paint", text="Sculpt Strokes").wait_for_input = True - layout.prop_menu_enum(toolsettings.gpencil_sculpt, "tool", text="Sculpt Brush") + layout.prop_menu_enum(tool_settings.gpencil_sculpt, "tool", text="Sculpt Brush") layout.separator() @@ -3920,42 +3920,42 @@ class VIEW3D_PT_etch_a_ton(Panel): def draw_header(self, context): layout = self.layout - toolsettings = context.scene.tool_settings + tool_settings = context.scene.tool_settings - layout.prop(toolsettings, "use_bone_sketching", text="") + layout.prop(tool_settings, "use_bone_sketching", text="") def draw(self, context): layout = self.layout - toolsettings = context.scene.tool_settings + tool_settings = context.scene.tool_settings col = layout.column() - col.prop(toolsettings, "use_etch_quick") - col.prop(toolsettings, "use_etch_overdraw") + col.prop(tool_settings, "use_etch_quick") + col.prop(tool_settings, "use_etch_overdraw") col.separator() - col.prop(toolsettings, "etch_convert_mode") + col.prop(tool_settings, "etch_convert_mode") - if toolsettings.etch_convert_mode == 'LENGTH': - col.prop(toolsettings, "etch_length_limit") - elif toolsettings.etch_convert_mode == 'ADAPTIVE': - col.prop(toolsettings, "etch_adaptive_limit") - elif toolsettings.etch_convert_mode == 'FIXED': - col.prop(toolsettings, "etch_subdivision_number") - elif toolsettings.etch_convert_mode == 'RETARGET': - col.prop(toolsettings, "etch_template") - col.prop(toolsettings, "etch_roll_mode") + if tool_settings.etch_convert_mode == 'LENGTH': + col.prop(tool_settings, "etch_length_limit") + elif tool_settings.etch_convert_mode == 'ADAPTIVE': + col.prop(tool_settings, "etch_adaptive_limit") + elif tool_settings.etch_convert_mode == 'FIXED': + col.prop(tool_settings, "etch_subdivision_number") + elif tool_settings.etch_convert_mode == 'RETARGET': + col.prop(tool_settings, "etch_template") + col.prop(tool_settings, "etch_roll_mode") col.separator() colsub = col.column(align=True) - colsub.prop(toolsettings, "use_etch_autoname") + colsub.prop(tool_settings, "use_etch_autoname") sub = colsub.column(align=True) - sub.enabled = not toolsettings.use_etch_autoname - sub.prop(toolsettings, "etch_number") - sub.prop(toolsettings, "etch_side") + sub.enabled = not tool_settings.use_etch_autoname + sub.prop(tool_settings, "etch_number") + sub.prop(tool_settings, "etch_side") col.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index f868404cd2f..38ea87316ba 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -889,28 +889,28 @@ class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel): @classmethod def poll(cls, context): - toolsettings = context.tool_settings.image_paint - return context.image_paint_object and not toolsettings.detect_data() + tool_settings = context.tool_settings.image_paint + return context.image_paint_object and not tool_settings.detect_data() def draw(self, context): layout = self.layout - toolsettings = context.tool_settings.image_paint + tool_settings = context.tool_settings.image_paint col = layout.column() col.label("Missing Data", icon='ERROR') - if toolsettings.missing_uvs: + if tool_settings.missing_uvs: col.separator() col.label("Missing UVs", icon='INFO') col.label("Unwrap the mesh in edit mode or generate a simple UV layer") col.operator("paint.add_simple_uvs") - if toolsettings.mode == 'MATERIAL': - if toolsettings.missing_materials: + if tool_settings.mode == 'MATERIAL': + if tool_settings.missing_materials: col.separator() col.label("Missing Materials", icon='INFO') col.label("Add a material and paint slot below") col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") - elif toolsettings.missing_texture: + elif tool_settings.missing_texture: ob = context.active_object mat = ob.active_material @@ -924,23 +924,23 @@ class VIEW3D_PT_imapaint_tools_missing(Panel, View3DPaintPanel): col.label("Add a material and paint slot below") col.operator_menu_enum("paint.add_texture_paint_slot", "type", text="Add Paint Slot") - elif toolsettings.mode == 'IMAGE': - if toolsettings.missing_texture: + elif tool_settings.mode == 'IMAGE': + if tool_settings.missing_texture: col.separator() col.label("Missing Canvas", icon='INFO') col.label("Add or assign a canvas image below") col.label("Canvas Image:") # todo this should be combinded into a single row - col.template_ID(toolsettings, "canvas", open="image.open") + col.template_ID(tool_settings, "canvas", open="image.open") col.operator("image.new", text="New").gen_context = 'PAINT_CANVAS' - if toolsettings.missing_stencil: + if tool_settings.missing_stencil: col.separator() col.label("Missing Stencil", icon='INFO') col.label("Add or assign a stencil image below") col.label("Stencil Image:") # todo this should be combinded into a single row - col.template_ID(toolsettings, "stencil_image", open="image.open") + col.template_ID(tool_settings, "stencil_image", open="image.open") col.operator("image.new", text="New").gen_context = 'PAINT_STENCIL' @@ -955,7 +955,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings + tool_settings = context.tool_settings settings = self.paint_settings(context) brush = settings.brush @@ -998,7 +998,7 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): row = col.row(align=True) - ups = toolsettings.unified_paint_settings + ups = tool_settings.unified_paint_settings if ((ups.use_unified_size and ups.use_locked_size) or ((not ups.use_unified_size) and brush.use_locked_size)): self.prop_unified_size(row, context, brush, "use_locked_size", icon='LOCKED') @@ -1148,8 +1148,8 @@ class VIEW3D_PT_tools_brush(Panel, View3DPaintPanel): col.prop(brush, "use_projected") col = layout.column() - col.prop(toolsettings, "use_auto_normalize", text="Auto Normalize") - col.prop(toolsettings, "use_multipaint", text="Multi-Paint") + col.prop(tool_settings, "use_auto_normalize", text="Auto Normalize") + col.prop(tool_settings, "use_multipaint", text="Multi-Paint") # Vertex Paint Mode # elif context.vertex_paint_object and brush: @@ -1307,8 +1307,8 @@ class VIEW3D_PT_stencil_projectpaint(View3DPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - ipaint = toolsettings.image_paint + tool_settings = context.tool_settings + ipaint = tool_settings.image_paint ob = context.active_object mesh = ob.data @@ -1591,8 +1591,8 @@ class VIEW3D_PT_sculpt_dyntopo(Panel, View3DPaintPanel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - sculpt = toolsettings.sculpt + tool_settings = context.tool_settings + sculpt = tool_settings.sculpt settings = self.paint_settings(context) brush = settings.brush @@ -1633,8 +1633,8 @@ class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel): layout = self.layout # scene = context.scene - toolsettings = context.tool_settings - sculpt = toolsettings.sculpt + tool_settings = context.tool_settings + sculpt = tool_settings.sculpt capabilities = sculpt.brush.sculpt_capabilities col = layout.column(align=True) @@ -1763,8 +1763,8 @@ class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - wpaint = toolsettings.weight_paint + tool_settings = context.tool_settings + wpaint = tool_settings.weight_paint draw_vpaint_symmetry(layout, wpaint) @@ -1807,7 +1807,7 @@ class VIEW3D_PT_tools_vertexpaint(Panel, View3DPaintPanel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings + tool_settings = context.tool_settings col = layout.column() @@ -1822,8 +1822,8 @@ class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - vpaint = toolsettings.vertex_paint + tool_settings = context.tool_settings + vpaint = tool_settings.vertex_paint draw_vpaint_symmetry(layout, vpaint) @@ -1839,8 +1839,8 @@ class VIEW3D_PT_tools_imagepaint_external(Panel, View3DPaintPanel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - ipaint = toolsettings.image_paint + tool_settings = context.tool_settings + ipaint = tool_settings.image_paint col = layout.column() row = col.split(align=True, percentage=0.55) @@ -1861,8 +1861,8 @@ class VIEW3D_PT_tools_imagepaint_symmetry(Panel, View3DPaintPanel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - ipaint = toolsettings.image_paint + tool_settings = context.tool_settings + ipaint = tool_settings.image_paint col = layout.column(align=True) row = col.row(align=True) @@ -1884,8 +1884,8 @@ class VIEW3D_PT_tools_projectpaint(View3DPaintPanel, Panel): def draw(self, context): layout = self.layout - toolsettings = context.tool_settings - ipaint = toolsettings.image_paint + tool_settings = context.tool_settings + ipaint = tool_settings.image_paint col = layout.column() |