Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py85
1 files changed, 46 insertions, 39 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 92dc4138530..bd0959a17a7 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -6808,65 +6808,72 @@ class VIEW3D_PT_snapping(Panel):
tool_settings = context.tool_settings
snap_elements = tool_settings.snap_elements
obj = context.active_object
- object_mode = 'OBJECT' if obj is None else obj.mode
+ object_mode = obj.mode if obj else 'OBJECT'
+ show_target_options = object_mode == 'EDIT' and obj.type not in {'LATTICE', 'META', 'FONT'}
layout = self.layout
col = layout.column()
+
+ if snap_elements != {'INCREMENT'} and show_target_options:
+ col.prop(
+ tool_settings,
+ "use_snap_retopology_mode",
+ text="Use Retopology Mode",
+ # icon='MOD_MESHDEFORM',
+ )
+
col.label(text="Snap To")
col.prop(tool_settings, "snap_elements", expand=True)
- col.separator()
if 'INCREMENT' in snap_elements:
col.prop(tool_settings, "use_snap_grid_absolute")
+ if snap_elements - {'INCREMENT', 'FACE_NEAREST'}:
+ col.label(text="Snap With")
+ row = col.row(align=True)
+ row.prop(tool_settings, "snap_target", expand=True)
+
if snap_elements != {'INCREMENT'}:
- if snap_elements != {'FACE_NEAREST'}:
- col.label(text="Snap With")
- row = col.row(align=True)
- row.prop(tool_settings, "snap_target", expand=True)
-
- if obj:
- col.label(text="Target Selection")
- col_targetsel = col.column(align=True)
- if object_mode == 'EDIT' and obj.type not in {'LATTICE', 'META', 'FONT'}:
- col_targetsel.prop(
- tool_settings,
- "use_snap_self",
- text="Include Active",
- icon='EDITMODE_HLT',
- )
- col_targetsel.prop(
- tool_settings,
- "use_snap_edit",
- text="Include Edited",
- icon='OUTLINER_DATA_MESH',
- )
- col_targetsel.prop(
- tool_settings,
- "use_snap_nonedit",
- text="Include Non-Edited",
- icon='OUTLINER_OB_MESH',
- )
+ col.label(text="Target Selection")
+ col_targetsel = col.column(align=True)
+ if show_target_options:
col_targetsel.prop(
tool_settings,
- "use_snap_selectable",
- text="Exclude Non-Selectable",
- icon='RESTRICT_SELECT_OFF',
+ "use_snap_self",
+ text="Include Active",
+ icon='EDITMODE_HLT',
)
+ col_targetsel.prop(
+ tool_settings,
+ "use_snap_edit",
+ text="Include Edited",
+ icon='OUTLINER_DATA_MESH',
+ )
+ col_targetsel.prop(
+ tool_settings,
+ "use_snap_nonedit",
+ text="Include Non-Edited",
+ icon='OUTLINER_OB_MESH',
+ )
+ col_targetsel.prop(
+ tool_settings,
+ "use_snap_selectable",
+ text="Exclude Non-Selectable",
+ icon='RESTRICT_SELECT_OFF',
+ )
- if object_mode in {'OBJECT', 'POSE', 'EDIT', 'WEIGHT_PAINT'}:
- col.prop(tool_settings, "use_snap_align_rotation")
-
- col.prop(tool_settings, "use_snap_backface_culling")
-
+ col.label(text="Options")
+ # TODO(@gfxcoder): Does WEIGHT_PAINT have any snapping?
+ if object_mode in {'OBJECT', 'POSE', 'EDIT', 'WEIGHT_PAINT'}:
+ col.prop(tool_settings, "use_snap_align_rotation")
+ if snap_elements != {'FACE_NEAREST'}:
+ col.prop(tool_settings, "use_snap_backface_culling")
if 'FACE' in snap_elements:
col.prop(tool_settings, "use_snap_project")
-
if 'FACE_NEAREST' in snap_elements:
col.prop(tool_settings, 'use_snap_to_same_target')
if object_mode == 'EDIT':
col.prop(tool_settings, 'snap_face_nearest_steps')
-
if 'VOLUME' in snap_elements:
col.prop(tool_settings, "use_snap_peel_object")