Cleanup: pep8

This commit is contained in:
Campbell Barton 2019-05-22 00:27:01 +10:00
parent dfb2db10a0
commit 4ebb64697a
18 changed files with 164 additions and 76 deletions

@ -44,8 +44,7 @@ class ConstraintButtonsPanel:
else:
row = box.row(align=True)
row.prop(con, "influence")
row.operator("constraint.disable_keep_transform",
text='', icon='CANCEL')
row.operator("constraint.disable_keep_transform", text="", icon='CANCEL')
@staticmethod
def space_template(layout, con, target=True, owner=True):

@ -129,7 +129,15 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
rows = 1
if group:
rows = 4
row.template_list("UI_UL_list", "bone_groups", pose, "bone_groups", pose.bone_groups, "active_index", rows=rows)
row.template_list(
"UI_UL_list",
"bone_groups",
pose,
"bone_groups",
pose.bone_groups,
"active_index",
rows=rows,
)
col = row.column(align=True)
col.active = (ob.proxy is None)

@ -219,7 +219,6 @@ class DATA_PT_camera_dof(CameraButtonsPanel, Panel):
dof = cam.dof
self.layout.prop(dof, "use_dof", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True

@ -74,7 +74,7 @@ class DATA_PT_empty_image(DataButtonsPanel, Panel):
layout = self.layout
ob = context.object
layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
layout.separator();
layout.separator()
layout.template_image(ob, "data", ob.image_user, compact=True)

@ -28,8 +28,16 @@ class MESH_MT_vertex_group_context_menu(Menu):
def draw(self, _context):
layout = self.layout
layout.operator("object.vertex_group_sort", icon='SORTALPHA', text="Sort by Name").sort_type = 'NAME'
layout.operator("object.vertex_group_sort", icon='BONE_DATA', text="Sort by Bone Hierarchy").sort_type = 'BONE_HIERARCHY'
layout.operator(
"object.vertex_group_sort",
icon='SORTALPHA',
text="Sort by Name",
).sort_type = 'NAME'
layout.operator(
"object.vertex_group_sort",
icon='BONE_DATA',
text="Sort by Bone Hierarchy",
).sort_type = 'BONE_HIERARCHY'
layout.separator()
layout.operator("object.vertex_group_copy", icon='DUPLICATE')
layout.operator("object.vertex_group_copy_to_linked")
@ -257,7 +265,11 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
col.operator("object.vertex_group_move", icon='TRIA_UP', text="").direction = 'UP'
col.operator("object.vertex_group_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
if ob.vertex_groups and (ob.mode == 'EDIT' or (ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex)):
if (
ob.vertex_groups and
(ob.mode == 'EDIT' or
(ob.mode == 'WEIGHT_PAINT' and ob.type == 'MESH' and ob.data.use_paint_mask_vertex))
):
row = layout.row()
sub = row.row(align=True)

@ -361,7 +361,10 @@ class GPENCIL_MT_pie_tool_palette(Menu):
# E - "Settings" Palette is included here too, since it needs to be in a stable position...
if gpd and gpd.layers.active:
col.separator()
col.operator("wm.call_menu_pie", text="Settings...", icon='SCRIPTWIN').name = "GPENCIL_MT_pie_settings_palette"
col.operator(
"wm.call_menu_pie",
text="Settings...",
icon='SCRIPTWIN').name = "GPENCIL_MT_pie_settings_palette"
# Editing tools
if gpd:
@ -871,9 +874,11 @@ class GreasePencilMaterialsPanel:
if ma is not None and ma.grease_pencil is not None:
gpcolor = ma.grease_pencil
if gpcolor.stroke_style == 'SOLID' or \
gpcolor.use_stroke_pattern is True or \
gpcolor.use_stroke_texture_mix is True:
if (
gpcolor.stroke_style == 'SOLID' or
gpcolor.use_stroke_pattern or
gpcolor.use_stroke_texture_mix
):
row = layout.row()
row.prop(gpcolor, "color", text="Stroke Color")

@ -151,9 +151,11 @@ class MATERIAL_PT_gpencil_strokecolor(GPMaterialButtonsPanel, Panel):
if gpcolor.use_stroke_texture_mix is True:
col.prop(gpcolor, "mix_stroke_factor", text="Factor")
if gpcolor.stroke_style == 'SOLID' or \
gpcolor.use_stroke_pattern is True or \
gpcolor.use_stroke_texture_mix is True:
if (
gpcolor.stroke_style == 'SOLID' or
gpcolor.use_stroke_pattern or
gpcolor.use_stroke_texture_mix
):
col.prop(gpcolor, "color", text="Color")
if gpcolor.mode in {'DOTS', 'BOX'}:

@ -24,6 +24,7 @@ from bpy.types import (
from rna_prop_ui import PropertyPanel
class WorkSpaceButtonsPanel:
# bl_space_type = 'PROPERTIES'
# bl_region_type = 'WINDOW'

@ -1536,7 +1536,7 @@ class CLIP_MT_marker_pie(Menu):
# Make Settings Default
pie.operator("clip.track_settings_as_default", icon='SETTINGS')
if track_active:
# Use Normalization
# Use Normalization
pie.prop(track_active, "use_normalization", text="Normalization")
# Use Brute Force
pie.prop(track_active, "use_brute", text="Use Brute Force")
@ -1575,7 +1575,7 @@ class CLIP_MT_tracking_pie(Menu):
prop.backwards = False
prop.sequence = True
# Disable Marker
pie.operator("clip.disable_markers", icon="VISIBLE_IPO_ON").action = 'TOGGLE'
pie.operator("clip.disable_markers", icon='VISIBLE_IPO_ON').action = 'TOGGLE'
# Detect Features
pie.operator("clip.detect_features", icon='ZOOM_SELECTED')
# Clear Path Backwards
@ -1613,11 +1613,17 @@ class CLIP_MT_solving_pie(Menu):
# create Plane Track
pie.operator("clip.create_plane_track", icon='MATPLANE')
# Set Keyframe A
pie.operator("clip.set_solver_keyframe", text="Set Keyframe A",
icon='KEYFRAME').keyframe = 'KEYFRAME_A'
pie.operator(
"clip.set_solver_keyframe",
text="Set Keyframe A",
icon='KEYFRAME',
).keyframe = 'KEYFRAME_A'
# Set Keyframe B
pie.operator("clip.set_solver_keyframe", text="Set Keyframe B",
icon='KEYFRAME').keyframe = 'KEYFRAME_B'
pie.operator(
"clip.set_solver_keyframe",
text="Set Keyframe B",
icon='KEYFRAME',
).keyframe = 'KEYFRAME_B'
# Clean Tracks
prop = pie.operator("clip.clean_tracks", icon='X')
# Filter Tracks
@ -1656,7 +1662,6 @@ class CLIP_MT_reconstruction_pie(Menu):
pie.operator("clip.apply_solution_scale", icon='ARROW_LEFTRIGHT')
classes = (
CLIP_UL_tracking_objects,
CLIP_HT_header,

@ -116,7 +116,6 @@ class FILEBROWSER_UL_dir(UIList):
layout.prop(direntry, "path", text="")
class FILEBROWSER_PT_bookmarks_volumes(Panel):
bl_space_type = 'FILE_BROWSER'
bl_region_type = 'TOOLS'

@ -493,17 +493,41 @@ class IMAGE_MT_uvs_snap_pie(Menu):
layout.operator_context = 'EXEC_REGION_WIN'
pie.operator("uv.snap_selected", text="Selected to Pixels", icon='RESTRICT_SELECT_OFF').target = 'PIXELS'
pie.operator("uv.snap_cursor", text="Cursor to Pixels", icon='PIVOT_CURSOR').target = 'PIXELS'
pie.operator("uv.snap_cursor", text="Cursor to Selected", icon='PIVOT_CURSOR').target = 'SELECTED'
pie.operator("uv.snap_selected", text="Selected to Cursor", icon='RESTRICT_SELECT_OFF').target = 'CURSOR'
pie.operator("uv.snap_selected", text="Selected to Cursor (Offset)", icon='RESTRICT_SELECT_OFF').target = 'CURSOR_OFFSET'
pie.operator("uv.snap_selected", text="Selected to Adjacent Unselected", icon='RESTRICT_SELECT_OFF').target = 'ADJACENT_UNSELECTED'
pie.operator(
"uv.snap_selected",
text="Selected to Pixels",
icon='RESTRICT_SELECT_OFF',
).target = 'PIXELS'
pie.operator(
"uv.snap_cursor",
text="Cursor to Pixels",
icon='PIVOT_CURSOR',
).target = 'PIXELS'
pie.operator(
"uv.snap_cursor",
text="Cursor to Selected",
icon='PIVOT_CURSOR',
).target = 'SELECTED'
pie.operator(
"uv.snap_selected",
text="Selected to Cursor",
icon='RESTRICT_SELECT_OFF',
).target = 'CURSOR'
pie.operator(
"uv.snap_selected",
text="Selected to Cursor (Offset)",
icon='RESTRICT_SELECT_OFF',
).target = 'CURSOR_OFFSET'
pie.operator(
"uv.snap_selected",
text="Selected to Adjacent Unselected",
icon='RESTRICT_SELECT_OFF',
).target = 'ADJACENT_UNSELECTED'
class IMAGE_HT_tool_header(Header):
bl_space_type = 'IMAGE_EDITOR'
bl_region_type = "TOOL_HEADER"
bl_region_type = 'TOOL_HEADER'
def draw(self, context):
layout = self.layout
@ -544,7 +568,12 @@ class IMAGE_HT_tool_header(Header):
if tool_mode == 'PAINT':
if (tool is not None) and tool.has_datablock:
layout.popover_group(space_type='IMAGE_EDITOR', region_type='UI', context=".paint_common_2d", category="")
layout.popover_group(
space_type='IMAGE_EDITOR',
region_type='UI',
context=".paint_common_2d",
category="",
)
elif tool_mode == 'UV':
if (tool is not None) and tool.has_datablock:
layout.popover_group(space_type='IMAGE_EDITOR', region_type='UI', context=".uv_sculpt", category="")
@ -1450,7 +1479,6 @@ class IMAGE_PT_uv_sculpt_curve(Panel):
row.operator("brush.curve_preset", icon='NOCURVE', text="").shape = 'MAX'
class ImageScopesPanel:
@classmethod
def poll(cls, context):

@ -51,7 +51,11 @@ class INFO_MT_area(Menu):
layout.separator()
layout.operator("screen.screen_full_area")
layout.operator("screen.screen_full_area", text="Toggle Fullscreen Area", icon='FULLSCREEN_ENTER').use_hide_panels = True
layout.operator(
"screen.screen_full_area",
text="Toggle Fullscreen Area",
icon='FULLSCREEN_ENTER',
).use_hide_panels = True
classes = (

@ -242,6 +242,7 @@ class NLA_MT_snap_pie(Menu):
pie.operator("nla.snap", text="Nearest Second").type = 'NEAREST_SECOND'
pie.operator("nla.snap", text="Nearest Marker").type = 'NEAREST_MARKER'
class NLA_MT_context_menu(Menu):
bl_label = "NLA Context Menu"
@ -285,7 +286,6 @@ class NLA_MT_channel_context_menu(Menu):
layout.operator("anim.channels_clean_empty")
classes = (
NLA_HT_header,
NLA_MT_edit,

@ -331,7 +331,7 @@ class NODE_PT_active_tool(ToolActivePanelHelper, Panel):
class NODE_PT_material_slots(Panel):
bl_space_type = "NODE_EDITOR"
bl_space_type = 'NODE_EDITOR'
bl_region_type = 'HEADER'
bl_label = "Slot"
bl_ui_units_x = 8

@ -166,19 +166,19 @@ class OUTLINER_MT_collection_visibility(Menu):
layout.separator()
layout.operator("outliner.collection_show", text="Show", icon="HIDE_OFF")
layout.operator("outliner.collection_show", text="Show", icon='HIDE_OFF')
layout.operator("outliner.collection_show_inside", text="Show All Inside")
layout.operator("outliner.collection_hide", text="Hide", icon="HIDE_ON")
layout.operator("outliner.collection_hide", text="Hide", icon='HIDE_ON')
layout.operator("outliner.collection_hide_inside", text="Hide All Inside")
layout.separator()
layout.operator("outliner.collection_enable", text="Enable in Viewports", icon="RESTRICT_VIEW_OFF")
layout.operator("outliner.collection_enable", text="Enable in Viewports", icon='RESTRICT_VIEW_OFF')
layout.operator("outliner.collection_disable", text="Disable in Viewports")
layout.separator()
layout.operator("outliner.collection_enable_render", text="Enable in Render", icon="RESTRICT_RENDER_OFF")
layout.operator("outliner.collection_enable_render", text="Enable in Render", icon='RESTRICT_RENDER_OFF')
layout.operator("outliner.collection_disable_render", text="Disable in Render")
@ -198,12 +198,12 @@ class OUTLINER_MT_collection(Menu):
layout.separator()
layout.operator("outliner.collection_delete", text="Delete", icon="X").hierarchy = False
layout.operator("outliner.collection_delete", text="Delete", icon='X').hierarchy = False
layout.operator("outliner.collection_delete", text="Delete Hierarchy").hierarchy = True
layout.separator()
layout.operator("outliner.collection_objects_select", text="Select Objects", icon="RESTRICT_SELECT_OFF")
layout.operator("outliner.collection_objects_select", text="Select Objects", icon='RESTRICT_SELECT_OFF')
layout.operator("outliner.collection_objects_deselect", text="Deselect Objects")
layout.separator()
@ -260,14 +260,14 @@ class OUTLINER_MT_object(Menu):
layout.separator()
layout.operator("outliner.object_operation", text="Delete", icon="X").type = 'DELETE'
layout.operator("outliner.object_operation", text="Delete", icon='X').type = 'DELETE'
if space.display_mode == 'VIEW_LAYER' and not space.use_filter_collection:
layout.operator("outliner.object_operation", text="Delete Hierarchy").type = 'DELETE_HIERARCHY'
layout.separator()
layout.operator("outliner.object_operation", text="Select", icon="RESTRICT_SELECT_OFF").type = 'SELECT'
layout.operator("outliner.object_operation", text="Select", icon='RESTRICT_SELECT_OFF').type = 'SELECT'
layout.operator("outliner.object_operation", text="Select Hierarchy").type = 'SELECT_HIERARCHY'
layout.operator("outliner.object_operation", text="Deselect").type = 'DESELECT'

@ -179,13 +179,13 @@ class SEQUENCER_MT_range(Menu):
def draw(self, context):
layout = self.layout
layout.operator("anim.previewrange_set", text = "Set Preview Range")
layout.operator("anim.previewrange_clear", text = "Clear Preview Range")
layout.operator("anim.previewrange_set", text="Set Preview Range")
layout.operator("anim.previewrange_clear", text="Clear Preview Range")
layout.separator()
layout.operator("anim.start_frame_set", text = "Set Start Frame")
layout.operator("anim.end_frame_set", text = "Set End Frame")
layout.operator("anim.start_frame_set", text="Set Start Frame")
layout.operator("anim.end_frame_set", text="Set End Frame")
class SEQUENCER_MT_view(Menu):
@ -215,12 +215,12 @@ class SEQUENCER_MT_view(Menu):
layout.operator_context = 'INVOKE_REGION_WIN'
layout.operator("sequencer.view_selected", text="Frame Selected")
layout.operator("sequencer.view_all", text="Frame All")
layout.operator("view2d.zoom_border", text = "Zoom")
layout.operator("view2d.zoom_border", text="Zoom")
layout.separator()
layout.operator_context = 'INVOKE_DEFAULT'
#layout.menu("SEQUENCER_MT_frame")
# layout.menu("SEQUENCER_MT_frame")
layout.menu("SEQUENCER_MT_navigation")
layout.menu("SEQUENCER_MT_range")
@ -229,7 +229,7 @@ class SEQUENCER_MT_view(Menu):
if is_preview:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("sequencer.view_all_preview", text="Fit Preview in window")
layout.operator("view2d.zoom_border", text = "Zoom")
layout.operator("view2d.zoom_border", text="Zoom")
layout.separator()
@ -306,9 +306,10 @@ class SEQUENCER_MT_select_linked(Menu):
def draw(self, context):
layout = self.layout
layout.operator("sequencer.select_linked", text = "All")
layout.operator("sequencer.select_less", text = "Less")
layout.operator("sequencer.select_more", text = "More")
layout.operator("sequencer.select_linked", text="All")
layout.operator("sequencer.select_less", text="Less")
layout.operator("sequencer.select_more", text="More")
class SEQUENCER_MT_select_playhead(Menu):
bl_label = "Select Playhead"
@ -335,14 +336,14 @@ class SEQUENCER_MT_select(Menu):
layout.separator()
layout.operator("sequencer.select_box", text = "Box Select")
layout.operator("sequencer.select_box", text="Box Select")
layout.separator()
layout.menu("SEQUENCER_MT_select_playhead", text ="Playhead")
layout.menu("SEQUENCER_MT_select_handle", text ="Handle")
layout.menu("SEQUENCER_MT_select_channel", text ="Channel")
layout.menu("SEQUENCER_MT_select_linked", text ="Linked")
layout.menu("SEQUENCER_MT_select_playhead", text="Playhead")
layout.menu("SEQUENCER_MT_select_handle", text="Handle")
layout.menu("SEQUENCER_MT_select_channel", text="Channel")
layout.menu("SEQUENCER_MT_select_linked", text="Linked")
layout.separator()
layout.operator_menu_enum("sequencer.select_grouped", "type", text="Grouped")
@ -642,7 +643,7 @@ class SEQUENCER_MT_strip(Menu):
if stype != 'SOUND':
layout.separator()
layout.operator_menu_enum("sequencer.strip_modifier_add", "type", text="Add Modifier")
layout.operator("sequencer.strip_modifier_copy", text = "Copy Modifiers to Selection")
layout.operator("sequencer.strip_modifier_copy", text="Copy Modifiers to Selection")
if stype in {
'CROSS', 'ADD', 'SUBTRACT', 'ALPHA_OVER', 'ALPHA_UNDER',
@ -714,7 +715,7 @@ class SEQUENCER_MT_context_menu(Menu):
if stype != 'SOUND':
layout.separator()
layout.operator_menu_enum("sequencer.strip_modifier_add", "type", text="Add Modifier")
layout.operator("sequencer.strip_modifier_copy", text = "Copy Modifiers to Selection")
layout.operator("sequencer.strip_modifier_copy", text="Copy Modifiers to Selection")
if selected_sequences_len(context) >= 2:
layout.separator()
@ -800,7 +801,7 @@ class SEQUENCER_PT_adjust_offset(SequencerButtonsPanel, Panel):
layout.use_property_split = True
layout.use_property_decorate = False
if strip.use_translation:
if strip.use_translation:
col = layout.column(align=True)
col.prop(strip.transform, "offset_x", text="Position X")
col.prop(strip.transform, "offset_y", text="Y")
@ -880,7 +881,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
elif strip.type == 'WIPE':
col = layout.column()
col.prop(strip, "transition_type")
col.alignment = "RIGHT"
col.alignment = 'RIGHT'
col.row().prop(strip, "direction", expand=True)
col = layout.column()
@ -943,7 +944,7 @@ class SEQUENCER_PT_effect(SequencerButtonsPanel, Panel):
# The multicam strip needs at least 2 strips to be useful
if strip_channel > 2:
BT_ROW = 4
#col.alignment = "RIGHT"
# col.alignment = 'RIGHT'
col.label(text=" Cut to")
row = col.row()
@ -1314,7 +1315,10 @@ class SEQUENCER_PT_info_data(SequencerButtonsPanel, Panel):
playhead = frame_current - strip.frame_start
col = layout.column(align=True)
col = col.box()
col.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_final_duration)
col.active = (
(frame_current >= strip.frame_start) and
(frame_current <= strip.frame_start + strip.frame_final_duration)
)
split = col.split(factor=0.5 + max_factor)
split.alignment = 'RIGHT'
split.label(text="Playhead")
@ -1332,7 +1336,7 @@ class SEQUENCER_PT_info_data(SequencerButtonsPanel, Panel):
elif strip.type == 'MOVIE':
elem = strip.elements[0]
if strip.type != "SOUND":
if strip.type != 'SOUND':
split = col.split(factor=0.5 + max_factor)
split.alignment = 'RIGHT'
split.label(text="Resolution")
@ -1341,7 +1345,7 @@ class SEQUENCER_PT_info_data(SequencerButtonsPanel, Panel):
else:
split.label(text="None")
if strip.type == "SCENE":
if strip.type == 'SCENE':
scene = strip.scene
if scene:
@ -1708,7 +1712,6 @@ class SEQUENCER_PT_frame_overlay(SequencerButtonsPanel_Output, Panel):
layout.use_property_split = True
layout.use_property_decorate = False
st = context.space_data
scene = context.scene
ed = scene.sequence_editor

@ -157,7 +157,7 @@ class TOPBAR_MT_editor_menus(Menu):
def draw(self, _context):
layout = self.layout
layout.menu("TOPBAR_MT_app", text="", icon="BLENDER")
layout.menu("TOPBAR_MT_app", text="", icon='BLENDER')
layout.menu("TOPBAR_MT_file")
layout.menu("TOPBAR_MT_edit")

@ -39,7 +39,7 @@ from bpy.app.translations import contexts as i18n_contexts
class VIEW3D_HT_tool_header(Header):
bl_space_type = 'VIEW_3D'
bl_region_type = "TOOL_HEADER"
bl_region_type = 'TOOL_HEADER'
def draw(self, context):
layout = self.layout
@ -2368,7 +2368,6 @@ class VIEW3D_MT_object_context_menu(Menu):
props.data_path_item = "data.angle"
props.header_text = "Light Angle: %.3f"
if light.type == 'SPOT':
layout.separator()
@ -3794,6 +3793,7 @@ class VIEW3D_MT_edit_mesh_faces(Menu):
layout.menu("VIEW3D_MT_edit_mesh_faces_data")
class VIEW3D_MT_edit_mesh_normals_select_strength(Menu):
bl_label = "Select by Face Strength"
@ -3812,6 +3812,7 @@ class VIEW3D_MT_edit_mesh_normals_select_strength(Menu):
op.set = False
op.face_strength = 'STRONG'
class VIEW3D_MT_edit_mesh_normals_set_strength(Menu):
bl_label = "Select by Face Strength"
@ -3830,6 +3831,7 @@ class VIEW3D_MT_edit_mesh_normals_set_strength(Menu):
op.set = True
op.face_strength = 'STRONG'
class VIEW3D_MT_edit_mesh_normals_average(Menu):
bl_label = "Average"
@ -3840,6 +3842,7 @@ class VIEW3D_MT_edit_mesh_normals_average(Menu):
layout.operator("mesh.average_normals", text="Face Area").average_type = 'FACE_AREA'
layout.operator("mesh.average_normals", text="Corner Angle").average_type = 'CORNER_ANGLE'
class VIEW3D_MT_edit_mesh_normals(Menu):
bl_label = "Normals"
@ -4743,8 +4746,16 @@ class VIEW3D_MT_snap_pie(Menu):
pie.operator("view3d.snap_cursor_to_grid", text="Cursor to Grid", icon='CURSOR')
pie.operator("view3d.snap_selected_to_grid", text="Selection to Grid", icon='RESTRICT_SELECT_OFF')
pie.operator("view3d.snap_cursor_to_selected", text="Cursor to Selected", icon='CURSOR')
pie.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor", icon='RESTRICT_SELECT_OFF').use_offset = False
pie.operator("view3d.snap_selected_to_cursor", text="Selection to Cursor (Keep Offset)", icon='RESTRICT_SELECT_OFF').use_offset = True
pie.operator(
"view3d.snap_selected_to_cursor",
text="Selection to Cursor",
icon='RESTRICT_SELECT_OFF',
).use_offset = False
pie.operator(
"view3d.snap_selected_to_cursor",
text="Selection to Cursor (Keep Offset)",
icon='RESTRICT_SELECT_OFF',
).use_offset = True
pie.operator("view3d.snap_selected_to_active", text="Selection to Active", icon='RESTRICT_SELECT_OFF')
pie.operator("view3d.snap_cursor_to_center", text="Cursor to World Origin", icon='CURSOR')
pie.operator("view3d.snap_cursor_to_active", text="Cursor to Active", icon='CURSOR')
@ -5060,7 +5071,13 @@ class VIEW3D_PT_shading_lighting(Panel):
sub.scale_y = 0.6 # smaller studiolight preview
sub.template_icon_view(shading, "studio_light", scale_popup=3.0)
else:
sub.prop(system, "use_studio_light_edit", text="Disable Studio Light Edit", icon='NONE', toggle=True)
sub.prop(
system,
"use_studio_light_edit",
text="Disable Studio Light Edit",
icon='NONE',
toggle=True,
)
col = split.column()
col.operator("preferences.studiolight_show", emboss=False, text="", icon='PREFERENCES')
@ -5179,7 +5196,7 @@ class VIEW3D_PT_shading_options(Panel):
sub = row.row()
sub.active = shading.show_xray
sub.prop(shading, "xray_alpha", text="X-Ray")
#X-ray mode is off when alpha is 1.0
# X-ray mode is off when alpha is 1.0
xray_active = shading.show_xray and shading.xray_alpha != 1
row = col.row(align=True)
@ -5347,13 +5364,19 @@ class VIEW3D_PT_overlay_guides(Panel):
row = sub.row()
row_el = row.column()
row_el.prop(overlay, "show_ortho_grid", text="Grid")
grid_active = view.region_quadviews or (view.region_3d.is_orthographic_side_view and not view.region_3d.is_perspective)
grid_active = (
view.region_quadviews or
(view.region_3d.is_orthographic_side_view and not view.region_3d.is_perspective)
)
row_el.active = grid_active
row.prop(overlay, "show_floor", text="Floor")
if overlay.show_floor or overlay.show_ortho_grid:
sub = col.row(align=True)
sub.active = (overlay.show_floor and not view.region_3d.is_orthographic_side_view) or (overlay.show_ortho_grid and grid_active)
sub.active = (
(overlay.show_floor and not view.region_3d.is_orthographic_side_view) or
(overlay.show_ortho_grid and grid_active)
)
sub.prop(overlay, "grid_scale", text="Scale")
sub.prop(overlay, "grid_subdivisions", text="Subdivisions")