WIP: Luke's Custom Build 4.1 #119952
|
@ -329,12 +329,18 @@ typedef enum {
|
|||
GHOST_kStandardCursorCrosshairA,
|
||||
GHOST_kStandardCursorCrosshairB,
|
||||
GHOST_kStandardCursorCrosshairC,
|
||||
GHOST_kStandardCursorCrosshairD,
|
||||
GHOST_kStandardCursorBlank,
|
||||
GHOST_kStandardCursorBox,
|
||||
GHOST_kStandardCursorBoxDot,
|
||||
GHOST_kStandardCursorBoxPointer,
|
||||
GHOST_kStandardCursorPencil,
|
||||
GHOST_kStandardCursorUpArrow,
|
||||
GHOST_kStandardCursorDownArrow,
|
||||
GHOST_kStandardCursorVerticalSplit,
|
||||
GHOST_kStandardCursorHorizontalSplit,
|
||||
GHOST_kStandardCursorEraser,
|
||||
GHOST_kStandardCursorPointer,
|
||||
GHOST_kStandardCursorKnife,
|
||||
GHOST_kStandardCursorEyedropper,
|
||||
GHOST_kStandardCursorZoomIn,
|
||||
|
|
|
@ -728,6 +728,9 @@ HCURSOR GHOST_WindowWin32::getStandardCursor(GHOST_TStandardCursor shape) const
|
|||
case GHOST_kStandardCursorHorizontalSplit:
|
||||
cursor = ::LoadImage(module, "splith_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break;
|
||||
case GHOST_kStandardCursorPointer:
|
||||
cursor = ::LoadImage(module, "pointer_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break;
|
||||
case GHOST_kStandardCursorKnife:
|
||||
cursor = ::LoadImage(module, "knife_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break;
|
||||
|
@ -773,6 +776,21 @@ HCURSOR GHOST_WindowWin32::getStandardCursor(GHOST_TStandardCursor shape) const
|
|||
case GHOST_kStandardCursorCrosshairC:
|
||||
cursor = ::LoadImage(module, "crossC_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break; /* Minimal Crosshair C */
|
||||
case GHOST_kStandardCursorCrosshairD:
|
||||
cursor = ::LoadImage(module, "crossD_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break; /* Open Crosshair D */
|
||||
case GHOST_kStandardCursorBlank:
|
||||
cursor = ::LoadImage(module, "blank_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break; /* Blank */
|
||||
case GHOST_kStandardCursorBox:
|
||||
cursor = ::LoadImage(module, "box_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break; /* Box */
|
||||
case GHOST_kStandardCursorBoxDot:
|
||||
cursor = ::LoadImage(module, "boxdot_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break; /* Box Dot */
|
||||
case GHOST_kStandardCursorBoxPointer:
|
||||
cursor = ::LoadImage(module, "boxpointer_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
break; /* Box Pointer */
|
||||
case GHOST_kStandardCursorBottomSide:
|
||||
case GHOST_kStandardCursorUpDown:
|
||||
cursor = ::LoadImage(module, "movens_cursor", IMAGE_CURSOR, cx, cy, flags);
|
||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -196,6 +196,8 @@ const UserDef U_default = {
|
|||
.render_display_type = USER_RENDER_DISPLAY_WINDOW,
|
||||
.filebrowser_display_type = USER_TEMP_SPACE_DISPLAY_WINDOW,
|
||||
.viewport_aa = 8,
|
||||
.selection_radius = 75.0f,
|
||||
.header_highlight = 5,
|
||||
|
||||
.walk_navigation =
|
||||
{
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
Binary file not shown.
After Width: | Height: | Size: 30 KiB |
|
@ -12,7 +12,6 @@
|
|||
APPICON ICON DISCARDABLE "winblender.ico"
|
||||
BLENDERFILE ICON DISCARDABLE "winblenderfile.ico"
|
||||
|
||||
pointer_cursor CURSOR "cursors/pointer.cur"
|
||||
moveew_cursor CURSOR "cursors/moveew.cur"
|
||||
movens_cursor CURSOR "cursors/movens.cur"
|
||||
arrowdown_cursor CURSOR "cursors/arrowdown.cur"
|
||||
|
@ -23,6 +22,12 @@ cross_cursor CURSOR "cursors/cross.cur"
|
|||
crossA_cursor CURSOR "cursors/crossa.cur"
|
||||
crossB_cursor CURSOR "cursors/crossb.cur"
|
||||
crossC_cursor CURSOR "cursors/crossc.cur"
|
||||
crossD_cursor CURSOR "cursors/crossd.cur"
|
||||
blank_cursor CURSOR "cursors/blank.cur"
|
||||
box_cursor CURSOR "cursors/box.cur"
|
||||
boxdot_cursor CURSOR "cursors/boxdot.cur"
|
||||
boxpointer_cursor CURSOR "cursors/boxpointer.cur"
|
||||
pointer_cursor CURSOR "cursors/pointera.cur"
|
||||
eraser_cursor CURSOR "cursors/eraser.cur"
|
||||
eyedropper_cursor CURSOR "cursors/eyedropper.cur"
|
||||
handopen_cursor CURSOR "cursors/handopen.cur"
|
||||
|
|
|
@ -182,7 +182,24 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
|
|||
|
||||
if map_type in {'KEYBOARD', 'MOUSE'} and kmi.value == 'CLICK_DRAG':
|
||||
subrow = sub.row()
|
||||
subrow.prop(kmi, "direction")
|
||||
if bpy.context.preferences.inputs.click_drag_direction == 'LEFT_RIGHT':
|
||||
if kmi.direction == 'ANY' or kmi.direction == 'EAST' or kmi.direction == 'WEST':
|
||||
subrow.label(text="Direction:")
|
||||
else:
|
||||
subrow.label(text="WARNING - No Direction:")
|
||||
subrow.operator("preferences.set_direction_any", text="Any", depress= kmi.direction == 'ANY').item_id = kmi.id
|
||||
subrow.operator("preferences.set_direction_left", text="Left", depress= kmi.direction == 'WEST').item_id = kmi.id
|
||||
subrow.operator("preferences.set_direction_right", text="Right", depress= kmi.direction == 'EAST').item_id = kmi.id
|
||||
elif bpy.context.preferences.inputs.click_drag_direction == 'UP_DOWN':
|
||||
if kmi.direction == 'ANY' or kmi.direction == 'NORTH' or kmi.direction == 'SOUTH':
|
||||
subrow.label(text="Direction:")
|
||||
else:
|
||||
subrow.label(text="WARNING - No Direction:")
|
||||
subrow.operator("preferences.set_direction_any", text="Any", depress= kmi.direction == 'ANY').item_id = kmi.id
|
||||
subrow.operator("preferences.set_direction_up", text="Up", depress= kmi.direction == 'NORTH').item_id = kmi.id
|
||||
subrow.operator("preferences.set_direction_down", text="Down", depress= kmi.direction == 'SOUTH').item_id = kmi.id
|
||||
else:
|
||||
subrow.prop(kmi, "direction")
|
||||
|
||||
subrow = sub.row()
|
||||
subrow.scale_x = 0.75
|
||||
|
|
|
@ -405,6 +405,111 @@ class PREFERENCES_OT_keyitem_remove(Operator):
|
|||
return {'FINISHED'}
|
||||
|
||||
|
||||
class PREFERENCES_OT_set_direction_any(Operator):
|
||||
"""Drag in any direction"""
|
||||
bl_idname = "preferences.set_direction_any"
|
||||
bl_label = "Set Direction Any"
|
||||
|
||||
item_id: IntProperty(
|
||||
name="Item Identifier",
|
||||
description="Identifier of the item to set direction for",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return hasattr(context, "keymap")
|
||||
|
||||
def execute(self, context):
|
||||
km = context.keymap
|
||||
kmi = km.keymap_items.from_id(self.item_id)
|
||||
km.keymap_items.set_direction_any(kmi)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class PREFERENCES_OT_set_direction_left(Operator):
|
||||
"""Drag to the left"""
|
||||
bl_idname = "preferences.set_direction_left"
|
||||
bl_label = "Set Direction Left"
|
||||
|
||||
item_id: IntProperty(
|
||||
name="Item Identifier",
|
||||
description="Identifier of the item to set direction for",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return hasattr(context, "keymap")
|
||||
|
||||
def execute(self, context):
|
||||
km = context.keymap
|
||||
kmi = km.keymap_items.from_id(self.item_id)
|
||||
km.keymap_items.set_direction_left(kmi)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class PREFERENCES_OT_set_direction_right(Operator):
|
||||
"""Drag to the right"""
|
||||
bl_idname = "preferences.set_direction_right"
|
||||
bl_label = "Set Direction Right"
|
||||
|
||||
item_id: IntProperty(
|
||||
name="Item Identifier",
|
||||
description="Identifier of the item to set direction for",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return hasattr(context, "keymap")
|
||||
|
||||
def execute(self, context):
|
||||
km = context.keymap
|
||||
kmi = km.keymap_items.from_id(self.item_id)
|
||||
km.keymap_items.set_direction_right(kmi)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class PREFERENCES_OT_set_direction_up(Operator):
|
||||
"""Drag upwards"""
|
||||
bl_idname = "preferences.set_direction_up"
|
||||
bl_label = "Set Direction Up"
|
||||
|
||||
item_id: IntProperty(
|
||||
name="Item Identifier",
|
||||
description="Identifier of the item to set direction for",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return hasattr(context, "keymap")
|
||||
|
||||
def execute(self, context):
|
||||
km = context.keymap
|
||||
kmi = km.keymap_items.from_id(self.item_id)
|
||||
km.keymap_items.set_direction_up(kmi)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class PREFERENCES_OT_set_direction_down(Operator):
|
||||
"""Drag downwards"""
|
||||
bl_idname = "preferences.set_direction_down"
|
||||
bl_label = "Set Direction Down"
|
||||
|
||||
item_id: IntProperty(
|
||||
name="Item Identifier",
|
||||
description="Identifier of the item to set direction for",
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
return hasattr(context, "keymap")
|
||||
|
||||
def execute(self, context):
|
||||
km = context.keymap
|
||||
kmi = km.keymap_items.from_id(self.item_id)
|
||||
km.keymap_items.set_direction_down(kmi)
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class PREFERENCES_OT_keyconfig_remove(Operator):
|
||||
"""Remove key config"""
|
||||
bl_idname = "preferences.keyconfig_remove"
|
||||
|
@ -1226,6 +1331,11 @@ classes = (
|
|||
PREFERENCES_OT_keyconfig_test,
|
||||
PREFERENCES_OT_keyitem_add,
|
||||
PREFERENCES_OT_keyitem_remove,
|
||||
PREFERENCES_OT_set_direction_any,
|
||||
PREFERENCES_OT_set_direction_left,
|
||||
PREFERENCES_OT_set_direction_right,
|
||||
PREFERENCES_OT_set_direction_up,
|
||||
PREFERENCES_OT_set_direction_down,
|
||||
PREFERENCES_OT_keyitem_restore,
|
||||
PREFERENCES_OT_keymap_restore,
|
||||
PREFERENCES_OT_theme_install,
|
||||
|
|
|
@ -426,6 +426,9 @@ class _defs_view3d_select:
|
|||
row = layout.row()
|
||||
row.use_property_split = False
|
||||
row.prop(props, "mode", text="", expand=True, icon_only=True)
|
||||
if _context.mode == 'OBJECT':
|
||||
tool_settings = _context.tool_settings
|
||||
layout.prop(tool_settings, "wireless_touch_object")
|
||||
return dict(
|
||||
idname="builtin.select_box",
|
||||
label="Select Box",
|
||||
|
@ -442,6 +445,9 @@ class _defs_view3d_select:
|
|||
row = layout.row()
|
||||
row.use_property_split = False
|
||||
row.prop(props, "mode", text="", expand=True, icon_only=True)
|
||||
if _context.mode == 'OBJECT':
|
||||
tool_settings = _context.tool_settings
|
||||
layout.prop(tool_settings, "wireless_touch_object")
|
||||
return dict(
|
||||
idname="builtin.select_lasso",
|
||||
label="Select Lasso",
|
||||
|
@ -459,6 +465,10 @@ class _defs_view3d_select:
|
|||
row.use_property_split = False
|
||||
row.prop(props, "mode", text="", expand=True, icon_only=True)
|
||||
layout.prop(props, "radius")
|
||||
tool_settings = _context.tool_settings
|
||||
layout.prop(tool_settings, "square_select")
|
||||
if _context.mode == 'OBJECT':
|
||||
layout.prop(tool_settings, "wireless_touch_object")
|
||||
|
||||
def draw_cursor(_context, tool, xy):
|
||||
from gpu_extras.presets import draw_circle_2d
|
||||
|
@ -2272,6 +2282,8 @@ class _defs_gpencil_edit:
|
|||
row.use_property_split = False
|
||||
row.prop(props, "mode", text="", expand=True, icon_only=True)
|
||||
layout.prop(props, "radius")
|
||||
tool_settings = context.tool_settings
|
||||
layout.prop(tool_settings, "square_select")
|
||||
if _defs_gpencil_edit.is_segment(context):
|
||||
layout.prop(context.tool_settings.gpencil_sculpt, "intersection_threshold")
|
||||
|
||||
|
|
|
@ -282,6 +282,7 @@ class USERPREF_PT_interface_editors(InterfacePanel, CenterAlignMixIn, Panel):
|
|||
col.prop(view, "color_picker_type")
|
||||
col.row().prop(view, "header_align")
|
||||
col.prop(view, "factor_display_type")
|
||||
col.prop(prefs.inputs, "header_highlight")
|
||||
|
||||
|
||||
class USERPREF_PT_interface_temporary_windows(InterfacePanel, CenterAlignMixIn, Panel):
|
||||
|
@ -543,6 +544,22 @@ class USERPREF_PT_edit_misc(EditingPanel, CenterAlignMixIn, Panel):
|
|||
|
||||
col = layout.column()
|
||||
col.prop(edit, "sculpt_paint_overlay_color", text="Sculpt Overlay Color")
|
||||
col.separator(factor=1.5)
|
||||
col = layout.column(heading="Adjustable Click Select")
|
||||
col.prop(edit, "adjustable_click_select")
|
||||
colsub = col.column(align=True)
|
||||
colsub.active = edit.adjustable_click_select
|
||||
colsub.prop(edit, "select_unbiased")
|
||||
colsub.prop(edit, "selection_radius")
|
||||
col.separator(factor=1.5)
|
||||
col.prop(edit, "system_cursor")
|
||||
col.prop(edit, "edit_cursor")
|
||||
col.prop(edit, "paint_cursor")
|
||||
col.prop(edit, "dot_cursor")
|
||||
col.prop(edit, "knife_cursor")
|
||||
col.prop(edit, "pencil_cursor")
|
||||
col.prop(edit, "eraser_cursor")
|
||||
col.prop(edit, "eyedropper_cursor")
|
||||
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
@ -1711,6 +1728,7 @@ class USERPREF_PT_input_mouse(InputPanel, CenterAlignMixIn, Panel):
|
|||
|
||||
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=False)
|
||||
|
||||
flow.prop(inputs, "click_drag_direction")
|
||||
if sys.platform[:3] == "win":
|
||||
flow.prop(inputs, "use_mouse_emulate_3_button")
|
||||
else:
|
||||
|
|
|
@ -783,8 +783,46 @@ class VIEW3D_HT_header(Header):
|
|||
)
|
||||
del act_mode_item
|
||||
|
||||
layout.template_header_3D_mode()
|
||||
if object_mode == 'EDIT' or object_mode == 'OBJECT':
|
||||
row = layout.row(align=True)
|
||||
row.template_header_3D_mode()
|
||||
|
||||
if object_mode == 'OBJECT':
|
||||
if tool_settings.object_select_mode == 'ENCLOSE':
|
||||
objicon = 'OBJECT_ENCLOSE'
|
||||
elif tool_settings.object_select_mode == 'ORIGIN':
|
||||
objicon = 'LIGHTPROBE_SPHERE'
|
||||
else:
|
||||
objicon = 'OBJECT_TOUCH'
|
||||
row.active = tool_settings.select_header
|
||||
row.operator("view3d.cycle_object", text="", icon=objicon)
|
||||
else:
|
||||
if tool_settings.select_header:
|
||||
if tool_settings.face_button:
|
||||
if tool_settings.face_select_mode == 'TOUCH':
|
||||
facicon = 'FACE_TOUCH'
|
||||
elif tool_settings.face_select_mode == 'ENCLOSE':
|
||||
facicon = 'FACE_ENCLOSE'
|
||||
elif tool_settings.face_select_mode == 'CENTER':
|
||||
facicon = 'LIGHTPROBE_PLANE'
|
||||
else:
|
||||
facicon = 'FACE_DEFAULT'
|
||||
row.operator("view3d.cycle_face", text="", icon=facicon)
|
||||
if tool_settings.edge_button:
|
||||
if tool_settings.edge_select_mode == 'TOUCH':
|
||||
edgicon = 'EDGE_TOUCH'
|
||||
elif tool_settings.edge_select_mode == 'ENCLOSE':
|
||||
edgicon = 'EDGE_ENCLOSE'
|
||||
else:
|
||||
edgicon = 'EDGE_DEFAULT'
|
||||
row.operator("view3d.cycle_edge", text="", icon=edgicon)
|
||||
if tool_settings.backface_button:
|
||||
row.prop(tool_settings, "backface_select", text="", icon='NORMALS_FACE')
|
||||
|
||||
row.popover(panel="VIEW3D_PT_drag_select", text="")
|
||||
else:
|
||||
layout.template_header_3D_mode()
|
||||
|
||||
# Contains buttons like Mode, Pivot, Layer, Mesh Select Mode...
|
||||
if obj:
|
||||
# Particle edit
|
||||
|
@ -1057,9 +1095,47 @@ class VIEW3D_HT_header(Header):
|
|||
):
|
||||
sub.popover(panel="VIEW3D_PT_overlay_bones", text="", icon='POSE_HLT')
|
||||
|
||||
row = layout.row()
|
||||
row = layout.row(align=True)
|
||||
row.active = (object_mode == 'EDIT') or (shading.type in {'WIREFRAME', 'SOLID'})
|
||||
|
||||
if object_mode == 'EDIT' or object_mode == 'OBJECT':
|
||||
if tool_settings.xray_header:
|
||||
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
||||
_cls = ToolSelectPanelHelper._tool_class_from_space_type('VIEW_3D')
|
||||
|
||||
if tool_settings.workspace_tool_type == 'FALLBACK':
|
||||
tool = _cls._tool_get_by_id_active(context, _cls.tool_fallback_id)[0].idname
|
||||
else:
|
||||
tool = ToolSelectPanelHelper.tool_active_from_context(context).idname
|
||||
|
||||
if object_mode in 'EDIT':
|
||||
mode_match_auto_xray = tool_settings.auto_xray_edit and tool_settings.auto_xray
|
||||
mode_match_select_through = tool_settings.select_through_edit and tool_settings.select_through
|
||||
elif object_mode in 'OBJECT':
|
||||
mode_match_auto_xray = tool_settings.auto_xray_object and tool_settings.auto_xray
|
||||
mode_match_select_through = tool_settings.select_through_object and tool_settings.select_through
|
||||
else:
|
||||
mode_match_auto_xray = False
|
||||
mode_match_select_through = False
|
||||
|
||||
if tool == "builtin.select_box":
|
||||
depress_auto_xray = mode_match_auto_xray and tool_settings.auto_xray_box
|
||||
depress_select_through = mode_match_select_through and tool_settings.select_through_box
|
||||
elif tool == "builtin.select_lasso":
|
||||
depress_auto_xray = mode_match_auto_xray and tool_settings.auto_xray_lasso
|
||||
depress_select_through = mode_match_select_through and tool_settings.select_through_lasso
|
||||
elif tool == "builtin.select_circle":
|
||||
depress_auto_xray = mode_match_auto_xray and tool_settings.auto_xray_circle
|
||||
depress_select_through = mode_match_select_through and tool_settings.select_through_circle
|
||||
else:
|
||||
depress_auto_xray = False
|
||||
depress_select_through = False
|
||||
|
||||
if tool_settings.auto_xray_button:
|
||||
row.operator("view3d.toggle_auto_xray", text="", icon='AUTO_XRAY', depress=depress_auto_xray)
|
||||
if tool_settings.select_through_button:
|
||||
row.operator("view3d.toggle_select_through", text="", icon='SELECT_THROUGH', depress=depress_select_through)
|
||||
|
||||
# While exposing `shading.show_xray(_wireframe)` is correct.
|
||||
# this hides the key shortcut from users: #70433.
|
||||
if has_pose_mode:
|
||||
|
@ -1068,15 +1144,26 @@ class VIEW3D_HT_header(Header):
|
|||
draw_depressed = shading.show_xray_wireframe
|
||||
else:
|
||||
draw_depressed = shading.show_xray
|
||||
row.operator(
|
||||
"view3d.toggle_xray",
|
||||
text="",
|
||||
icon='XRAY',
|
||||
depress=draw_depressed,
|
||||
)
|
||||
if tool_settings.xray_header:
|
||||
if tool_settings.xray_button or not tool_settings.auto_xray_button and not tool_settings.select_through_button:
|
||||
row.operator("view3d.toggle_xray", text="", icon='XRAY', depress=draw_depressed)
|
||||
else:
|
||||
row.operator("view3d.toggle_xray", text="", icon='XRAY', depress=draw_depressed)
|
||||
row.popover(panel="VIEW3D_PT_xray", text="")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(shading, "type", text="", expand=True)
|
||||
if tool_settings.shrink_shading_header:
|
||||
if shading.type == 'SOLID':
|
||||
shadicon = 'SHADING_SOLID'
|
||||
elif shading.type == 'MATERIAL':
|
||||
shadicon = 'SHADING_TEXTURE'
|
||||
elif shading.type == 'RENDERED':
|
||||
shadicon = 'SHADING_RENDERED'
|
||||
else:
|
||||
shadicon = 'SHADING_WIRE'
|
||||
row.operator("view3d.toggle_xray", text="", icon=shadicon, depress=draw_depressed)
|
||||
else:
|
||||
row.prop(shading, "type", text="", expand=True)
|
||||
sub = row.row(align=True)
|
||||
# TODO, currently render shading type ignores mesh two-side, until it's supported
|
||||
# show the shading popover which shows double-sided option.
|
||||
|
@ -1233,6 +1320,21 @@ class ShowHideMenu:
|
|||
layout.operator("%s.hide" % self._operator_name, text="Hide Unselected").unselected = True
|
||||
|
||||
|
||||
# Custom Operators
|
||||
class VIEW3D_box_lasso(bpy.types.Operator):
|
||||
bl_idname = "view3d.box_lasso"
|
||||
bl_label = "box lasso"
|
||||
|
||||
def invoke(self, context, event):
|
||||
from bl_ui.space_toolsystem_common import ToolSelectPanelHelper
|
||||
tool = ToolSelectPanelHelper.tool_active_from_context(context)
|
||||
if tool.idname == "builtin.select_box":
|
||||
bpy.ops.wm.tool_set_by_id(name="builtin.select_lasso")
|
||||
else:
|
||||
bpy.ops.wm.tool_set_by_id(name="builtin.select_box")
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
# Standard transforms which apply to all cases (mix-in class, not used directly).
|
||||
class VIEW3D_MT_transform_base:
|
||||
bl_label = "Transform"
|
||||
|
@ -6493,6 +6595,13 @@ class VIEW3D_PT_shading(Panel):
|
|||
def draw(self, _context):
|
||||
layout = self.layout
|
||||
layout.label(text="Viewport Shading")
|
||||
tool_settings = _context.tool_settings
|
||||
shading = VIEW3D_PT_shading.get_shading(_context)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "shrink_shading_header", toggle=True)
|
||||
if tool_settings.shrink_shading_header:
|
||||
row.prop(shading, "type", text="", expand=True)
|
||||
|
||||
|
||||
class VIEW3D_PT_shading_lighting(Panel):
|
||||
|
@ -6684,17 +6793,7 @@ class VIEW3D_PT_shading_options(Panel):
|
|||
|
||||
row = col.row(align=True)
|
||||
|
||||
if shading.type == 'WIREFRAME':
|
||||
row.prop(shading, "show_xray_wireframe", text="")
|
||||
sub = row.row()
|
||||
sub.active = shading.show_xray_wireframe
|
||||
sub.prop(shading, "xray_alpha_wireframe", text="X-Ray")
|
||||
elif shading.type == 'SOLID':
|
||||
row.prop(shading, "show_xray", text="")
|
||||
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
|
||||
if shading.type == 'SOLID':
|
||||
xray_active = shading.show_xray and shading.xray_alpha != 1
|
||||
|
||||
row = col.row(align=True)
|
||||
|
@ -6879,6 +6978,135 @@ class VIEW3D_PT_gizmo_display(Panel):
|
|||
col.prop(view, "show_gizmo_camera_dof_distance", text="Focus Distance")
|
||||
|
||||
|
||||
class VIEW3D_PT_drag_select(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_label = "Drag Select Settings"
|
||||
bl_ui_units_x = 12
|
||||
|
||||
def draw(self, context):
|
||||
obj = context.active_object
|
||||
object_mode = 'OBJECT' if obj is None else obj.mode
|
||||
tool_settings = context.tool_settings
|
||||
layout = self.layout
|
||||
layout.label(text="Drag Select Settings")
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Selection Control", emboss=False)
|
||||
if tool_settings.select_header:
|
||||
row.prop(tool_settings, "select_header", text="Header", toggle=True)
|
||||
if object_mode == 'OBJECT':
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Object Select", emboss=False)
|
||||
row.prop(tool_settings, "object_select_mode", text="")
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Object Header Button Modes", emboss=False)
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "object_cycle_touch", toggle=True)
|
||||
row.prop(tool_settings, "object_cycle_enclose", toggle=True)
|
||||
row.prop(tool_settings, "object_cycle_origin", toggle=True)
|
||||
else:
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Face Select", emboss=False)
|
||||
row.prop(tool_settings, "face_select_mode", text="")
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Edge Select", emboss=False)
|
||||
row.prop(tool_settings, "edge_select_mode", text="")
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "backface_select", toggle=True)
|
||||
if tool_settings.backface_select:
|
||||
row.prop(tool_settings, "backface_select_mode", text="")
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Header Buttons", emboss=False)
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "face_button", toggle=True)
|
||||
row.prop(tool_settings, "edge_button", toggle=True)
|
||||
row.prop(tool_settings, "backface_button", toggle=True)
|
||||
if tool_settings.face_button:
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Face Header Button Modes", emboss=False)
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "face_cycle_default", toggle=True)
|
||||
row.prop(tool_settings, "face_cycle_touch", toggle=True)
|
||||
row.prop(tool_settings, "face_cycle_enclose", toggle=True)
|
||||
row.prop(tool_settings, "face_cycle_center", toggle=True)
|
||||
if tool_settings.edge_button:
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Edge Header Button Modes", emboss=False)
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "edge_cycle_default", toggle=True)
|
||||
row.prop(tool_settings, "edge_cycle_touch", toggle=True)
|
||||
row.prop(tool_settings, "edge_cycle_enclose", toggle=True)
|
||||
else:
|
||||
row.prop(tool_settings, "select_header", text="Keymap", toggle=True)
|
||||
|
||||
|
||||
class VIEW3D_PT_xray(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
bl_label = "X-Ray Settings"
|
||||
bl_ui_units_x = 14
|
||||
|
||||
def draw(self, context):
|
||||
tool_settings = context.tool_settings
|
||||
shading = VIEW3D_PT_shading.get_shading(context)
|
||||
layout = self.layout
|
||||
layout.label(text="X-Ray Settings")
|
||||
|
||||
row = layout.row(align=True)
|
||||
if shading.type == 'WIREFRAME':
|
||||
row.prop(shading, "show_xray_wireframe", text="X-Ray Wireframe", toggle=True)
|
||||
if shading.show_xray_wireframe:
|
||||
row.prop(shading, "xray_alpha_wireframe", text="")
|
||||
elif shading.type == 'SOLID':
|
||||
row.prop(shading, "show_xray", text="X-Ray Solid", toggle=True)
|
||||
if shading.show_xray:
|
||||
row.prop(shading, "xray_alpha", text="")
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="X-Ray Control", emboss=False)
|
||||
if tool_settings.xray_header:
|
||||
row.prop(tool_settings, "xray_header", text="Header", toggle=True)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Automatic X-Ray", emboss=False)
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "auto_xray")
|
||||
sub = row.row(align=True)
|
||||
sub.active = tool_settings.auto_xray
|
||||
sub.prop(tool_settings, "auto_xray_object")
|
||||
sub.prop(tool_settings, "auto_xray_edit")
|
||||
row = layout.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
sub.active = tool_settings.auto_xray
|
||||
sub.prop(tool_settings, "auto_xray_box", toggle=True)
|
||||
sub.prop(tool_settings, "auto_xray_lasso", toggle=True)
|
||||
sub.prop(tool_settings, "auto_xray_circle", toggle=True)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Select Through", emboss=False)
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "select_through")
|
||||
sub = row.row(align=True)
|
||||
sub.active = tool_settings.select_through
|
||||
sub.prop(tool_settings, "select_through_object")
|
||||
sub.prop(tool_settings, "select_through_edit")
|
||||
row = layout.row(align=True)
|
||||
sub = row.row(align=True)
|
||||
sub.active = tool_settings.select_through
|
||||
sub.prop(tool_settings, "select_through_box", toggle=True)
|
||||
sub.prop(tool_settings, "select_through_lasso", toggle=True)
|
||||
sub.prop(tool_settings, "select_through_circle", toggle=True)
|
||||
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "blank_text", text="Header Buttons", emboss=False)
|
||||
row = layout.row(align=True)
|
||||
row.prop(tool_settings, "auto_xray_button", toggle=True)
|
||||
row.prop(tool_settings, "select_through_button", toggle=True)
|
||||
row.prop(tool_settings, "xray_button", toggle=True)
|
||||
|
||||
else:
|
||||
row.prop(tool_settings, "xray_header", text="Keymap", toggle=True)
|
||||
|
||||
class VIEW3D_PT_overlay(Panel):
|
||||
bl_space_type = 'VIEW_3D'
|
||||
bl_region_type = 'HEADER'
|
||||
|
@ -7131,6 +7359,21 @@ class VIEW3D_PT_overlay_edit_mesh(Panel):
|
|||
|
||||
is_any_solid_shading = not (shading.show_xray or (shading.type == 'WIREFRAME'))
|
||||
|
||||
if shading.type == 'WIREFRAME':
|
||||
xray = shading.show_xray_wireframe and shading.xray_alpha_wireframe < 1.0
|
||||
elif shading.type == 'SOLID':
|
||||
xray = shading.show_xray and shading.xray_alpha < 1.0
|
||||
else:
|
||||
xray = False
|
||||
|
||||
if xray:
|
||||
fdot_draw_depressed = overlay.show_face_center_xray
|
||||
else:
|
||||
fdot_draw_depressed = overlay.show_face_center
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
|
||||
col = layout.column()
|
||||
col.active = display_all
|
||||
|
||||
|
@ -7139,8 +7382,7 @@ class VIEW3D_PT_overlay_edit_mesh(Panel):
|
|||
sub = split.column()
|
||||
sub.prop(overlay, "show_faces", text="Faces")
|
||||
sub = split.column()
|
||||
sub.active = is_any_solid_shading
|
||||
sub.prop(overlay, "show_face_center", text="Center")
|
||||
sub.operator("view3d.toggle_facedots", text="Facedots", depress = fdot_draw_depressed)
|
||||
|
||||
row = col.row(align=True)
|
||||
row.prop(overlay, "show_edge_crease", text="Creases", toggle=True)
|
||||
|
@ -9018,6 +9260,7 @@ classes = (
|
|||
VIEW3D_MT_sculpt_gpencil_automasking_pie,
|
||||
VIEW3D_MT_wpaint_vgroup_lock_pie,
|
||||
VIEW3D_MT_sculpt_face_sets_edit_pie,
|
||||
VIEW3D_box_lasso,
|
||||
VIEW3D_MT_sculpt_curves,
|
||||
VIEW3D_PT_active_tool,
|
||||
VIEW3D_PT_active_tool_duplicate,
|
||||
|
@ -9042,6 +9285,8 @@ classes = (
|
|||
VIEW3D_PT_shading_render_pass,
|
||||
VIEW3D_PT_shading_compositor,
|
||||
VIEW3D_PT_gizmo_display,
|
||||
VIEW3D_PT_drag_select,
|
||||
VIEW3D_PT_xray,
|
||||
VIEW3D_PT_overlay,
|
||||
VIEW3D_PT_overlay_guides,
|
||||
VIEW3D_PT_overlay_object,
|
||||
|
|
|
@ -161,7 +161,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
|
|||
bl_context = ".mesh_edit" # dot on purpose (access from topbar)
|
||||
bl_label = "Options"
|
||||
bl_options = {'DEFAULT_CLOSED'}
|
||||
bl_ui_units_x = 12
|
||||
bl_ui_units_x = 13
|
||||
|
||||
def draw(self, _context):
|
||||
# layout = self.layout
|
||||
|
|
|
@ -26,7 +26,8 @@ bool BLI_lasso_is_edge_inside(const int mcoords[][2],
|
|||
int y0,
|
||||
int x1,
|
||||
int y1,
|
||||
int error_value);
|
||||
int error_value,
|
||||
bool fully_inside);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -57,7 +57,8 @@ bool BLI_lasso_is_edge_inside(const int mcoords[][2],
|
|||
int y0,
|
||||
int x1,
|
||||
int y1,
|
||||
const int error_value)
|
||||
const int error_value,
|
||||
bool fully_inside)
|
||||
{
|
||||
|
||||
if (x0 == error_value || x1 == error_value || mcoords_len == 0) {
|
||||
|
@ -66,23 +67,32 @@ bool BLI_lasso_is_edge_inside(const int mcoords[][2],
|
|||
|
||||
const int v1[2] = {x0, y0}, v2[2] = {x1, y1};
|
||||
|
||||
/* check points in lasso */
|
||||
if (BLI_lasso_is_point_inside(mcoords, mcoords_len, v1[0], v1[1], error_value)) {
|
||||
return true;
|
||||
}
|
||||
if (BLI_lasso_is_point_inside(mcoords, mcoords_len, v2[0], v2[1], error_value)) {
|
||||
/* enclosed faces only checks for both points inside selection area */
|
||||
if (BLI_lasso_is_point_inside(mcoords, mcoords_len, v1[0], v1[1], error_value) &&
|
||||
BLI_lasso_is_point_inside(mcoords, mcoords_len, v2[0], v2[1], error_value))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* no points in lasso, so we have to intersect with lasso edge */
|
||||
|
||||
if (isect_seg_seg_v2_int(mcoords[0], mcoords[mcoords_len - 1], v1, v2) > 0) {
|
||||
return true;
|
||||
}
|
||||
for (uint a = 0; a < mcoords_len - 1; a++) {
|
||||
if (isect_seg_seg_v2_int(mcoords[a], mcoords[a + 1], v1, v2) > 0) {
|
||||
if (!fully_inside) {
|
||||
/* check points in lasso */
|
||||
if (BLI_lasso_is_point_inside(mcoords, mcoords_len, v1[0], v1[1], error_value)) {
|
||||
return true;
|
||||
}
|
||||
if (BLI_lasso_is_point_inside(mcoords, mcoords_len, v2[0], v2[1], error_value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* no points in lasso, so we have to intersect with lasso edge */
|
||||
|
||||
if (isect_seg_seg_v2_int(mcoords[0], mcoords[mcoords_len - 1], v1, v2) > 0) {
|
||||
return true;
|
||||
}
|
||||
for (unsigned int a = 0; a < mcoords_len - 1; a++) {
|
||||
if (isect_seg_seg_v2_int(mcoords[a], mcoords[a + 1], v1, v2) > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -203,6 +203,8 @@ static void blo_update_defaults_screen(bScreen *screen,
|
|||
/* Disable Curve Normals. */
|
||||
v3d->overlay.edit_flag &= ~V3D_OVERLAY_EDIT_CU_NORMALS;
|
||||
v3d->overlay.normals_constant_screen_size = 7.0f;
|
||||
/* Show xray facedots */
|
||||
v3d->overlay.edit_flag |= V3D_OVERLAY_EDIT_FACE_DOT_XRAY;
|
||||
}
|
||||
else if (area->spacetype == SPACE_CLIP) {
|
||||
SpaceClip *sclip = static_cast<SpaceClip *>(area->spacedata.first);
|
||||
|
@ -392,6 +394,33 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene)
|
|||
if (ts->unified_paint_settings.input_samples == 0) {
|
||||
ts->unified_paint_settings.input_samples = 1;
|
||||
}
|
||||
|
||||
/* Drag Select. */
|
||||
ts->xray_button = true;
|
||||
ts->auto_xray_object = true;
|
||||
ts->auto_xray_edit = true;
|
||||
ts->auto_xray_box = true;
|
||||
ts->auto_xray_lasso = true;
|
||||
ts->auto_xray_circle = true;
|
||||
ts->select_through = true;
|
||||
ts->select_through_object = true;
|
||||
ts->select_through_box = true;
|
||||
ts->select_through_lasso = true;
|
||||
ts->select_through_circle = true;
|
||||
ts->object_cycle_touch = true;
|
||||
ts->object_cycle_enclose = true;
|
||||
ts->object_cycle_origin = true;
|
||||
ts->face_cycle_default = true;
|
||||
ts->face_cycle_touch = true;
|
||||
ts->face_cycle_enclose = true;
|
||||
ts->face_cycle_center = true;
|
||||
ts->edge_cycle_default = true;
|
||||
ts->edge_cycle_touch = true;
|
||||
ts->edge_cycle_enclose = true;
|
||||
ts->object_select_mode = 1;
|
||||
ts->face_select_mode = 1;
|
||||
ts->edge_select_mode = 1;
|
||||
ts->backface_select_mode = 2;
|
||||
}
|
||||
|
||||
void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
|
||||
|
|
|
@ -490,9 +490,8 @@ void blo_do_versions_userdef(UserDef *userdef)
|
|||
|
||||
if (!USER_VERSION_ATLEAST(278, 6)) {
|
||||
/* Clear preference flags for re-use. */
|
||||
userdef->flag &= ~(USER_FLAG_NUMINPUT_ADVANCED | (1 << 2) | USER_FLAG_UNUSED_3 |
|
||||
USER_FLAG_UNUSED_6 | USER_FLAG_UNUSED_7 | USER_FLAG_UNUSED_9 |
|
||||
USER_DEVELOPER_UI);
|
||||
userdef->flag &= ~(USER_FLAG_NUMINPUT_ADVANCED | (1 << 2) | USER_FLAG_UNUSED_6 |
|
||||
USER_FLAG_UNUSED_7 | USER_FLAG_UNUSED_9 | USER_DEVELOPER_UI);
|
||||
userdef->uiflag &= ~(USER_HEADER_BOTTOM);
|
||||
userdef->transopts &= ~(USER_TR_UNUSED_3 | USER_TR_UNUSED_4 | USER_TR_UNUSED_6 |
|
||||
USER_TR_UNUSED_7);
|
||||
|
@ -581,8 +580,6 @@ void blo_do_versions_userdef(UserDef *userdef)
|
|||
|
||||
copy_v3_fl3(userdef->light_ambient, 0.025000, 0.025000, 0.025000);
|
||||
|
||||
userdef->flag &= ~(USER_FLAG_UNUSED_4);
|
||||
|
||||
userdef->uiflag &= ~(USER_HEADER_FROM_PREF | USER_REGISTER_ALL_USERS);
|
||||
}
|
||||
|
||||
|
@ -921,6 +918,9 @@ void blo_do_versions_userdef(UserDef *userdef)
|
|||
STRNCPY(km->idname, "NLA Tracks");
|
||||
}
|
||||
}
|
||||
|
||||
userdef->header_highlight = 5;
|
||||
userdef->selection_radius = 75.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,8 +61,10 @@ void OVERLAY_edit_mesh_cache_init(OVERLAY_Data *vedata)
|
|||
bool select_face = pd->edit_mesh.select_face = (tsettings->selectmode & SCE_SELECT_FACE) != 0;
|
||||
bool select_edge = pd->edit_mesh.select_edge = (tsettings->selectmode & SCE_SELECT_EDGE) != 0;
|
||||
|
||||
bool show_face_dots = (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_FACE_DOT) != 0 ||
|
||||
pd->edit_mesh.do_zbufclip;
|
||||
bool show_face_dots = !XRAY_FLAG_ENABLED(draw_ctx->v3d) &&
|
||||
v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_FACE_DOT ||
|
||||
XRAY_FLAG_ENABLED(draw_ctx->v3d) &&
|
||||
v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_FACE_DOT_XRAY;
|
||||
|
||||
bool show_retopology = RETOPOLOGY_ENABLED(v3d);
|
||||
float retopology_offset = RETOPOLOGY_OFFSET(v3d);
|
||||
|
|
|
@ -59,7 +59,9 @@ static bool check_ob_drawface_dot(short select_mode, const View3D *v3d, eDrawTyp
|
|||
{
|
||||
if (select_mode & SCE_SELECT_FACE) {
|
||||
if ((dt < OB_SOLID) || XRAY_FLAG_ENABLED(v3d)) {
|
||||
return true;
|
||||
if (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_FACE_DOT_XRAY) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (v3d->overlay.edit_flag & V3D_OVERLAY_EDIT_FACE_DOT) {
|
||||
return true;
|
||||
|
|
|
@ -832,7 +832,8 @@ bool select_lasso(const ViewContext &vc,
|
|||
int(pos1_proj.y),
|
||||
int(pos2_proj.x),
|
||||
int(pos2_proj.y),
|
||||
IS_CLIPPED))
|
||||
IS_CLIPPED,
|
||||
false))
|
||||
{
|
||||
apply_selection_operation_at_index(selection.span, curve_i, sel_op);
|
||||
changed = true;
|
||||
|
|
|
@ -1490,7 +1490,8 @@ static bool gpencil_stroke_do_circle_sel(bGPdata *gpd,
|
|||
const float diff_mat[4][4],
|
||||
const int selectmode,
|
||||
const float scale,
|
||||
const bool is_curve_edit)
|
||||
const bool is_curve_edit,
|
||||
const bool square)
|
||||
{
|
||||
bGPDspoint *pt = nullptr;
|
||||
int x0 = 0, y0 = 0;
|
||||
|
@ -1510,7 +1511,9 @@ static bool gpencil_stroke_do_circle_sel(bGPdata *gpd,
|
|||
/* do boundbox check first */
|
||||
if (!ELEM(V2D_IS_CLIPPED, x0, y0) && BLI_rcti_isect_pt(rect, x0, y0)) {
|
||||
/* only check if point is inside */
|
||||
if (((x0 - mx) * (x0 - mx) + (y0 - my) * (y0 - my)) <= radius * radius) {
|
||||
if (square ? BLI_rcti_isect_pt(rect, x0, y0) :
|
||||
((x0 - mx) * (x0 - mx) + (y0 - my) * (y0 - my)) <= radius * radius)
|
||||
{
|
||||
hit = true;
|
||||
|
||||
/* change selection */
|
||||
|
@ -1581,7 +1584,8 @@ static bool gpencil_do_curve_circle_sel(bContext *C,
|
|||
const bool select,
|
||||
rcti *rect,
|
||||
const float diff_mat[4][4],
|
||||
const int selectmode)
|
||||
const int selectmode,
|
||||
const bool square)
|
||||
{
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
|
@ -1629,7 +1633,7 @@ static bool gpencil_do_curve_circle_sel(bContext *C,
|
|||
int dist_x = screen_co[0] - mx;
|
||||
int dist_y = screen_co[1] - my;
|
||||
int dist = dist_x * dist_x + dist_y * dist_y;
|
||||
if (dist <= radius * radius) {
|
||||
if (square ? BLI_rcti_isect_pt(rect, screen_co[0], screen_co[1]) : dist <= radius * radius) {
|
||||
hit = true;
|
||||
/* change selection */
|
||||
if (select) {
|
||||
|
@ -1674,6 +1678,7 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op)
|
|||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
const bool is_curve_edit = bool(GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd));
|
||||
const bool square = ts->square_select;
|
||||
|
||||
int selectmode;
|
||||
if (ob && ob->mode == OB_MODE_SCULPT_GPENCIL_LEGACY) {
|
||||
|
@ -1729,7 +1734,7 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op)
|
|||
GP_EDITABLE_CURVES_BEGIN(gps_iter, C, gpl, gps, gpc)
|
||||
{
|
||||
changed |= gpencil_do_curve_circle_sel(
|
||||
C, gps, gpc, mx, my, radius, select, &rect, gps_iter.diff_mat, selectmode);
|
||||
C, gps, gpc, mx, my, radius, select, &rect, gps_iter.diff_mat, selectmode, square);
|
||||
}
|
||||
GP_EDITABLE_CURVES_END(gps_iter);
|
||||
}
|
||||
|
@ -1758,7 +1763,8 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op)
|
|||
gpstroke_iter.diff_mat,
|
||||
selectmode,
|
||||
scale,
|
||||
is_curve_edit);
|
||||
is_curve_edit,
|
||||
square);
|
||||
}
|
||||
GP_EVALUATED_STROKES_END(gpstroke_iter);
|
||||
}
|
||||
|
|
|
@ -430,8 +430,8 @@ DEF_ICON(IMAGE_REFERENCE)
|
|||
|
||||
/* EMPTY */
|
||||
DEF_ICON_BLANK(445)
|
||||
DEF_ICON_BLANK(446)
|
||||
DEF_ICON_BLANK(447)
|
||||
DEF_ICON(OBJECT_ENCLOSE)
|
||||
DEF_ICON(FACE_TOUCH)
|
||||
DEF_ICON(NODE_INSERT_ON)
|
||||
DEF_ICON(NODE_INSERT_OFF)
|
||||
DEF_ICON(NODE_TOP)
|
||||
|
@ -442,14 +442,14 @@ DEF_ICON(ANCHOR_BOTTOM)
|
|||
DEF_ICON(ANCHOR_LEFT)
|
||||
DEF_ICON(ANCHOR_RIGHT)
|
||||
DEF_ICON(ANCHOR_CENTER)
|
||||
DEF_ICON_BLANK(703)
|
||||
DEF_ICON_BLANK(704)
|
||||
DEF_ICON_BLANK(705)
|
||||
DEF_ICON_BLANK(706)
|
||||
DEF_ICON_BLANK(707)
|
||||
DEF_ICON_BLANK(708)
|
||||
DEF_ICON_BLANK(709)
|
||||
DEF_ICON_BLANK(710)
|
||||
DEF_ICON(EDGE_DEFAULT)
|
||||
DEF_ICON(EDGE_ENCLOSE)
|
||||
DEF_ICON(EDGE_TOUCH)
|
||||
DEF_ICON(FACE_DEFAULT)
|
||||
DEF_ICON(FACE_ENCLOSE)
|
||||
DEF_ICON(OBJECT_TOUCH)
|
||||
DEF_ICON(AUTO_XRAY)
|
||||
DEF_ICON(SELECT_THROUGH)
|
||||
DEF_ICON(SELECT_SET)
|
||||
DEF_ICON(SELECT_EXTEND)
|
||||
DEF_ICON(SELECT_SUBTRACT)
|
||||
|
|
|
@ -248,7 +248,7 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
|
|||
|
||||
case TH_HEADER_ACTIVE: {
|
||||
cp = ts->header;
|
||||
const int factor = 5;
|
||||
const int factor = U.header_highlight;
|
||||
/* Lighten the header color when editor is active. */
|
||||
header_active[0] = cp[0] > 245 ? cp[0] - factor : cp[0] + factor;
|
||||
header_active[1] = cp[1] > 245 ? cp[1] - factor : cp[1] + factor;
|
||||
|
|
|
@ -246,7 +246,9 @@ static void findnearestvert__doClosest(void *user_data,
|
|||
|
||||
dist_test = dist_test_bias = len_manhattan_v2v2(data->mval_fl, screen_co);
|
||||
|
||||
if (data->use_select_bias && BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
|
||||
if (!(U.flag & USER_ADJUSTABLE_CLICK_SELECT && U.flag & USER_SELECT_UNBIASED) &&
|
||||
data->use_select_bias && BM_elem_flag_test(eve, BM_ELEM_SELECT))
|
||||
{
|
||||
dist_test_bias += FIND_NEAR_SELECT_BIAS;
|
||||
}
|
||||
|
||||
|
@ -455,7 +457,9 @@ static void find_nearest_edge__doClosest(void *user_data,
|
|||
|
||||
dist_test = dist_test_bias = len_manhattan_v2v2(data->mval_fl, screen_co);
|
||||
|
||||
if (data->use_select_bias && BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
|
||||
if (!(U.flag & USER_ADJUSTABLE_CLICK_SELECT && U.flag & USER_SELECT_UNBIASED) &&
|
||||
data->use_select_bias && BM_elem_flag_test(eed, BM_ELEM_SELECT))
|
||||
{
|
||||
dist_test_bias += FIND_NEAR_SELECT_BIAS;
|
||||
}
|
||||
|
||||
|
@ -688,7 +692,9 @@ static void findnearestface__doClosest(void *user_data,
|
|||
|
||||
dist_test = dist_test_bias = len_manhattan_v2v2(data->mval_fl, screen_co);
|
||||
|
||||
if (data->use_select_bias && BM_elem_flag_test(efa, BM_ELEM_SELECT)) {
|
||||
if (!(U.flag & USER_ADJUSTABLE_CLICK_SELECT && U.flag & USER_SELECT_UNBIASED) &&
|
||||
data->use_select_bias && BM_elem_flag_test(efa, BM_ELEM_SELECT))
|
||||
{
|
||||
dist_test_bias += FIND_NEAR_SELECT_BIAS;
|
||||
}
|
||||
|
||||
|
@ -724,27 +730,27 @@ BMFace *EDBM_face_find_nearest_ex(ViewContext *vc,
|
|||
uint base_index = 0;
|
||||
|
||||
if (!XRAY_FLAG_ENABLED(vc->v3d)) {
|
||||
float dist_test;
|
||||
float dist_test = 0.0f;
|
||||
uint index;
|
||||
BMFace *efa;
|
||||
uint dist_px_manhattan_test = 0;
|
||||
|
||||
{
|
||||
uint dist_px_manhattan_test = 0;
|
||||
if (*dist_px_manhattan_p != 0.0f && (use_zbuf_single_px == false)) {
|
||||
dist_px_manhattan_test = uint(
|
||||
ED_view3d_backbuf_sample_size_clamp(vc->region, *dist_px_manhattan_p));
|
||||
if (U.flag & USER_ADJUSTABLE_CLICK_SELECT ||
|
||||
*dist_px_manhattan_p != 0.0f && (use_zbuf_single_px == false))
|
||||
{
|
||||
dist_px_manhattan_test = (uint)ED_view3d_backbuf_sample_size_clamp(vc->region,
|
||||
*dist_px_manhattan_p);
|
||||
}
|
||||
|
||||
DRW_select_buffer_context_create(vc->depsgraph, bases, SCE_SELECT_FACE);
|
||||
|
||||
if (dist_px_manhattan_test == 0) {
|
||||
if (!(U.flag & USER_ADJUSTABLE_CLICK_SELECT) && dist_px_manhattan_test == 0) {
|
||||
index = DRW_select_buffer_sample_point(vc->depsgraph, vc->region, vc->v3d, vc->mval);
|
||||
dist_test = 0.0f;
|
||||
}
|
||||
else {
|
||||
index = DRW_select_buffer_find_nearest_to_point(
|
||||
vc->depsgraph, vc->region, vc->v3d, vc->mval, 1, UINT_MAX, &dist_px_manhattan_test);
|
||||
dist_test = dist_px_manhattan_test;
|
||||
}
|
||||
|
||||
if (index) {
|
||||
|
@ -778,7 +784,14 @@ BMFace *EDBM_face_find_nearest_ex(ViewContext *vc,
|
|||
/* end exception */
|
||||
|
||||
if (efa) {
|
||||
if (dist_test < *dist_px_manhattan_p) {
|
||||
if (U.flag & USER_ADJUSTABLE_CLICK_SELECT && dist_px_manhattan_test < *dist_px_manhattan_p) {
|
||||
if (r_base_index) {
|
||||
*r_base_index = base_index;
|
||||
}
|
||||
*dist_px_manhattan_p = dist_px_manhattan_test;
|
||||
return efa;
|
||||
}
|
||||
else if (!(U.flag & USER_ADJUSTABLE_CLICK_SELECT) && dist_test < *dist_px_manhattan_p) {
|
||||
if (r_base_index) {
|
||||
*r_base_index = base_index;
|
||||
}
|
||||
|
|
|
@ -3982,6 +3982,62 @@ static void SCREEN_OT_repeat_history(wmOperatorType *ot)
|
|||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Invoke Last Operator
|
||||
* \{ */
|
||||
|
||||
static int invoke_last_exec(bContext *C, wmOperator * /*op*/)
|
||||
{
|
||||
wmWindowManager *wm = CTX_wm_manager(C);
|
||||
wmOperator *lastop = static_cast<wmOperator *>(wm->operators.last);
|
||||
|
||||
/* Seek last registered operator */
|
||||
while (lastop) {
|
||||
if (lastop->type->flag & OPTYPE_REGISTER) {
|
||||
if (STREQ(lastop->idname, "MESH_OT_delete") || STREQ(lastop->idname, "MESH_OT_select_all") ||
|
||||
STREQ(lastop->idname, "MESH_OT_select_mode") ||
|
||||
STREQ(lastop->idname, "OBJECT_OT_editmode_toggle") ||
|
||||
STREQ(lastop->idname, "OBJECT_OT_select_all") ||
|
||||
STREQ(lastop->idname, "TRANSFORM_OT_resize") ||
|
||||
STREQ(lastop->idname, "TRANSFORM_OT_rotate") ||
|
||||
STREQ(lastop->idname, "TRANSFORM_OT_trackball") ||
|
||||
STREQ(lastop->idname, "TRANSFORM_OT_translate"))
|
||||
{
|
||||
lastop = lastop->prev;
|
||||
}
|
||||
else {
|
||||
// printf(lastop->idname, "\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
lastop = lastop->prev;
|
||||
}
|
||||
}
|
||||
|
||||
if (lastop) {
|
||||
WM_operator_free_all_after(wm, lastop);
|
||||
WM_operator_invoke_last(C, lastop);
|
||||
}
|
||||
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
static void SCREEN_OT_invoke_last(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Invoke Last";
|
||||
ot->description = "Invoke last operation";
|
||||
ot->idname = "SCREEN_OT_invoke_last";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = invoke_last_exec;
|
||||
|
||||
ot->poll = ED_operator_screenactive;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Redo Operator
|
||||
* \{ */
|
||||
|
@ -5863,6 +5919,7 @@ void ED_operatortypes_screen()
|
|||
WM_operatortype_append(SCREEN_OT_actionzone);
|
||||
WM_operatortype_append(SCREEN_OT_repeat_last);
|
||||
WM_operatortype_append(SCREEN_OT_repeat_history);
|
||||
WM_operatortype_append(SCREEN_OT_invoke_last);
|
||||
WM_operatortype_append(SCREEN_OT_redo_last);
|
||||
|
||||
/* Screen tools. */
|
||||
|
|
|
@ -875,9 +875,12 @@ static int node_circleselect_exec(bContext *C, wmOperator *op)
|
|||
SpaceNode *snode = CTX_wm_space_node(C);
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
bNodeTree &node_tree = *snode->edittree;
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
const bool square = ts->square_select;
|
||||
|
||||
int x, y, radius;
|
||||
float2 offset;
|
||||
rctf rectf;
|
||||
|
||||
float zoom = float(BLI_rcti_size_x(®ion->winrct)) / float(BLI_rctf_size_x(®ion->v2d.cur));
|
||||
|
||||
|
@ -896,6 +899,11 @@ static int node_circleselect_exec(bContext *C, wmOperator *op)
|
|||
|
||||
UI_view2d_region_to_view(®ion->v2d, x, y, &offset.x, &offset.y);
|
||||
|
||||
if (square) {
|
||||
BLI_rctf_init(&rectf, x - radius, x + radius, y - radius, y + radius);
|
||||
UI_view2d_region_to_view_rctf(®ion->v2d, &rectf, &rectf);
|
||||
}
|
||||
|
||||
for (bNode *node : node_tree.all_nodes()) {
|
||||
switch (node->type) {
|
||||
case NODE_FRAME: {
|
||||
|
@ -904,16 +912,32 @@ static int node_circleselect_exec(bContext *C, wmOperator *op)
|
|||
rctf frame_inside = node_frame_rect_inside(*snode, *node);
|
||||
const float radius_adjusted = float(radius) / zoom;
|
||||
BLI_rctf_pad(&frame_inside, -2.0f * radius_adjusted, -2.0f * radius_adjusted);
|
||||
if (BLI_rctf_isect_circle(&node->runtime->totr, offset, radius_adjusted) &&
|
||||
!BLI_rctf_isect_circle(&frame_inside, offset, radius_adjusted))
|
||||
{
|
||||
nodeSetSelected(node, select);
|
||||
if (square) {
|
||||
if (BLI_rctf_isect(&rectf, &node->runtime->totr, nullptr) &&
|
||||
!BLI_rctf_inside_rctf(&frame_inside, &rectf))
|
||||
{
|
||||
nodeSetSelected(node, select);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (BLI_rctf_isect_circle(&node->runtime->totr, offset, radius_adjusted) &&
|
||||
!BLI_rctf_isect_circle(&frame_inside, offset, radius_adjusted))
|
||||
{
|
||||
nodeSetSelected(node, select);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
if (BLI_rctf_isect_circle(&node->runtime->totr, offset, radius / zoom)) {
|
||||
nodeSetSelected(node, select);
|
||||
if (square) {
|
||||
if (BLI_rctf_isect(&rectf, &node->runtime->totr, nullptr)) {
|
||||
nodeSetSelected(node, select);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (BLI_rctf_isect_circle(&node->runtime->totr, offset, radius / zoom)) {
|
||||
nodeSetSelected(node, select);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1243,3 +1243,430 @@ void VIEW3D_OT_toggle_xray(wmOperatorType *ot)
|
|||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Toggle Automatic XRay
|
||||
* \{ */
|
||||
|
||||
static int toggle_auto_xray_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
bToolRef *tref = area->runtime.tool;
|
||||
const bool mode_match = obedit ? ts->auto_xray_edit : ts->auto_xray_object;
|
||||
|
||||
if (STREQ(tref->idname, "builtin.select_box") ||
|
||||
STREQ(tref->idname_fallback, "builtin.select_box"))
|
||||
{
|
||||
if (mode_match && ts->auto_xray && ts->auto_xray_box) {
|
||||
ts->auto_xray ^= true;
|
||||
}
|
||||
else {
|
||||
if (!mode_match) {
|
||||
if (obedit) {
|
||||
ts->auto_xray_edit ^= true;
|
||||
}
|
||||
else {
|
||||
ts->auto_xray_object ^= true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ts->auto_xray) {
|
||||
ts->auto_xray ^= true;
|
||||
}
|
||||
|
||||
if (!ts->auto_xray_box) {
|
||||
ts->auto_xray_box ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (STREQ(tref->idname, "builtin.select_lasso") ||
|
||||
STREQ(tref->idname_fallback, "builtin.select_lasso"))
|
||||
{
|
||||
if (mode_match && ts->auto_xray && ts->auto_xray_lasso) {
|
||||
ts->auto_xray ^= true;
|
||||
}
|
||||
else {
|
||||
if (!mode_match) {
|
||||
if (obedit) {
|
||||
ts->auto_xray_edit ^= true;
|
||||
}
|
||||
else {
|
||||
ts->auto_xray_object ^= true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ts->auto_xray) {
|
||||
ts->auto_xray ^= true;
|
||||
}
|
||||
|
||||
if (!ts->auto_xray_lasso) {
|
||||
ts->auto_xray_lasso ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (STREQ(tref->idname, "builtin.select_circle") ||
|
||||
STREQ(tref->idname_fallback, "builtin.select_circle"))
|
||||
{
|
||||
if (mode_match && ts->auto_xray && ts->auto_xray_circle) {
|
||||
ts->auto_xray ^= true;
|
||||
}
|
||||
else {
|
||||
if (!mode_match) {
|
||||
if (obedit) {
|
||||
ts->auto_xray_edit ^= true;
|
||||
}
|
||||
else {
|
||||
ts->auto_xray_object ^= true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ts->auto_xray) {
|
||||
ts->auto_xray ^= true;
|
||||
}
|
||||
|
||||
if (!ts->auto_xray_circle) {
|
||||
ts->auto_xray_circle ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ED_area_tag_redraw(area);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_toggle_auto_xray(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Toggle Automatic X-Ray";
|
||||
ot->idname = "VIEW3D_OT_toggle_auto_xray";
|
||||
ot->description = "Transparent scene display during box, lasso, and circle select";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = toggle_auto_xray_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Toggle Select Through
|
||||
* \{ */
|
||||
|
||||
static int toggle_select_through_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
bToolRef *tref = area->runtime.tool;
|
||||
const bool mode_match = obedit ? ts->select_through_edit : ts->select_through_object;
|
||||
|
||||
if (STREQ(tref->idname, "builtin.select_box") ||
|
||||
STREQ(tref->idname_fallback, "builtin.select_box"))
|
||||
{
|
||||
if (mode_match && ts->select_through && ts->select_through_box) {
|
||||
ts->select_through ^= true;
|
||||
}
|
||||
else {
|
||||
if (!mode_match) {
|
||||
if (obedit) {
|
||||
ts->select_through_edit ^= true;
|
||||
}
|
||||
else {
|
||||
ts->select_through_object ^= true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ts->select_through) {
|
||||
ts->select_through ^= true;
|
||||
}
|
||||
|
||||
if (!ts->select_through_box) {
|
||||
ts->select_through_box ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (STREQ(tref->idname, "builtin.select_lasso") ||
|
||||
STREQ(tref->idname_fallback, "builtin.select_lasso"))
|
||||
{
|
||||
if (mode_match && ts->select_through && ts->select_through_lasso) {
|
||||
ts->select_through ^= true;
|
||||
}
|
||||
else {
|
||||
if (!mode_match) {
|
||||
if (obedit) {
|
||||
ts->select_through_edit ^= true;
|
||||
}
|
||||
else {
|
||||
ts->select_through_object ^= true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ts->select_through) {
|
||||
ts->select_through ^= true;
|
||||
}
|
||||
|
||||
if (!ts->select_through_lasso) {
|
||||
ts->select_through_lasso ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (STREQ(tref->idname, "builtin.select_circle") ||
|
||||
STREQ(tref->idname_fallback, "builtin.select_circle"))
|
||||
{
|
||||
if (mode_match && ts->select_through && ts->select_through_circle) {
|
||||
ts->select_through ^= true;
|
||||
}
|
||||
else {
|
||||
if (!mode_match) {
|
||||
if (obedit) {
|
||||
ts->select_through_edit ^= true;
|
||||
}
|
||||
else {
|
||||
ts->select_through_object ^= true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!ts->select_through) {
|
||||
ts->select_through ^= true;
|
||||
}
|
||||
|
||||
if (!ts->select_through_circle) {
|
||||
ts->select_through_circle ^= true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ED_area_tag_redraw(area);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_toggle_select_through(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Toggle Select Through";
|
||||
ot->idname = "VIEW3D_OT_toggle_select_through";
|
||||
ot->description = "Select occluded objects and mesh elements with box, lasso, and circle select";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = toggle_select_through_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Toggle Facedots
|
||||
* \{ */
|
||||
|
||||
static int toggle_facedots_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
if (!XRAY_FLAG_ENABLED(v3d)) {
|
||||
v3d->overlay.edit_flag ^= V3D_OVERLAY_EDIT_FACE_DOT;
|
||||
}
|
||||
else {
|
||||
v3d->overlay.edit_flag ^= V3D_OVERLAY_EDIT_FACE_DOT_XRAY;
|
||||
}
|
||||
ED_area_tag_redraw(area);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_toggle_facedots(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Toggle Facedots";
|
||||
ot->idname = "VIEW3D_OT_toggle_facedots";
|
||||
ot->description = "Show face center dots in the current shading mode";
|
||||
/* api callbacks */
|
||||
ot->exec = toggle_facedots_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Cycle Object Mode
|
||||
* \{ */
|
||||
|
||||
static int cycle_object_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
|
||||
if (ts->object_select_mode == 2) {
|
||||
if (ts->object_cycle_origin) {
|
||||
ts->object_select_mode = 4;
|
||||
}
|
||||
else if (ts->object_cycle_touch) {
|
||||
ts->object_select_mode = 1;
|
||||
}
|
||||
}
|
||||
else if (ts->object_select_mode == 4) {
|
||||
if (ts->object_cycle_touch) {
|
||||
ts->object_select_mode = 1;
|
||||
}
|
||||
else if (ts->object_cycle_enclose) {
|
||||
ts->object_select_mode = 2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ts->object_cycle_enclose) {
|
||||
ts->object_select_mode = 2;
|
||||
}
|
||||
else if (ts->object_cycle_origin) {
|
||||
ts->object_select_mode = 4;
|
||||
}
|
||||
else {
|
||||
ts->object_select_mode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ED_area_tag_redraw(area);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_cycle_object(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Cycle Object";
|
||||
ot->idname = "VIEW3D_OT_cycle_object";
|
||||
ot->description = "Change to the next object selection mode with box, lasso, and circle select";
|
||||
/* api callbacks */
|
||||
ot->exec = cycle_object_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Cycle Face Mode
|
||||
* \{ */
|
||||
|
||||
static int cycle_face_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
|
||||
if (ts->face_select_mode == 2) {
|
||||
if (ts->face_cycle_enclose) {
|
||||
ts->face_select_mode = 4;
|
||||
}
|
||||
else if (ts->face_cycle_center) {
|
||||
ts->face_select_mode = 8;
|
||||
}
|
||||
else if (ts->face_cycle_default) {
|
||||
ts->face_select_mode = 1;
|
||||
}
|
||||
}
|
||||
else if (ts->face_select_mode == 4) {
|
||||
if (ts->face_cycle_center) {
|
||||
ts->face_select_mode = 8;
|
||||
}
|
||||
else if (ts->face_cycle_default) {
|
||||
ts->face_select_mode = 1;
|
||||
}
|
||||
else if (ts->face_cycle_touch) {
|
||||
ts->face_select_mode = 2;
|
||||
}
|
||||
}
|
||||
else if (ts->face_select_mode == 8) {
|
||||
if (ts->face_cycle_default) {
|
||||
ts->face_select_mode = 1;
|
||||
}
|
||||
else if (ts->face_cycle_touch) {
|
||||
ts->face_select_mode = 2;
|
||||
}
|
||||
else if (ts->face_cycle_enclose) {
|
||||
ts->face_select_mode = 4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ts->face_cycle_touch) {
|
||||
ts->face_select_mode = 2;
|
||||
}
|
||||
else if (ts->face_cycle_enclose) {
|
||||
ts->face_select_mode = 4;
|
||||
}
|
||||
else if (ts->face_cycle_center) {
|
||||
ts->face_select_mode = 8;
|
||||
}
|
||||
else {
|
||||
ts->face_select_mode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ED_area_tag_redraw(area);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_cycle_face(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Cycle Face";
|
||||
ot->idname = "VIEW3D_OT_cycle_face";
|
||||
ot->description = "Change to the next face selection mode with box, lasso, and circle select";
|
||||
/* api callbacks */
|
||||
ot->exec = cycle_face_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Cycle Edge Mode
|
||||
* \{ */
|
||||
|
||||
static int cycle_edge_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
|
||||
if (ts->edge_select_mode == 2) {
|
||||
if (ts->edge_cycle_enclose) {
|
||||
ts->edge_select_mode = 4;
|
||||
}
|
||||
else if (ts->edge_cycle_default) {
|
||||
ts->edge_select_mode = 1;
|
||||
}
|
||||
}
|
||||
else if (ts->edge_select_mode == 4) {
|
||||
if (ts->edge_cycle_default) {
|
||||
ts->edge_select_mode = 1;
|
||||
}
|
||||
else if (ts->edge_cycle_touch) {
|
||||
ts->edge_select_mode = 2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (ts->edge_cycle_touch) {
|
||||
ts->edge_select_mode = 2;
|
||||
}
|
||||
else if (ts->edge_cycle_enclose) {
|
||||
ts->edge_select_mode = 4;
|
||||
}
|
||||
else {
|
||||
ts->edge_select_mode = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ED_area_tag_redraw(area);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void VIEW3D_OT_cycle_edge(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Cycle Edge";
|
||||
ot->idname = "VIEW3D_OT_cycle_edge";
|
||||
ot->description = "Change to the next edge selection mode with box, lasso, and circle select";
|
||||
/* api callbacks */
|
||||
ot->exec = cycle_edge_exec;
|
||||
ot->poll = ED_operator_view3d_active;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -61,6 +61,12 @@ void VIEW3D_OT_render_border(struct wmOperatorType *ot);
|
|||
void VIEW3D_OT_clear_render_border(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_toggle_shading(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_toggle_xray(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_toggle_auto_xray(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_toggle_select_through(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_toggle_facedots(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_cycle_object(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_cycle_face(struct wmOperatorType *ot);
|
||||
void VIEW3D_OT_cycle_edge(struct wmOperatorType *ot);
|
||||
|
||||
/* `view3d_draw.cc` */
|
||||
|
||||
|
|
|
@ -663,6 +663,25 @@ void view3d_operator_properties_common(wmOperatorType *ot, const enum eV3D_OpPro
|
|||
if (flag & V3D_OP_PROP_USE_MOUSE_INIT) {
|
||||
WM_operator_properties_use_cursor_init(ot);
|
||||
}
|
||||
|
||||
if (flag & V3D_OP_PROP_FRAME_SELECTED_DISTANCE) {
|
||||
PropertyRNA *prop;
|
||||
prop = RNA_def_int(ot->srna,
|
||||
"frame_selected_distance",
|
||||
0,
|
||||
0,
|
||||
1000,
|
||||
"Camera Offset",
|
||||
"Distance to put camera from selected",
|
||||
0,
|
||||
1000);
|
||||
}
|
||||
|
||||
if (flag & V3D_OP_PROP_ZOOM_SPEED) {
|
||||
PropertyRNA *prop;
|
||||
prop = RNA_def_float(
|
||||
ot->srna, "zoom_speed", 1.2f, 1.001, 10, "Zoom Speed", "Speed to zoom camera", 1.001f, 10);
|
||||
}
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -41,6 +41,8 @@ enum eV3D_OpPropFlag {
|
|||
V3D_OP_PROP_DELTA = (1 << 1),
|
||||
V3D_OP_PROP_USE_ALL_REGIONS = (1 << 2),
|
||||
V3D_OP_PROP_USE_MOUSE_INIT = (1 << 3),
|
||||
V3D_OP_PROP_FRAME_SELECTED_DISTANCE = (1 << 4),
|
||||
V3D_OP_PROP_ZOOM_SPEED = (1 << 5),
|
||||
};
|
||||
ENUM_OPERATORS(eV3D_OpPropFlag, V3D_OP_PROP_USE_MOUSE_INIT);
|
||||
|
||||
|
|
|
@ -91,7 +91,8 @@ static void view3d_from_minmax(bContext *C,
|
|||
const float min[3],
|
||||
const float max[3],
|
||||
bool ok_dist,
|
||||
const int smooth_viewtx)
|
||||
const int smooth_viewtx,
|
||||
const int view_dist)
|
||||
{
|
||||
RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
|
||||
float afm[3];
|
||||
|
@ -134,7 +135,7 @@ static void view3d_from_minmax(bContext *C,
|
|||
v3d, region, depsgraph, persp, true, (size / 2) * VIEW3D_MARGIN);
|
||||
if (rv3d->is_persp) {
|
||||
/* don't zoom closer than the near clipping plane */
|
||||
new_dist = max_ff(new_dist, v3d->clip_start * 1.5f);
|
||||
new_dist = max_ff(new_dist, v3d->clip_start * 1.5f + view_dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -166,7 +167,8 @@ static void view3d_from_minmax_multi(bContext *C,
|
|||
const float min[3],
|
||||
const float max[3],
|
||||
const bool ok_dist,
|
||||
const int smooth_viewtx)
|
||||
const int smooth_viewtx,
|
||||
const int view_dist)
|
||||
{
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
LISTBASE_FOREACH (ARegion *, region, &area->regionbase) {
|
||||
|
@ -175,7 +177,7 @@ static void view3d_from_minmax_multi(bContext *C,
|
|||
/* when using all regions, don't jump out of camera view,
|
||||
* but _do_ allow locked cameras to be moved */
|
||||
if ((rv3d->persp != RV3D_CAMOB) || ED_view3d_camera_lock_check(v3d, rv3d)) {
|
||||
view3d_from_minmax(C, v3d, region, min, max, ok_dist, smooth_viewtx);
|
||||
view3d_from_minmax(C, v3d, region, min, max, ok_dist, smooth_viewtx, view_dist);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -263,10 +265,10 @@ static int view3d_all_exec(bContext *C, wmOperator *op)
|
|||
ED_view3d_smooth_view_undo_begin(C, area);
|
||||
|
||||
if (use_all_regions) {
|
||||
view3d_from_minmax_multi(C, v3d, min, max, true, smooth_viewtx);
|
||||
view3d_from_minmax_multi(C, v3d, min, max, true, smooth_viewtx, 0);
|
||||
}
|
||||
else {
|
||||
view3d_from_minmax(C, v3d, region, min, max, true, smooth_viewtx);
|
||||
view3d_from_minmax(C, v3d, region, min, max, true, smooth_viewtx, 0);
|
||||
}
|
||||
|
||||
ED_view3d_smooth_view_undo_end(C, area, op->type->name, false);
|
||||
|
@ -328,6 +330,7 @@ static int viewselected_exec(bContext *C, wmOperator *op)
|
|||
/* any one of the regions may be locked */
|
||||
(use_all_regions && v3d->flag2 & V3D_LOCK_CAMERA));
|
||||
const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
|
||||
const int view_dist = RNA_int_get(op->ptr, "frame_selected_distance");
|
||||
|
||||
INIT_MINMAX(min, max);
|
||||
if (is_face_map) {
|
||||
|
@ -454,10 +457,10 @@ static int viewselected_exec(bContext *C, wmOperator *op)
|
|||
ED_view3d_smooth_view_undo_begin(C, area);
|
||||
|
||||
if (use_all_regions) {
|
||||
view3d_from_minmax_multi(C, v3d, min, max, ok_dist, smooth_viewtx);
|
||||
view3d_from_minmax_multi(C, v3d, min, max, ok_dist, smooth_viewtx, view_dist);
|
||||
}
|
||||
else {
|
||||
view3d_from_minmax(C, v3d, region, min, max, ok_dist, smooth_viewtx);
|
||||
view3d_from_minmax(C, v3d, region, min, max, ok_dist, smooth_viewtx, view_dist);
|
||||
}
|
||||
|
||||
ED_view3d_smooth_view_undo_end(C, area, op->type->name, false);
|
||||
|
@ -481,6 +484,7 @@ void VIEW3D_OT_view_selected(wmOperatorType *ot)
|
|||
|
||||
/* properties */
|
||||
view3d_operator_properties_common(ot, V3D_OP_PROP_USE_ALL_REGIONS);
|
||||
view3d_operator_properties_common(ot, V3D_OP_PROP_FRAME_SELECTED_DISTANCE);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -389,7 +389,8 @@ static void view_zoom_apply_step(bContext *C,
|
|||
ScrArea *area,
|
||||
ARegion *region,
|
||||
const int delta,
|
||||
const int zoom_xy[2])
|
||||
const int zoom_xy[2],
|
||||
const float zoom_speed)
|
||||
{
|
||||
View3D *v3d = static_cast<View3D *>(area->spacedata.first);
|
||||
RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
|
||||
|
@ -402,7 +403,8 @@ static void view_zoom_apply_step(bContext *C,
|
|||
ED_view3d_dist_range_get(v3d, dist_range);
|
||||
|
||||
if (delta < 0) {
|
||||
const float step = 1.2f;
|
||||
const float step = zoom_speed;
|
||||
|
||||
if (use_cam_zoom) {
|
||||
view_zoom_to_window_xy_camera(scene, depsgraph, v3d, region, step, zoom_xy);
|
||||
}
|
||||
|
@ -413,7 +415,7 @@ static void view_zoom_apply_step(bContext *C,
|
|||
}
|
||||
}
|
||||
else {
|
||||
const float step = 1.0f / 1.2f;
|
||||
const float step = 1.0f / zoom_speed;
|
||||
if (use_cam_zoom) {
|
||||
view_zoom_to_window_xy_camera(scene, depsgraph, v3d, region, step, zoom_xy);
|
||||
}
|
||||
|
@ -446,6 +448,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
|
|||
RegionView3D *rv3d = static_cast<RegionView3D *>(region->regiondata);
|
||||
|
||||
const int delta = RNA_int_get(op->ptr, "delta");
|
||||
const float zoom_speed = RNA_float_get(op->ptr, "zoom_speed");
|
||||
const bool use_cursor_init = RNA_boolean_get(op->ptr, "use_cursor_init");
|
||||
|
||||
int zoom_xy_buf[2];
|
||||
|
@ -459,7 +462,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
|
|||
zoom_xy = zoom_xy_buf;
|
||||
}
|
||||
|
||||
view_zoom_apply_step(C, depsgraph, scene, area, region, delta, zoom_xy);
|
||||
view_zoom_apply_step(C, depsgraph, scene, area, region, delta, zoom_xy, zoom_speed);
|
||||
ED_view3d_camera_lock_undo_grouped_push(op->type->name, v3d, rv3d, C);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
@ -481,6 +484,7 @@ static int viewzoom_invoke_impl(bContext *C,
|
|||
|
||||
prop = RNA_struct_find_property(ptr, "delta");
|
||||
const int delta = RNA_property_is_set(ptr, prop) ? RNA_property_int_get(ptr, prop) : 0;
|
||||
const float zoom_speed = RNA_float_get(ptr, "zoom_speed");
|
||||
|
||||
if (delta) {
|
||||
const bool do_zoom_to_mouse_pos = (vod->viewops_flag & VIEWOPS_FLAG_ZOOM_TO_MOUSE) != 0;
|
||||
|
@ -490,7 +494,8 @@ static int viewzoom_invoke_impl(bContext *C,
|
|||
vod->area,
|
||||
vod->region,
|
||||
delta,
|
||||
do_zoom_to_mouse_pos ? xy : nullptr);
|
||||
do_zoom_to_mouse_pos ? xy : nullptr,
|
||||
zoom_speed);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
@ -545,8 +550,9 @@ void VIEW3D_OT_zoom(wmOperatorType *ot)
|
|||
ot->flag = OPTYPE_BLOCKING | OPTYPE_GRAB_CURSOR_XY;
|
||||
|
||||
/* properties */
|
||||
view3d_operator_properties_common(
|
||||
ot, V3D_OP_PROP_DELTA | V3D_OP_PROP_MOUSE_CO | V3D_OP_PROP_USE_MOUSE_INIT);
|
||||
view3d_operator_properties_common(ot,
|
||||
V3D_OP_PROP_DELTA | V3D_OP_PROP_MOUSE_CO |
|
||||
V3D_OP_PROP_USE_MOUSE_INIT | V3D_OP_PROP_ZOOM_SPEED);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -223,6 +223,12 @@ void view3d_operatortypes()
|
|||
WM_operatortype_append(VIEW3D_OT_toggle_shading);
|
||||
WM_operatortype_append(VIEW3D_OT_toggle_xray);
|
||||
WM_operatortype_append(VIEW3D_OT_toggle_matcap_flip);
|
||||
WM_operatortype_append(VIEW3D_OT_toggle_auto_xray);
|
||||
WM_operatortype_append(VIEW3D_OT_toggle_select_through);
|
||||
WM_operatortype_append(VIEW3D_OT_toggle_facedots);
|
||||
WM_operatortype_append(VIEW3D_OT_cycle_object);
|
||||
WM_operatortype_append(VIEW3D_OT_cycle_face);
|
||||
WM_operatortype_append(VIEW3D_OT_cycle_edge);
|
||||
|
||||
WM_operatortype_append(VIEW3D_OT_ruler_add);
|
||||
WM_operatortype_append(VIEW3D_OT_ruler_remove);
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3724,6 +3724,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
|
|||
int x, y, radius, width, height;
|
||||
float zoomx, zoomy;
|
||||
float offset[2], ellipse[2];
|
||||
rctf rectf;
|
||||
|
||||
const bool use_face_center = ((ts->uv_flag & UV_SYNC_SELECTION) ?
|
||||
(ts->selectmode == SCE_SELECT_FACE) :
|
||||
|
@ -3733,6 +3734,7 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
|
|||
(ts->uv_selectmode == UV_SELECT_EDGE));
|
||||
const bool use_select_linked = !(ts->uv_flag & UV_SYNC_SELECTION) &&
|
||||
(ts->uv_selectmode == UV_SELECT_ISLAND);
|
||||
const bool square = ts->square_select;
|
||||
|
||||
/* get operator properties */
|
||||
x = RNA_int_get(op->ptr, "x");
|
||||
|
@ -3749,6 +3751,11 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
|
|||
|
||||
UI_view2d_region_to_view(®ion->v2d, x, y, &offset[0], &offset[1]);
|
||||
|
||||
if (square) {
|
||||
BLI_rctf_init(&rectf, x - radius, x + radius, y - radius, y + radius);
|
||||
UI_view2d_region_to_view_rctf(®ion->v2d, &rectf, &rectf);
|
||||
}
|
||||
|
||||
bool changed_multi = false;
|
||||
|
||||
Vector<Object *> objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data_with_uvs(
|
||||
|
@ -3782,7 +3789,9 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
|
|||
if (select != uvedit_face_select_test(scene, efa, offsets)) {
|
||||
float cent[2];
|
||||
BM_face_uv_calc_center_median(efa, offsets.uv, cent);
|
||||
if (uv_circle_select_is_point_inside(cent, offset, ellipse)) {
|
||||
if (square ? BLI_rctf_isect_pt_v(&rectf, cent) :
|
||||
uv_circle_select_is_point_inside(cent, offset, ellipse))
|
||||
{
|
||||
BM_elem_flag_enable(efa, BM_ELEM_TAG);
|
||||
changed = true;
|
||||
}
|
||||
|
@ -3805,7 +3814,9 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
|
|||
|
||||
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
|
||||
luv = BM_ELEM_CD_GET_FLOAT_P(l, offsets.uv);
|
||||
if (uv_circle_select_is_edge_inside(luv, luv_prev, offset, ellipse)) {
|
||||
if (square ? BLI_rctf_isect_pt_v(&rectf, luv) && BLI_rctf_isect_pt_v(&rectf, luv_prev) :
|
||||
uv_circle_select_is_edge_inside(luv, luv_prev, offset, ellipse))
|
||||
{
|
||||
uvedit_edge_select_set_with_sticky(scene, em, l_prev, select, false, offsets);
|
||||
changed = true;
|
||||
}
|
||||
|
@ -3825,7 +3836,9 @@ static int uv_circle_select_exec(bContext *C, wmOperator *op)
|
|||
BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
|
||||
if (select != uvedit_uv_select_test(scene, l, offsets)) {
|
||||
luv = BM_ELEM_CD_GET_FLOAT_P(l, offsets.uv);
|
||||
if (uv_circle_select_is_point_inside(luv, offset, ellipse)) {
|
||||
if (square ? BLI_rctf_isect_pt_v(&rectf, luv) :
|
||||
uv_circle_select_is_point_inside(luv, offset, ellipse))
|
||||
{
|
||||
changed = true;
|
||||
uvedit_uv_select_set(scene, em->bm, l, select, false, offsets);
|
||||
BM_elem_flag_enable(l->v, BM_ELEM_TAG);
|
||||
|
@ -3919,7 +3932,7 @@ static bool do_lasso_select_mesh_uv_is_edge_inside(const ARegion *region,
|
|||
®ion->v2d, co_test_a, co_test_b, co_screen_a, co_screen_b) &&
|
||||
BLI_rcti_isect_segment(clip_rect, co_screen_a, co_screen_b) &&
|
||||
BLI_lasso_is_edge_inside(
|
||||
mcoords, mcoords_len, UNPACK2(co_screen_a), UNPACK2(co_screen_b), V2D_IS_CLIPPED))
|
||||
mcoords, mcoords_len, UNPACK2(co_screen_a), UNPACK2(co_screen_b), V2D_IS_CLIPPED, false))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -408,6 +408,33 @@
|
|||
/* Placement */ \
|
||||
.snap_mode_tools = SCE_SNAP_TO_GEOM,\
|
||||
.plane_axis = 2,\
|
||||
\
|
||||
/* Drag Select */ \
|
||||
.xray_button = true, \
|
||||
.auto_xray_object = true, \
|
||||
.auto_xray_edit = true, \
|
||||
.auto_xray_box = true, \
|
||||
.auto_xray_lasso = true, \
|
||||
.auto_xray_circle = true, \
|
||||
.select_through = true, \
|
||||
.select_through_object = true, \
|
||||
.select_through_box = true, \
|
||||
.select_through_lasso = true, \
|
||||
.select_through_circle = true, \
|
||||
.object_cycle_touch = true, \
|
||||
.object_cycle_enclose = true, \
|
||||
.object_cycle_origin = true, \
|
||||
.face_cycle_default = true, \
|
||||
.face_cycle_touch = true, \
|
||||
.face_cycle_enclose = true, \
|
||||
.face_cycle_center = true, \
|
||||
.edge_cycle_default = true, \
|
||||
.edge_cycle_touch = true, \
|
||||
.edge_cycle_enclose = true, \
|
||||
.object_select_mode = 1, \
|
||||
.face_select_mode = 1, \
|
||||
.edge_select_mode = 1, \
|
||||
.backface_select_mode = 2, \
|
||||
}
|
||||
|
||||
#define _DNA_DEFAULT_Sculpt \
|
||||
|
|
|
@ -1599,6 +1599,48 @@ typedef struct ToolSettings {
|
|||
char gpencil_selectmode_edit;
|
||||
/** Stroke selection mode for Sculpt. */
|
||||
char gpencil_selectmode_sculpt;
|
||||
|
||||
/** LCB Options */
|
||||
char xray_button;
|
||||
char xray_header;
|
||||
char auto_xray;
|
||||
char auto_xray_button;
|
||||
char auto_xray_reset;
|
||||
char auto_xray_object;
|
||||
char auto_xray_edit;
|
||||
char auto_xray_box;
|
||||
char auto_xray_lasso;
|
||||
char auto_xray_circle;
|
||||
char select_through;
|
||||
char select_through_button;
|
||||
char select_through_object;
|
||||
char select_through_edit;
|
||||
char select_through_box;
|
||||
char select_through_lasso;
|
||||
char select_through_circle;
|
||||
char wireless_touch_object;
|
||||
char square_select;
|
||||
char shrink_shading_header;
|
||||
char select_header;
|
||||
char object_select_mode;
|
||||
char face_select_mode;
|
||||
char edge_select_mode;
|
||||
char backface_select;
|
||||
char backface_select_mode;
|
||||
char face_button;
|
||||
char edge_button;
|
||||
char backface_button;
|
||||
char object_cycle_touch;
|
||||
char object_cycle_enclose;
|
||||
char object_cycle_origin;
|
||||
char face_cycle_default;
|
||||
char face_cycle_touch;
|
||||
char face_cycle_enclose;
|
||||
char face_cycle_center;
|
||||
char edge_cycle_default;
|
||||
char edge_cycle_touch;
|
||||
char edge_cycle_enclose;
|
||||
char blank_text;
|
||||
char _pad0[6];
|
||||
|
||||
/** Grease Pencil Sculpt. */
|
||||
|
@ -2451,6 +2493,52 @@ typedef enum eSnapTransformMode {
|
|||
SCE_SNAP_TRANSFORM_MODE_SCALE = (1 << 2),
|
||||
} eSnapTransformMode;
|
||||
|
||||
/** #Ignore backface select mode */
|
||||
enum {
|
||||
BACKFACE_DEFAULT = (1 << 0),
|
||||
BACKFACE_NEAR = (1 << 1),
|
||||
BACKFACE_XRAY = (1 << 2),
|
||||
BACKFACE_NONE = (1 << 3),
|
||||
};
|
||||
|
||||
/** #Object select style */
|
||||
enum {
|
||||
OBJECT_TOUCH = (1 << 0),
|
||||
OBJECT_ENCLOSE = (1 << 1),
|
||||
OBJECT_ORIGIN = (1 << 2),
|
||||
};
|
||||
|
||||
/** #Face select style */
|
||||
enum {
|
||||
FACE_DEFAULT = (1 << 0),
|
||||
FACE_TOUCH = (1 << 1),
|
||||
FACE_ENCLOSE = (1 << 2),
|
||||
FACE_CENTER = (1 << 3),
|
||||
};
|
||||
|
||||
/** #Edge select style */
|
||||
enum {
|
||||
EDGE_DEFAULT = (1 << 0),
|
||||
EDGE_TOUCH = (1 << 1),
|
||||
EDGE_ENCLOSE = (1 << 2),
|
||||
};
|
||||
|
||||
/** #Auto X-Ray mode */
|
||||
enum {
|
||||
AUTO_XRAY_DISABLE = (1 << 0),
|
||||
AUTO_XRAY_OBJECT = (1 << 1),
|
||||
AUTO_XRAY_EDIT = (1 << 2),
|
||||
AUTO_XRAY_BOTH = (1 << 3),
|
||||
};
|
||||
|
||||
/** #Select through mode */
|
||||
enum {
|
||||
SELECT_THROUGH_DISABLE = (1 << 0),
|
||||
SELECT_THROUGH_OBJECT = (1 << 1),
|
||||
SELECT_THROUGH_EDIT = (1 << 2),
|
||||
SELECT_THROUGH_BOTH = (1 << 3),
|
||||
};
|
||||
|
||||
/** #ToolSettings::selectmode */
|
||||
enum {
|
||||
SCE_SELECT_VERTEX = 1 << 0, /* for mesh */
|
||||
|
|
|
@ -886,7 +886,9 @@ typedef struct UserDef {
|
|||
char gizmo_size;
|
||||
/** Navigate gizmo size. */
|
||||
char gizmo_size_navigate_v3d;
|
||||
char _pad3[5];
|
||||
/** Header highlight */
|
||||
char header_highlight;
|
||||
char _pad3[4];
|
||||
short edit_studio_light;
|
||||
short lookdev_sphere_size;
|
||||
short vbotimeout, vbocollectrate;
|
||||
|
@ -929,7 +931,10 @@ typedef struct UserDef {
|
|||
/** Number of samples for FPS display calculations. */
|
||||
short playback_fps_samples;
|
||||
|
||||
char _pad7[2];
|
||||
/** Keymap click-drag direction style. */
|
||||
char click_drag_direction;
|
||||
|
||||
char _pad7[1];
|
||||
|
||||
/** Private, defaults to 20 for 72 DPI setting. */
|
||||
short widget_unit;
|
||||
|
@ -992,6 +997,22 @@ typedef struct UserDef {
|
|||
char drag_threshold;
|
||||
char move_threshold;
|
||||
|
||||
/** Adjustable selection radius. */
|
||||
float selection_radius;
|
||||
char adjustable_click_select;
|
||||
char select_unbiased;
|
||||
|
||||
/** Mouse cursor styles. **/
|
||||
char system_cursor;
|
||||
char edit_cursor;
|
||||
char paint_cursor;
|
||||
char dot_cursor;
|
||||
char knife_cursor;
|
||||
char pencil_cursor;
|
||||
char eraser_cursor;
|
||||
char eyedropper_cursor;
|
||||
char _pad9[2];
|
||||
|
||||
char font_path_ui[1024];
|
||||
char font_path_ui_mono[1024];
|
||||
|
||||
|
@ -1096,8 +1117,8 @@ typedef enum eUserPref_Flag {
|
|||
USER_AUTOSAVE = (1 << 0),
|
||||
USER_FLAG_NUMINPUT_ADVANCED = (1 << 1),
|
||||
USER_FLAG_RECENT_SEARCHES_DISABLE = (1 << 2),
|
||||
USER_FLAG_UNUSED_3 = (1 << 3), /* cleared */
|
||||
USER_FLAG_UNUSED_4 = (1 << 4), /* cleared */
|
||||
USER_ADJUSTABLE_CLICK_SELECT = (1 << 3),
|
||||
USER_SELECT_UNBIASED = (1 << 4),
|
||||
USER_TRACKBALL = (1 << 5),
|
||||
USER_FLAG_UNUSED_6 = (1 << 6), /* cleared */
|
||||
USER_FLAG_UNUSED_7 = (1 << 7), /* cleared */
|
||||
|
@ -1247,6 +1268,131 @@ typedef enum eUserpref_TableAPI {
|
|||
USER_TABLET_WINTAB = 2,
|
||||
} eUserpref_TabletAPI;
|
||||
|
||||
/** #UserDef.click_drag_direction_types */
|
||||
typedef enum eUserpref_Click_Drag_Direction {
|
||||
USER_CLICK_DRAG_DIRECTION_EIGHT_WAY = 0,
|
||||
USER_CLICK_DRAG_DIRECTION_LEFT_RIGHT = 1,
|
||||
USER_CLICK_DRAG_DIRECTION_UP_DOWN = 2,
|
||||
} eUserpref_Click_Drag_Direction;
|
||||
|
||||
/** #UserDef.system_cursor_types */
|
||||
typedef enum eUserpref_System_Cursor_Types {
|
||||
USER_SYSTEM_CURSOR_SYSTEM = 0,
|
||||
USER_SYSTEM_CURSOR_CROSS = 1,
|
||||
USER_SYSTEM_CURSOR_POINTER = 2,
|
||||
USER_SYSTEM_CURSOR_CROSS_OPEN = 3,
|
||||
USER_SYSTEM_CURSOR_CROSS_DOT = 4,
|
||||
USER_SYSTEM_CURSOR_CROSS_MIN = 5,
|
||||
USER_SYSTEM_CURSOR_BOX = 6,
|
||||
USER_SYSTEM_CURSOR_BOX_DOT = 7,
|
||||
USER_SYSTEM_CURSOR_BOX_POINTER = 8,
|
||||
USER_SYSTEM_CURSOR_DOT = 9,
|
||||
} eUserpref_System_Cursor_Types;
|
||||
|
||||
/** #UserDef.edit_cursor_types */
|
||||
typedef enum eUserpref_Edit_Cursor_Types {
|
||||
USER_EDIT_CURSOR_CROSS = 0,
|
||||
USER_EDIT_CURSOR_SYSTEM = 1,
|
||||
USER_EDIT_CURSOR_POINTER = 2,
|
||||
USER_EDIT_CURSOR_CROSS_OPEN = 3,
|
||||
USER_EDIT_CURSOR_CROSS_DOT = 4,
|
||||
USER_EDIT_CURSOR_CROSS_MIN = 5,
|
||||
USER_EDIT_CURSOR_BOX = 6,
|
||||
USER_EDIT_CURSOR_BOX_DOT = 7,
|
||||
USER_EDIT_CURSOR_BOX_POINTER = 8,
|
||||
USER_EDIT_CURSOR_DOT = 9,
|
||||
} eUserpref_Edit_Cursor_Types;
|
||||
|
||||
/** #UserDef.paint_cursor_types */
|
||||
typedef enum eUserpref_Paint_Cursor_Types {
|
||||
USER_PAINT_CURSOR_CROSS_DOT = 0,
|
||||
USER_PAINT_CURSOR_CROSS = 1,
|
||||
USER_PAINT_CURSOR_SYSTEM = 2,
|
||||
USER_PAINT_CURSOR_POINTER = 3,
|
||||
USER_PAINT_CURSOR_CROSS_OPEN = 4,
|
||||
USER_PAINT_CURSOR_CROSS_MIN = 5,
|
||||
USER_PAINT_CURSOR_BOX = 6,
|
||||
USER_PAINT_CURSOR_BOX_DOT = 7,
|
||||
USER_PAINT_CURSOR_BOX_POINTER = 8,
|
||||
USER_PAINT_CURSOR_DOT = 9,
|
||||
USER_PAINT_CURSOR_BLANK = 10,
|
||||
} eUserpref_Paint_Cursor_Types;
|
||||
|
||||
/** #UserDef.dot_cursor_types */
|
||||
typedef enum eUserpref_Dot_Cursor_Types {
|
||||
USER_DOT_CURSOR_DOT = 0,
|
||||
USER_DOT_CURSOR_CROSS = 1,
|
||||
USER_DOT_CURSOR_SYSTEM = 2,
|
||||
USER_DOT_CURSOR_POINTER = 3,
|
||||
USER_DOT_CURSOR_CROSS_OPEN = 4,
|
||||
USER_DOT_CURSOR_CROSS_DOT = 5,
|
||||
USER_DOT_CURSOR_CROSS_MIN = 6,
|
||||
USER_DOT_CURSOR_BOX = 7,
|
||||
USER_DOT_CURSOR_BOX_DOT = 8,
|
||||
USER_DOT_CURSOR_BOX_POINTER = 9,
|
||||
USER_DOT_CURSOR_BLANK = 10,
|
||||
} eUserpref_Dot_Cursor_Types;
|
||||
|
||||
/** #UserDef.knife_cursor_types */
|
||||
typedef enum eUserpref_Knife_Cursor_Types {
|
||||
USER_KNIFE_CURSOR_KNIFE = 0,
|
||||
USER_KNIFE_CURSOR_CROSS = 1,
|
||||
USER_KNIFE_CURSOR_SYSTEM = 2,
|
||||
USER_KNIFE_CURSOR_POINTER = 3,
|
||||
USER_KNIFE_CURSOR_CROSS_OPEN = 4,
|
||||
USER_KNIFE_CURSOR_CROSS_DOT = 5,
|
||||
USER_KNIFE_CURSOR_CROSS_MIN = 6,
|
||||
USER_KNIFE_CURSOR_BOX = 7,
|
||||
USER_KNIFE_CURSOR_BOX_DOT = 8,
|
||||
USER_KNIFE_CURSOR_BOX_POINTER = 9,
|
||||
USER_KNIFE_CURSOR_DOT = 10,
|
||||
} eUserpref_Knife_Cursor_Types;
|
||||
|
||||
/** #UserDef.pencil_cursor_types */
|
||||
typedef enum eUserpref_Pencil_Cursor_Types {
|
||||
USER_PENCIL_CURSOR_PENCIL = 0,
|
||||
USER_PENCIL_CURSOR_CROSS = 1,
|
||||
USER_PENCIL_CURSOR_SYSTEM = 2,
|
||||
USER_PENCIL_CURSOR_POINTER = 3,
|
||||
USER_PENCIL_CURSOR_CROSS_OPEN = 4,
|
||||
USER_PENCIL_CURSOR_CROSS_DOT = 5,
|
||||
USER_PENCIL_CURSOR_CROSS_MIN = 6,
|
||||
USER_PENCIL_CURSOR_BOX = 7,
|
||||
USER_PENCIL_CURSOR_BOX_DOT = 8,
|
||||
USER_PENCIL_CURSOR_BOX_POINTER = 9,
|
||||
USER_PENCIL_CURSOR_DOT = 10,
|
||||
} eUserpref_Pencil_Cursor_Types;
|
||||
|
||||
/** #UserDef.eraser_cursor_types */
|
||||
typedef enum eUserpref_Eraser_Cursor_Types {
|
||||
USER_ERASER_CURSOR_ERASER = 0,
|
||||
USER_ERASER_CURSOR_CROSS = 1,
|
||||
USER_ERASER_CURSOR_SYSTEM = 2,
|
||||
USER_ERASER_CURSOR_POINTER = 3,
|
||||
USER_ERASER_CURSOR_CROSS_OPEN = 4,
|
||||
USER_ERASER_CURSOR_CROSS_DOT = 5,
|
||||
USER_ERASER_CURSOR_CROSS_MIN = 6,
|
||||
USER_ERASER_CURSOR_BOX = 7,
|
||||
USER_ERASER_CURSOR_BOX_DOT = 8,
|
||||
USER_ERASER_CURSOR_BOX_POINTER = 9,
|
||||
USER_ERASER_CURSOR_DOT = 10,
|
||||
} eUserpref_Eraser_Cursor_Types;
|
||||
|
||||
/** #UserDef.eyedropper_cursor_types */
|
||||
typedef enum eUserpref_Eyedropper_Cursor_Types {
|
||||
USER_EYEDROPPER_CURSOR_EYEDROPPER = 0,
|
||||
USER_EYEDROPPER_CURSOR_CROSS = 1,
|
||||
USER_EYEDROPPER_CURSOR_SYSTEM = 2,
|
||||
USER_EYEDROPPER_CURSOR_POINTER = 3,
|
||||
USER_EYEDROPPER_CURSOR_CROSS_OPEN = 4,
|
||||
USER_EYEDROPPER_CURSOR_CROSS_DOT = 5,
|
||||
USER_EYEDROPPER_CURSOR_CROSS_MIN = 6,
|
||||
USER_EYEDROPPER_CURSOR_BOX = 7,
|
||||
USER_EYEDROPPER_CURSOR_BOX_DOT = 8,
|
||||
USER_EYEDROPPER_CURSOR_BOX_POINTER = 9,
|
||||
USER_EYEDROPPER_CURSOR_DOT = 10,
|
||||
} eUserpref_Eyedropper_Cursor_Types;
|
||||
|
||||
/** #UserDef.app_flag */
|
||||
typedef enum eUserpref_APP_Flag {
|
||||
USER_APP_LOCK_CORNER_SPLIT = (1 << 0),
|
||||
|
|
|
@ -610,6 +610,7 @@ enum {
|
|||
|
||||
V3D_OVERLAY_EDIT_CU_NORMALS = (1 << 21),
|
||||
V3D_OVERLAY_EDIT_CONSTANT_SCREEN_SIZE_NORMALS = (1 << 22),
|
||||
V3D_OVERLAY_EDIT_FACE_DOT_XRAY = (1 << 23),
|
||||
};
|
||||
|
||||
/** #View3DOverlay.paint_flag */
|
||||
|
|
|
@ -3186,6 +3186,85 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
|||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem object_select_items[] = {
|
||||
{OBJECT_TOUCH,
|
||||
"TOUCH",
|
||||
ICON_OBJECT_TOUCH,
|
||||
"Touch",
|
||||
"Select objects that are touched by the selection area"},
|
||||
{OBJECT_ENCLOSE,
|
||||
"ENCLOSE",
|
||||
ICON_OBJECT_ENCLOSE,
|
||||
"Enclose",
|
||||
"Select objects that are fully inside the selection area"},
|
||||
{OBJECT_ORIGIN,
|
||||
"ORIGIN",
|
||||
ICON_LIGHTPROBE_SPHERE,
|
||||
"Origin",
|
||||
"Select objects if their origin is touched by the selection area"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem face_select_items[] = {
|
||||
{FACE_DEFAULT,
|
||||
"DEFAULT",
|
||||
ICON_FACE_DEFAULT,
|
||||
"Default",
|
||||
"Select faces that are touched by the selection area in Near Select. Select faces if their "
|
||||
"center is touched by the selection area in X-Ray and Select Through"},
|
||||
{FACE_TOUCH,
|
||||
"TOUCH",
|
||||
ICON_FACE_TOUCH,
|
||||
"Touch",
|
||||
"Select faces that are touched by the selection area"},
|
||||
{FACE_ENCLOSE,
|
||||
"ENCLOSE",
|
||||
ICON_FACE_ENCLOSE,
|
||||
"Enclose",
|
||||
"Select faces that are fully inside the selection area"},
|
||||
{FACE_CENTER,
|
||||
"CENTER",
|
||||
ICON_LIGHTPROBE_PLANE,
|
||||
"Center",
|
||||
"Select faces if their center is touched by the selection area"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem edge_select_items[] = {
|
||||
{EDGE_DEFAULT,
|
||||
"DEFAULT",
|
||||
ICON_EDGE_DEFAULT,
|
||||
"Default",
|
||||
"Select edges that are fully inside the selection area. If no edges are fully inside, "
|
||||
"select edges that are touched by the selection area"},
|
||||
{EDGE_TOUCH,
|
||||
"TOUCH",
|
||||
ICON_EDGE_TOUCH,
|
||||
"Touch",
|
||||
"Select edges that are touched by the selection area"},
|
||||
{EDGE_ENCLOSE,
|
||||
"ENCLOSE",
|
||||
ICON_EDGE_ENCLOSE,
|
||||
"Enclose",
|
||||
"Select edges that are fully inside the selection area"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem backface_select_items[] = {
|
||||
{BACKFACE_NEAR,
|
||||
"NEAR",
|
||||
0,
|
||||
"Fix Near",
|
||||
"Ignore backfacing mesh when not using X-Ray or Select Through, verts won't be filtered"},
|
||||
{BACKFACE_XRAY,
|
||||
"XRAY",
|
||||
0,
|
||||
"Front X-Ray",
|
||||
"Ignore backfacing mesh in X-Ray and Select Through"},
|
||||
{BACKFACE_NONE, "NONE", 0, "No Backface", "Don't select backfacing mesh"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
srna = RNA_def_struct(brna, "ToolSettings", nullptr);
|
||||
RNA_def_struct_path_func(srna, "rna_ToolSettings_path");
|
||||
RNA_def_struct_ui_text(srna, "Tool Settings", "");
|
||||
|
@ -4041,6 +4120,235 @@ static void rna_def_tool_settings(BlenderRNA *brna)
|
|||
RNA_def_property_ui_text(prop, "Normal Vector", "Normal Vector used to copy, add or multiply");
|
||||
RNA_def_property_ui_range(prop, -10000.0, 10000.0, 1, 3);
|
||||
|
||||
/* Square Select */
|
||||
prop = RNA_def_property(srna, "square_select", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "square_select", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Square Select",
|
||||
"Change selection shape to a square with side length equal to the circle diameter");
|
||||
|
||||
/* Wireless Touch Object */
|
||||
prop = RNA_def_property(srna, "wireless_touch_object", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "wireless_touch_object", 0);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"Wireless Touch Object",
|
||||
"If using Touch select with X-Ray and Wireframe shading, select "
|
||||
"objects if inside them but not intersecting any wires");
|
||||
|
||||
/* Shrink Shading Header */
|
||||
prop = RNA_def_property(srna, "shrink_shading_header", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "shrink_shading_header", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Shrink Header",
|
||||
"Combine the four Shading Header buttons into one button that also toggles X-Ray");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
/* Blank Text, for ui formatting */
|
||||
prop = RNA_def_property(srna, "blank_text", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "blank_text", 0);
|
||||
RNA_def_property_ui_text(prop, "", "");
|
||||
|
||||
/* Drag Select Options */
|
||||
prop = RNA_def_property(srna, "select_header", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_header", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Selection Control",
|
||||
"Use either the header or keymap to control additional selection options");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "object_select_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "object_select_mode");
|
||||
RNA_def_property_enum_items(prop, object_select_items);
|
||||
RNA_def_property_ui_text(prop, "Object", "Object Select Style");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "face_select_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "face_select_mode");
|
||||
RNA_def_property_enum_items(prop, face_select_items);
|
||||
RNA_def_property_ui_text(prop, "Face", "Face Select Style");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "edge_select_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "edge_select_mode");
|
||||
RNA_def_property_enum_items(prop, edge_select_items);
|
||||
RNA_def_property_ui_text(prop, "Edge", "Edge Select Style");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "backface_select", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "backface_select", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Backface Filter", "Select mesh based on the direction of their normals");
|
||||
|
||||
prop = RNA_def_property(srna, "backface_select_mode", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "backface_select_mode");
|
||||
RNA_def_property_enum_items(prop, backface_select_items);
|
||||
RNA_def_property_ui_text(prop, "Mode", "Backface Filter Style");
|
||||
|
||||
prop = RNA_def_property(srna, "face_button", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "face_button", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Face", "Show header button that cycles through face selection modes");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "edge_button", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "edge_button", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Edge", "Show header button that cycles through edge selection modes");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "backface_button", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "backface_button", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Backface", "Show header button that toggles the backface filter");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "object_cycle_touch", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "object_cycle_touch", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Touch", "Object header button will include touch mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "object_cycle_enclose", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "object_cycle_enclose", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Enclose", "Object header button will include enclose mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "object_cycle_origin", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "object_cycle_origin", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Origin", "Object header button will include origin mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "face_cycle_default", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "face_cycle_default", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Default", "Face header button will include default mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "face_cycle_touch", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "face_cycle_touch", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Touch", "Face header button will include touch mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "face_cycle_enclose", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "face_cycle_enclose", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Enclose", "Face header button will include enclose mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "face_cycle_center", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "face_cycle_center", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Center", "Face header button will include center mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "edge_cycle_default", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "edge_cycle_default", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Default", "Edge header button will include default mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "edge_cycle_touch", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "edge_cycle_touch", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Touch", "Edge header button will include touch mode in its cycle");
|
||||
|
||||
prop = RNA_def_property(srna, "edge_cycle_enclose", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "edge_cycle_enclose", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Enclose", "Edge header button will include enclose mode in its cycle");
|
||||
|
||||
/* X-Ray Options */
|
||||
prop = RNA_def_property(srna, "xray_header", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "xray_header", 0);
|
||||
RNA_def_property_ui_text(prop,
|
||||
"X-Ray Control",
|
||||
"Use either the header or keymap to control additional X-Ray options");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "xray_button", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "xray_button", 0);
|
||||
RNA_def_property_ui_text(prop, "X-Ray", "Show button for X-Ray in viewport header");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray", 0);
|
||||
RNA_def_property_ui_text(prop, "Enable", "Transparent scene display during drag select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray_button", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray_button", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Auto X-Ray", "Show button for automatic X-Ray in viewport header");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray_reset", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray_reset", 0);
|
||||
RNA_def_property_ui_text(prop, "Auto X-Ray Reset", "Helper that turns xray off for autoxray");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray_object", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray_object", 0);
|
||||
RNA_def_property_ui_text(prop, "Object", "Automatic X-Ray in object mode");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray_edit", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray_edit", 0);
|
||||
RNA_def_property_ui_text(prop, "Edit", "Automatic X-Ray in edit mode");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray_box", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray_box", 0);
|
||||
RNA_def_property_ui_text(prop, "Box", "Transparent scene display during box select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray_lasso", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray_lasso", 0);
|
||||
RNA_def_property_ui_text(prop, "Lasso", "Transparent scene display during lasso select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "auto_xray_circle", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "auto_xray_circle", 0);
|
||||
RNA_def_property_ui_text(prop, "Circle", "Transparent scene display during circle select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "select_through", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_through", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Enable", "Select occluded objects and mesh elements with drag select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "select_through_button", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_through_button", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Select Through", "Show button for select through in viewport header");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "select_through_object", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_through_object", 0);
|
||||
RNA_def_property_ui_text(prop, "Object", "Select through in object mode");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "select_through_edit", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_through_edit", 0);
|
||||
RNA_def_property_ui_text(prop, "Edit", "Select through in edit mode");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "select_through_box", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_through_box", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Box", "Select occluded objects and mesh elements with box select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "select_through_lasso", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_through_lasso", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Lasso", "Select occluded objects and mesh elements with lasso select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "select_through_circle", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "select_through_circle", 0);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Circle", "Select occluded objects and mesh elements with circle select");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, nullptr);
|
||||
|
||||
/* Unified Paint Settings */
|
||||
prop = RNA_def_property(srna, "unified_paint_settings", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_flag(prop, PROP_NEVER_NULL);
|
||||
|
|
|
@ -4661,6 +4661,16 @@ static void rna_def_space_view3d_overlay(BlenderRNA *brna)
|
|||
"Display face center when face selection is enabled in solid shading modes");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "show_face_center_xray", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(
|
||||
prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_FACE_DOT_XRAY);
|
||||
RNA_def_property_boolean_default(prop, true);
|
||||
RNA_def_property_ui_text(
|
||||
prop,
|
||||
"Display Face Center X-Ray",
|
||||
"Display face center when face selection is enabled in X-Ray shading modes");
|
||||
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, nullptr);
|
||||
|
||||
prop = RNA_def_property(srna, "show_edge_crease", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "overlay.edit_flag", V3D_OVERLAY_EDIT_CREASES);
|
||||
RNA_def_property_ui_text(
|
||||
|
|
|
@ -5366,6 +5366,124 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
|
|||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem system_cursor_items[] = {
|
||||
{USER_SYSTEM_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_SYSTEM_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_SYSTEM_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_SYSTEM_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_SYSTEM_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_SYSTEM_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_SYSTEM_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_SYSTEM_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_SYSTEM_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_SYSTEM_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem edit_cursor_items[] = {
|
||||
{USER_EDIT_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_EDIT_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_EDIT_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_EDIT_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_EDIT_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_EDIT_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_EDIT_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_EDIT_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_EDIT_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_EDIT_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem paint_cursor_items[] = {
|
||||
{USER_PAINT_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_PAINT_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_PAINT_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_PAINT_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_PAINT_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_PAINT_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_PAINT_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_PAINT_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_PAINT_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_PAINT_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{USER_PAINT_CURSOR_BLANK, "BLANK", 0, "Blank", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem dot_cursor_items[] = {
|
||||
{USER_DOT_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{USER_DOT_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_DOT_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_DOT_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_DOT_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_DOT_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_DOT_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_DOT_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_DOT_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_DOT_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_DOT_CURSOR_BLANK, "BLANK", 0, "Blank", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem knife_cursor_items[] = {
|
||||
{USER_KNIFE_CURSOR_KNIFE, "KNIFE", 0, "Knife", ""},
|
||||
{USER_KNIFE_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_KNIFE_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_KNIFE_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_KNIFE_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_KNIFE_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_KNIFE_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_KNIFE_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_KNIFE_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_KNIFE_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_KNIFE_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem eyedropper_cursor_items[] = {
|
||||
{USER_EYEDROPPER_CURSOR_EYEDROPPER, "EYEDROPPER", 0, "Eyedropper", ""},
|
||||
{USER_EYEDROPPER_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_EYEDROPPER_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_EYEDROPPER_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_EYEDROPPER_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_EYEDROPPER_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_EYEDROPPER_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_EYEDROPPER_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_EYEDROPPER_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_EYEDROPPER_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_EYEDROPPER_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem eraser_cursor_items[] = {
|
||||
{USER_ERASER_CURSOR_ERASER, "ERASER", 0, "Eraser", ""},
|
||||
{USER_ERASER_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_ERASER_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_ERASER_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_ERASER_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_ERASER_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_ERASER_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_ERASER_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_ERASER_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_ERASER_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_ERASER_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem pencil_cursor_items[] = {
|
||||
{USER_PENCIL_CURSOR_PENCIL, "PENCIL", 0, "Pencil", ""},
|
||||
{USER_PENCIL_CURSOR_CROSS, "CROSS", 0, "Cross", ""},
|
||||
{USER_PENCIL_CURSOR_SYSTEM, "SYSTEM", 0, "System", ""},
|
||||
{USER_PENCIL_CURSOR_POINTER, "POINTER", 0, "Pointer", ""},
|
||||
{USER_PENCIL_CURSOR_CROSS_OPEN, "CROSS_OPEN", 0, "Cross Open", ""},
|
||||
{USER_PENCIL_CURSOR_CROSS_DOT, "CROSS_DOT", 0, "Cross Dot", ""},
|
||||
{USER_PENCIL_CURSOR_CROSS_MIN, "CROSS_MIN", 0, "Cross Minimal", ""},
|
||||
{USER_PENCIL_CURSOR_BOX, "BOX", 0, "Box", ""},
|
||||
{USER_PENCIL_CURSOR_BOX_DOT, "BOX_DOT", 0, "Box Dot", ""},
|
||||
{USER_PENCIL_CURSOR_BOX_POINTER, "BOX_POINTER", 0, "Box Pointer", ""},
|
||||
{USER_PENCIL_CURSOR_DOT, "DOT", 0, "Dot", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
srna = RNA_def_struct(brna, "PreferencesEdit", nullptr);
|
||||
RNA_def_struct_sdna(srna, "UserDef");
|
||||
RNA_def_struct_nested(brna, srna, "Preferences");
|
||||
|
@ -5740,6 +5858,60 @@ static void rna_def_userdef_edit(BlenderRNA *brna)
|
|||
RNA_def_property_boolean_sdna(prop, nullptr, "uiflag", USER_DEPTH_CURSOR);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Cursor Surface Project", "Use the surface depth for cursor placement");
|
||||
|
||||
prop = RNA_def_property(srna, "adjustable_click_select", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_ADJUSTABLE_CLICK_SELECT);
|
||||
RNA_def_property_ui_text(prop, "Enable", "Use additional options for single-click select");
|
||||
|
||||
prop = RNA_def_property(srna, "select_unbiased", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_SELECT_UNBIASED);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Select Unbiased", "Click-select will not favor unselected mesh elements");
|
||||
|
||||
prop = RNA_def_property(srna, "selection_radius", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_range(prop, 0.1f, 150.0f);
|
||||
RNA_def_property_ui_range(prop, 0.1f, 150.0f, 0.01f, 2);
|
||||
RNA_def_property_ui_text(prop, "Radius", "Size of single-click selection radius");
|
||||
|
||||
prop = RNA_def_property(srna, "system_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, system_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "system_cursor");
|
||||
RNA_def_property_ui_text(prop, "System Cursor", "System mode cursor style");
|
||||
|
||||
prop = RNA_def_property(srna, "edit_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, edit_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "edit_cursor");
|
||||
RNA_def_property_ui_text(prop, "Edit Cursor", "Edit mode cursor style");
|
||||
|
||||
prop = RNA_def_property(srna, "paint_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, paint_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "paint_cursor");
|
||||
RNA_def_property_ui_text(prop, "Paint Cursor", "Paint mode cursor style");
|
||||
|
||||
prop = RNA_def_property(srna, "dot_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, dot_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "dot_cursor");
|
||||
RNA_def_property_ui_text(prop, "2D Cursor", "2D mode cursor style");
|
||||
|
||||
prop = RNA_def_property(srna, "knife_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, knife_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "knife_cursor");
|
||||
RNA_def_property_ui_text(prop, "Knife Cursor", "Knife cursor style");
|
||||
|
||||
prop = RNA_def_property(srna, "eyedropper_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, eyedropper_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "eyedropper_cursor");
|
||||
RNA_def_property_ui_text(prop, "Eyedropper Cursor", "Eyedropper cursor style");
|
||||
|
||||
prop = RNA_def_property(srna, "eraser_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, eraser_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "eraser_cursor");
|
||||
RNA_def_property_ui_text(prop, "Eraser Cursor", "Eraser cursor style");
|
||||
|
||||
prop = RNA_def_property(srna, "pencil_cursor", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, pencil_cursor_items);
|
||||
RNA_def_property_enum_sdna(prop, nullptr, "pencil_cursor");
|
||||
RNA_def_property_ui_text(prop, "Pencil Cursor", "Pencil cursor style");
|
||||
}
|
||||
|
||||
static void rna_def_userdef_system(BlenderRNA *brna)
|
||||
|
@ -6210,6 +6382,17 @@ static void rna_def_userdef_input(BlenderRNA *brna)
|
|||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem click_drag_direction_types[] = {
|
||||
{USER_CLICK_DRAG_DIRECTION_EIGHT_WAY,
|
||||
"EIGHT_WAY",
|
||||
0,
|
||||
"Eight",
|
||||
"Eight directions (N, NE, E, SE, S, SW, W, NW)"},
|
||||
{USER_CLICK_DRAG_DIRECTION_LEFT_RIGHT, "LEFT_RIGHT", 0, "Left Right", "Left and right"},
|
||||
{USER_CLICK_DRAG_DIRECTION_UP_DOWN, "UP_DOWN", 0, "Up Down", "Up and down"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem view_zoom_styles[] = {
|
||||
{USER_ZOOM_CONTINUE,
|
||||
"CONTINUE",
|
||||
|
@ -6316,6 +6499,11 @@ static void rna_def_userdef_input(BlenderRNA *brna)
|
|||
"Release Confirms",
|
||||
"Moving things with a mouse drag confirms when releasing the button");
|
||||
|
||||
prop = RNA_def_property(srna, "click_drag_direction", PROP_ENUM, PROP_NONE);
|
||||
RNA_def_property_enum_items(prop, click_drag_direction_types);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Keymap Drag Directions", "Style of click-drag direction the keymap will use");
|
||||
|
||||
prop = RNA_def_property(srna, "use_numeric_input_advanced", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, nullptr, "flag", USER_FLAG_NUMINPUT_ADVANCED);
|
||||
RNA_def_property_ui_text(prop,
|
||||
|
@ -6380,6 +6568,12 @@ static void rna_def_userdef_input(BlenderRNA *brna)
|
|||
"Number of pixels to before the cursor is considered to have moved "
|
||||
"(used for cycling selected items on successive clicks)");
|
||||
|
||||
prop = RNA_def_property(srna, "header_highlight", PROP_INT, PROP_FACTOR);
|
||||
RNA_def_property_range(prop, 0, 10);
|
||||
RNA_def_property_ui_range(prop, 0, 10, 1, -1);
|
||||
RNA_def_property_ui_text(
|
||||
prop, "Header Highlight", "How much brighter the header of the active window is");
|
||||
|
||||
/* tablet pressure curve */
|
||||
prop = RNA_def_property(srna, "pressure_threshold_max", PROP_FLOAT, PROP_FACTOR);
|
||||
RNA_def_property_range(prop, 0.0f, 1.0f);
|
||||
|
|
|
@ -421,6 +421,41 @@ static void rna_KeyMap_item_remove(wmKeyMap *km, ReportList *reports, PointerRNA
|
|||
RNA_POINTER_INVALIDATE(kmi_ptr);
|
||||
}
|
||||
|
||||
static void rna_keymap_set_direction_any(wmKeyMap *km, PointerRNA *kmi_ptr)
|
||||
{
|
||||
wmKeyMapItem *kmi = static_cast<wmKeyMapItem *>(kmi_ptr->data);
|
||||
kmi->direction = -1;
|
||||
WM_keyconfig_update_tag(km, kmi);
|
||||
}
|
||||
|
||||
static void rna_keymap_set_direction_left(wmKeyMap *km, PointerRNA *kmi_ptr)
|
||||
{
|
||||
wmKeyMapItem *kmi = static_cast<wmKeyMapItem *>(kmi_ptr->data);
|
||||
kmi->direction = 7;
|
||||
WM_keyconfig_update_tag(km, kmi);
|
||||
}
|
||||
|
||||
static void rna_keymap_set_direction_right(wmKeyMap *km, PointerRNA *kmi_ptr)
|
||||
{
|
||||
wmKeyMapItem *kmi = static_cast<wmKeyMapItem *>(kmi_ptr->data);
|
||||
kmi->direction = 3;
|
||||
WM_keyconfig_update_tag(km, kmi);
|
||||
}
|
||||
|
||||
static void rna_keymap_set_direction_up(wmKeyMap *km, PointerRNA *kmi_ptr)
|
||||
{
|
||||
wmKeyMapItem *kmi = static_cast<wmKeyMapItem *>(kmi_ptr->data);
|
||||
kmi->direction = 1;
|
||||
WM_keyconfig_update_tag(km, kmi);
|
||||
}
|
||||
|
||||
static void rna_keymap_set_direction_down(wmKeyMap *km, PointerRNA *kmi_ptr)
|
||||
{
|
||||
wmKeyMapItem *kmi = static_cast<wmKeyMapItem *>(kmi_ptr->data);
|
||||
kmi->direction = 5;
|
||||
WM_keyconfig_update_tag(km, kmi);
|
||||
}
|
||||
|
||||
static PointerRNA rna_KeyMap_item_find_from_operator(ID *id,
|
||||
wmKeyMap *km,
|
||||
const char *idname,
|
||||
|
@ -1278,6 +1313,31 @@ void RNA_api_keymapitems(StructRNA *srna)
|
|||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
|
||||
|
||||
func = RNA_def_function(srna, "set_direction_any", "rna_keymap_set_direction_any");
|
||||
parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
|
||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
|
||||
|
||||
func = RNA_def_function(srna, "set_direction_left", "rna_keymap_set_direction_left");
|
||||
parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
|
||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
|
||||
|
||||
func = RNA_def_function(srna, "set_direction_right", "rna_keymap_set_direction_right");
|
||||
parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
|
||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
|
||||
|
||||
func = RNA_def_function(srna, "set_direction_up", "rna_keymap_set_direction_up");
|
||||
parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
|
||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
|
||||
|
||||
func = RNA_def_function(srna, "set_direction_down", "rna_keymap_set_direction_down");
|
||||
parm = RNA_def_pointer(func, "item", "KeyMapItem", "Item", "");
|
||||
RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
|
||||
RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, ParameterFlag(0));
|
||||
|
||||
func = RNA_def_function(srna, "from_id", "WM_keymap_item_find_id");
|
||||
parm = RNA_def_property(func, "id", PROP_INT, PROP_NONE);
|
||||
RNA_def_parameter_flags(parm, PropertyFlag(0), PARM_REQUIRED);
|
||||
|
|
|
@ -1356,14 +1356,14 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
|
|||
if (enum_item != rna_enum_dummy_NULL_items) {
|
||||
const char *ptr_name = RNA_struct_name_get_alloc(ptr, nullptr, 0, nullptr);
|
||||
|
||||
/* Prefer not to fail silently in case of API errors, maybe disable it later. */
|
||||
/* Prefer not to fail silently in case of API errors, maybe disable it later.
|
||||
CLOG_WARN(BPY_LOG_RNA,
|
||||
"current value '%d' "
|
||||
"matches no enum in '%s', '%s', '%s'",
|
||||
val,
|
||||
RNA_struct_identifier(ptr->type),
|
||||
ptr_name,
|
||||
RNA_property_identifier(prop));
|
||||
RNA_property_identifier(prop));*/
|
||||
|
||||
#if 0 /* Gives Python decoding errors while generating docs :( */
|
||||
char error_str[256];
|
||||
|
|
|
@ -791,6 +791,7 @@ int WM_operator_call_notest(bContext *C, wmOperator *op);
|
|||
* Execute this operator again, put here so it can share above code
|
||||
*/
|
||||
int WM_operator_repeat(bContext *C, wmOperator *op);
|
||||
int WM_operator_invoke_last(bContext *C, wmOperator *op);
|
||||
int WM_operator_repeat_last(bContext *C, wmOperator *op);
|
||||
/**
|
||||
* \return true if #WM_operator_repeat can run.
|
||||
|
|
|
@ -559,6 +559,7 @@ struct wmNotifier {
|
|||
#define WM_GESTURE_LASSO 4
|
||||
#define WM_GESTURE_CIRCLE 5
|
||||
#define WM_GESTURE_STRAIGHTLINE 6
|
||||
#define WM_GESTURE_SQUARE 7
|
||||
|
||||
/**
|
||||
* wmGesture is registered to #wmWindow.gesture, handled by operator callbacks.
|
||||
|
|
|
@ -44,14 +44,80 @@ static BCursor *BlenderCursor[WM_CURSOR_NUM] = {nullptr};
|
|||
/* Blender cursor to GHOST standard cursor conversion. */
|
||||
static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs)
|
||||
{
|
||||
const int system_style = U.system_cursor;
|
||||
const int edit_style = U.edit_cursor;
|
||||
const int paint_style = U.paint_cursor;
|
||||
const int dot_style = U.dot_cursor;
|
||||
const int knife_style = U.knife_cursor;
|
||||
const int pencil_style = U.pencil_cursor;
|
||||
const int eraser_style = U.eraser_cursor;
|
||||
const int eyedropper_style = U.eyedropper_cursor;
|
||||
switch (curs) {
|
||||
case WM_CURSOR_DEFAULT:
|
||||
return GHOST_kStandardCursorDefault;
|
||||
if (system_style == 1) {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
else if (system_style == 2) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (system_style == 3) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (system_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
else if (system_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (system_style == 6) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (system_style == 7) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (system_style == 8) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (system_style == 9) {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
case WM_CURSOR_WAIT:
|
||||
return GHOST_kStandardCursorWait;
|
||||
case WM_CURSOR_EDIT:
|
||||
case WM_CURSOR_CROSS:
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
if (edit_style == 1) {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
else if (edit_style == 2) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (edit_style == 3) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (edit_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
else if (edit_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (edit_style == 6) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (edit_style == 7) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (edit_style == 8) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (edit_style == 9) {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
case WM_CURSOR_X_MOVE:
|
||||
return GHOST_kStandardCursorLeftRight;
|
||||
case WM_CURSOR_Y_MOVE:
|
||||
|
@ -67,7 +133,39 @@ static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs)
|
|||
case WM_CURSOR_STOP:
|
||||
return GHOST_kStandardCursorStop;
|
||||
case WM_CURSOR_KNIFE:
|
||||
return GHOST_kStandardCursorKnife;
|
||||
if (knife_style == 1) {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
else if (knife_style == 2) {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
else if (knife_style == 3) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (knife_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (knife_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
else if (knife_style == 6) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (knife_style == 7) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (knife_style == 8) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (knife_style == 9) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (knife_style == 10) {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorKnife;
|
||||
}
|
||||
case WM_CURSOR_NSEW_SCROLL:
|
||||
return GHOST_kStandardCursorNSEWScroll;
|
||||
case WM_CURSOR_NS_SCROLL:
|
||||
|
@ -75,19 +173,147 @@ static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs)
|
|||
case WM_CURSOR_EW_SCROLL:
|
||||
return GHOST_kStandardCursorEWScroll;
|
||||
case WM_CURSOR_EYEDROPPER:
|
||||
return GHOST_kStandardCursorEyedropper;
|
||||
if (eyedropper_style == 1) {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
else if (eyedropper_style == 2) {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
else if (eyedropper_style == 3) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (eyedropper_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (eyedropper_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
else if (eyedropper_style == 6) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (eyedropper_style == 7) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (eyedropper_style == 8) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (eyedropper_style == 9) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (eyedropper_style == 10) {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorEyedropper;
|
||||
}
|
||||
case WM_CURSOR_N_ARROW:
|
||||
return GHOST_kStandardCursorUpArrow;
|
||||
case WM_CURSOR_S_ARROW:
|
||||
return GHOST_kStandardCursorDownArrow;
|
||||
case WM_CURSOR_PAINT:
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
if (paint_style == 1) {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
else if (paint_style == 2) {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
else if (paint_style == 3) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (paint_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (paint_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (paint_style == 6) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (paint_style == 7) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (paint_style == 8) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (paint_style == 9) {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
else if (paint_style == 10) {
|
||||
return GHOST_kStandardCursorBlank;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
case WM_CURSOR_DOT:
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
if (dot_style == 1) {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
else if (dot_style == 2) {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
else if (dot_style == 3) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (dot_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (dot_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
else if (dot_style == 6) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (dot_style == 7) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (dot_style == 8) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (dot_style == 9) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (dot_style == 10) {
|
||||
return GHOST_kStandardCursorBlank;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
case WM_CURSOR_CROSSC:
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
case WM_CURSOR_ERASER:
|
||||
return GHOST_kStandardCursorEraser;
|
||||
if (eraser_style == 1) {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
else if (eraser_style == 2) {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
else if (eraser_style == 3) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (eraser_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (eraser_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
else if (eraser_style == 6) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (eraser_style == 7) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (eraser_style == 8) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (eraser_style == 9) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (eraser_style == 10) {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorEraser;
|
||||
}
|
||||
case WM_CURSOR_ZOOM_IN:
|
||||
return GHOST_kStandardCursorZoomIn;
|
||||
case WM_CURSOR_ZOOM_OUT:
|
||||
|
@ -95,7 +321,39 @@ static GHOST_TStandardCursor convert_to_ghost_standard_cursor(WMCursorType curs)
|
|||
case WM_CURSOR_TEXT_EDIT:
|
||||
return GHOST_kStandardCursorText;
|
||||
case WM_CURSOR_PAINT_BRUSH:
|
||||
return GHOST_kStandardCursorPencil;
|
||||
if (pencil_style == 1) {
|
||||
return GHOST_kStandardCursorCrosshair;
|
||||
}
|
||||
else if (pencil_style == 2) {
|
||||
return GHOST_kStandardCursorDefault;
|
||||
}
|
||||
else if (pencil_style == 3) {
|
||||
return GHOST_kStandardCursorPointer;
|
||||
}
|
||||
else if (pencil_style == 4) {
|
||||
return GHOST_kStandardCursorCrosshairD;
|
||||
}
|
||||
else if (pencil_style == 5) {
|
||||
return GHOST_kStandardCursorCrosshairA;
|
||||
}
|
||||
else if (pencil_style == 6) {
|
||||
return GHOST_kStandardCursorCrosshairC;
|
||||
}
|
||||
else if (pencil_style == 7) {
|
||||
return GHOST_kStandardCursorBox;
|
||||
}
|
||||
else if (pencil_style == 8) {
|
||||
return GHOST_kStandardCursorBoxDot;
|
||||
}
|
||||
else if (pencil_style == 9) {
|
||||
return GHOST_kStandardCursorBoxPointer;
|
||||
}
|
||||
else if (pencil_style == 10) {
|
||||
return GHOST_kStandardCursorCrosshairB;
|
||||
}
|
||||
else {
|
||||
return GHOST_kStandardCursorPencil;
|
||||
}
|
||||
case WM_CURSOR_E_ARROW:
|
||||
return GHOST_kStandardCursorRightArrow;
|
||||
case WM_CURSOR_W_ARROW:
|
||||
|
|
|
@ -274,29 +274,42 @@ int WM_event_drag_direction(const wmEvent *event)
|
|||
event->xy[1] - event->prev_press_xy[1],
|
||||
};
|
||||
|
||||
int theta = round_fl_to_int(4.0f * atan2f(float(delta[1]), float(delta[0])) / float(M_PI));
|
||||
int val = KM_DIRECTION_W;
|
||||
const bool left_right = U.click_drag_direction & USER_CLICK_DRAG_DIRECTION_LEFT_RIGHT;
|
||||
const bool up_down = U.click_drag_direction & USER_CLICK_DRAG_DIRECTION_UP_DOWN;
|
||||
int val = up_down ? KM_DIRECTION_S : KM_DIRECTION_W;
|
||||
|
||||
if (theta == 0) {
|
||||
val = KM_DIRECTION_E;
|
||||
if (left_right || up_down) {
|
||||
float thetaf = 4.0f * atan2f((float)delta[1], (float)delta[0]) / (float)M_PI;
|
||||
if (left_right && thetaf > -2.0f && thetaf < 2.0f) {
|
||||
val = KM_DIRECTION_E;
|
||||
}
|
||||
else if (up_down && thetaf > 0.0f) {
|
||||
val = KM_DIRECTION_N;
|
||||
}
|
||||
}
|
||||
else if (theta == 1) {
|
||||
val = KM_DIRECTION_NE;
|
||||
}
|
||||
else if (theta == 2) {
|
||||
val = KM_DIRECTION_N;
|
||||
}
|
||||
else if (theta == 3) {
|
||||
val = KM_DIRECTION_NW;
|
||||
}
|
||||
else if (theta == -1) {
|
||||
val = KM_DIRECTION_SE;
|
||||
}
|
||||
else if (theta == -2) {
|
||||
val = KM_DIRECTION_S;
|
||||
}
|
||||
else if (theta == -3) {
|
||||
val = KM_DIRECTION_SW;
|
||||
else {
|
||||
int theta = round_fl_to_int(4.0f * atan2f((float)delta[1], (float)delta[0]) / (float)M_PI);
|
||||
if (theta == 0) {
|
||||
val = KM_DIRECTION_E;
|
||||
}
|
||||
else if (theta == 1) {
|
||||
val = KM_DIRECTION_NE;
|
||||
}
|
||||
else if (theta == 2) {
|
||||
val = KM_DIRECTION_N;
|
||||
}
|
||||
else if (theta == 3) {
|
||||
val = KM_DIRECTION_NW;
|
||||
}
|
||||
else if (theta == -1) {
|
||||
val = KM_DIRECTION_SE;
|
||||
}
|
||||
else if (theta == -2) {
|
||||
val = KM_DIRECTION_S;
|
||||
}
|
||||
else if (theta == -3) {
|
||||
val = KM_DIRECTION_SW;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
|
|
@ -1323,6 +1323,11 @@ int WM_operator_repeat(bContext *C, wmOperator *op)
|
|||
op->flag &= ~op_flag;
|
||||
return ret;
|
||||
}
|
||||
int WM_operator_invoke_last(bContext *C, wmOperator *op)
|
||||
{
|
||||
const int ret = WM_operator_name_call_ptr(C, op->type, WM_OP_INVOKE_DEFAULT, nullptr, nullptr);
|
||||
return ret;
|
||||
}
|
||||
int WM_operator_repeat_last(bContext *C, wmOperator *op)
|
||||
{
|
||||
const int op_flag = OP_IS_REPEAT_LAST;
|
||||
|
|
|
@ -56,6 +56,7 @@ wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent
|
|||
WM_GESTURE_RECT,
|
||||
WM_GESTURE_CROSS_RECT,
|
||||
WM_GESTURE_CIRCLE,
|
||||
WM_GESTURE_SQUARE,
|
||||
WM_GESTURE_STRAIGHTLINE))
|
||||
{
|
||||
rcti *rect = static_cast<rcti *>(MEM_callocN(sizeof(rcti), "gesture rect new"));
|
||||
|
@ -63,7 +64,7 @@ wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent
|
|||
gesture->customdata = rect;
|
||||
rect->xmin = xy[0] - gesture->winrct.xmin;
|
||||
rect->ymin = xy[1] - gesture->winrct.ymin;
|
||||
if (type == WM_GESTURE_CIRCLE) {
|
||||
if (type == WM_GESTURE_CIRCLE || type == WM_GESTURE_SQUARE) {
|
||||
/* caller is responsible for initializing 'xmax' to radius. */
|
||||
}
|
||||
else {
|
||||
|
@ -275,6 +276,51 @@ static void wm_gesture_draw_circle(wmGesture *gt)
|
|||
immUnbindProgram();
|
||||
}
|
||||
|
||||
static void wm_gesture_draw_square(wmGesture *gt)
|
||||
{
|
||||
rcti *rect = (rcti *)gt->customdata;
|
||||
|
||||
uint shdr_pos = GPU_vertformat_attr_add(
|
||||
immVertexFormat(), "pos", GPU_COMP_I32, 2, GPU_FETCH_INT_TO_FLOAT);
|
||||
|
||||
GPU_blend(GPU_BLEND_ALPHA);
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_UNIFORM_COLOR);
|
||||
immUniformColor4f(1.0f, 1.0f, 1.0f, 0.05f);
|
||||
|
||||
immRecti(shdr_pos,
|
||||
rect->xmin - rect->xmax,
|
||||
rect->ymin - rect->xmax,
|
||||
rect->xmin + rect->xmax,
|
||||
rect->ymin + rect->xmax);
|
||||
|
||||
immUnbindProgram();
|
||||
|
||||
GPU_blend(GPU_BLEND_NONE);
|
||||
|
||||
shdr_pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
|
||||
|
||||
immBindBuiltinProgram(GPU_SHADER_3D_LINE_DASHED_UNIFORM_COLOR);
|
||||
|
||||
float viewport_size[4];
|
||||
GPU_viewport_size_get_f(viewport_size);
|
||||
immUniform2f("viewport_size", viewport_size[2], viewport_size[3]);
|
||||
|
||||
immUniform1i("colors_len", 2); /* "advanced" mode */
|
||||
immUniform4f("color", 0.4f, 0.4f, 0.4f, 1.0f);
|
||||
immUniform4f("color2", 1.0f, 1.0f, 1.0f, 1.0f);
|
||||
immUniform1f("dash_width", 8.0f);
|
||||
immUniform1f("udash_factor", 0.5f);
|
||||
|
||||
imm_draw_box_wire_2d(shdr_pos,
|
||||
float(rect->xmin - rect->xmax),
|
||||
float(rect->ymin - rect->xmax),
|
||||
float(rect->xmin + rect->xmax),
|
||||
float(rect->ymin + rect->xmax));
|
||||
|
||||
immUnbindProgram();
|
||||
}
|
||||
|
||||
struct LassoFillData {
|
||||
uchar *px;
|
||||
int width;
|
||||
|
@ -447,6 +493,9 @@ void wm_gesture_draw(wmWindow *win)
|
|||
else if (gt->type == WM_GESTURE_CIRCLE) {
|
||||
wm_gesture_draw_circle(gt);
|
||||
}
|
||||
else if (gt->type == WM_GESTURE_SQUARE) {
|
||||
wm_gesture_draw_square(gt);
|
||||
}
|
||||
else if (gt->type == WM_GESTURE_CROSS_RECT) {
|
||||
if (gt->is_active) {
|
||||
wm_gesture_draw_rect(gt);
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include "ED_screen.hh"
|
||||
#include "ED_select_utils.hh"
|
||||
#include "ED_view3d.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
|
||||
|
@ -87,6 +88,53 @@ static void gesture_modal_state_to_operator(wmOperator *op, int modal_state)
|
|||
}
|
||||
}
|
||||
|
||||
static void gesture_toggle_xray(bContext *C)
|
||||
{
|
||||
wmOperatorType *ot = WM_operatortype_find("VIEW3D_OT_toggle_xray", true);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
BLI_assert(ot);
|
||||
PointerRNA ptr;
|
||||
WM_operator_properties_create_ptr(&ptr, ot);
|
||||
WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &ptr, nullptr);
|
||||
WM_operator_properties_free(&ptr);
|
||||
ts->auto_xray_reset ^= true;
|
||||
}
|
||||
|
||||
static void gesture_auto_xray(bContext *C,
|
||||
View3D *v3d,
|
||||
ToolSettings *ts,
|
||||
wmOperator *op,
|
||||
const bool mesh,
|
||||
const bool lasso,
|
||||
const bool circle)
|
||||
{
|
||||
if (!v3d || XRAY_FLAG_ENABLED(v3d)) {
|
||||
return;
|
||||
}
|
||||
|
||||
bool auto_xray = false;
|
||||
|
||||
if (ts->xray_header) {
|
||||
if (ts->auto_xray && mesh && ts->auto_xray_edit ||
|
||||
ts->auto_xray && !mesh && ts->auto_xray_object)
|
||||
{
|
||||
auto_xray = lasso ? ts->auto_xray_lasso : circle ? ts->auto_xray_circle : ts->auto_xray_box;
|
||||
}
|
||||
}
|
||||
else {
|
||||
const int mode = RNA_enum_get(op->ptr, "auto_xray");
|
||||
auto_xray = mesh ? mode == 4 || mode == 8 : mode == 2 || mode == 8;
|
||||
}
|
||||
|
||||
if (ts->auto_xray_reset) {
|
||||
ts->auto_xray_reset ^= true;
|
||||
}
|
||||
|
||||
if (auto_xray) {
|
||||
gesture_toggle_xray(C);
|
||||
}
|
||||
}
|
||||
|
||||
static int UNUSED_FUNCTION(gesture_modal_state_from_operator)(wmOperator *op)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
|
@ -165,10 +213,15 @@ static bool gesture_box_apply(bContext *C, wmOperator *op)
|
|||
int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
const ARegion *region = CTX_wm_region(C);
|
||||
const bool wait_for_input = !WM_event_is_mouse_drag_or_press(event) &&
|
||||
RNA_boolean_get(op->ptr, "wait_for_input");
|
||||
|
||||
gesture_auto_xray(C, v3d, ts, op, obedit, false, false);
|
||||
|
||||
if (wait_for_input) {
|
||||
op->customdata = WM_gesture_new(win, region, event, WM_GESTURE_CROSS_RECT);
|
||||
}
|
||||
|
@ -192,8 +245,11 @@ int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
wmGesture *gesture = static_cast<wmGesture *>(op->customdata);
|
||||
rcti *rect = static_cast<rcti *>(gesture->customdata);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ToolSettings *ts = CTX_data_tool_settings(C);
|
||||
|
||||
if (event->type == EVT_MODAL_MAP) {
|
||||
switch (event->val) {
|
||||
|
@ -216,13 +272,22 @@ int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
gesture->modal_state = event->val;
|
||||
}
|
||||
if (gesture_box_apply(C, op)) {
|
||||
if (ts->auto_xray_reset) {
|
||||
gesture_toggle_xray(C);
|
||||
}
|
||||
gesture_modal_end(C, op);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
if (ts->auto_xray_reset) {
|
||||
gesture_toggle_xray(C);
|
||||
}
|
||||
gesture_modal_end(C, op);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
case GESTURE_MODAL_CANCEL: {
|
||||
if (ts->auto_xray_reset) {
|
||||
gesture_toggle_xray(C);
|
||||
}
|
||||
gesture_modal_end(C, op);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
@ -288,10 +353,21 @@ static void gesture_circle_apply(bContext *C, wmOperator *op);
|
|||
int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
const bool wait_for_input = !WM_event_is_mouse_drag_or_press(event) &&
|
||||
RNA_boolean_get(op->ptr, "wait_for_input");
|
||||
|
||||
op->customdata = WM_gesture_new(win, CTX_wm_region(C), event, WM_GESTURE_CIRCLE);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ToolSettings *ts = static_cast<ToolSettings *>(win->scene->toolsettings);
|
||||
gesture_auto_xray(C, v3d, ts, op, obedit, false, true);
|
||||
|
||||
if (ts->square_select) {
|
||||
op->customdata = WM_gesture_new(win, CTX_wm_region(C), event, WM_GESTURE_SQUARE);
|
||||
}
|
||||
else {
|
||||
op->customdata = WM_gesture_new(win, CTX_wm_region(C), event, WM_GESTURE_CIRCLE);
|
||||
}
|
||||
|
||||
wmGesture *gesture = static_cast<wmGesture *>(op->customdata);
|
||||
rcti *rect = static_cast<rcti *>(gesture->customdata);
|
||||
|
||||
|
@ -347,8 +423,11 @@ static void gesture_circle_apply(bContext *C, wmOperator *op)
|
|||
int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
wmGesture *gesture = static_cast<wmGesture *>(op->customdata);
|
||||
rcti *rect = static_cast<rcti *>(gesture->customdata);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ToolSettings *ts = static_cast<ToolSettings *>(win->scene->toolsettings);
|
||||
|
||||
if (event->type == MOUSEMOVE) {
|
||||
|
||||
|
@ -417,6 +496,9 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
}
|
||||
|
||||
if (is_finished) {
|
||||
if (ts->auto_xray_reset) {
|
||||
gesture_toggle_xray(C);
|
||||
}
|
||||
gesture_modal_end(C, op);
|
||||
return OPERATOR_FINISHED; /* use finish or we don't get an undo */
|
||||
}
|
||||
|
@ -479,7 +561,12 @@ void WM_OT_circle_gesture(wmOperatorType *ot)
|
|||
int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
PropertyRNA *prop;
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
ToolSettings *ts = static_cast<ToolSettings *>(win->scene->toolsettings);
|
||||
|
||||
gesture_auto_xray(C, v3d, ts, op, obedit, true, false);
|
||||
|
||||
op->customdata = WM_gesture_new(win, CTX_wm_region(C), event, WM_GESTURE_LASSO);
|
||||
|
||||
|
@ -519,6 +606,10 @@ static int gesture_lasso_apply(bContext *C, wmOperator *op)
|
|||
int retval = OPERATOR_FINISHED;
|
||||
wmGesture *gesture = static_cast<wmGesture *>(op->customdata);
|
||||
PointerRNA itemptr;
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
ToolSettings *ts = static_cast<ToolSettings *>(win->scene->toolsettings);
|
||||
float loc[2];
|
||||
int i;
|
||||
const short *lasso = static_cast<const short int *>(gesture->customdata);
|
||||
|
@ -540,12 +631,20 @@ static int gesture_lasso_apply(bContext *C, wmOperator *op)
|
|||
OPERATOR_RETVAL_CHECK(retval);
|
||||
}
|
||||
|
||||
if (ts->auto_xray_reset) {
|
||||
gesture_toggle_xray(C);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
wmGesture *gesture = static_cast<wmGesture *>(op->customdata);
|
||||
View3D *v3d = CTX_wm_view3d(C);
|
||||
Object *obedit = CTX_data_edit_object(C);
|
||||
wmWindow *win = CTX_wm_window(C);
|
||||
ToolSettings *ts = static_cast<ToolSettings *>(win->scene->toolsettings);
|
||||
|
||||
if (event->type == EVT_MODAL_MAP) {
|
||||
switch (event->val) {
|
||||
|
@ -599,6 +698,9 @@ int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
break;
|
||||
}
|
||||
case EVT_ESCKEY: {
|
||||
if (ts->auto_xray_reset) {
|
||||
gesture_toggle_xray(C);
|
||||
}
|
||||
gesture_modal_end(C, op);
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
|
|
@ -416,8 +416,98 @@ void WM_operator_properties_gesture_box_ex(wmOperatorType *ot, bool deselect, bo
|
|||
{
|
||||
PropertyRNA *prop;
|
||||
|
||||
static const EnumPropertyItem auto_xray_items[] = {
|
||||
{AUTO_XRAY_DISABLE, "AUTO_XRAY_DISABLE", 0, "Disable", "No Auto X-Ray"},
|
||||
{AUTO_XRAY_OBJECT, "AUTO_XRAY_OBJECT", 0, "Object", "X-Ray during object select"},
|
||||
{AUTO_XRAY_EDIT, "AUTO_XRAY_EDIT", 0, "Mesh", "X-Ray during mesh select"},
|
||||
{AUTO_XRAY_BOTH, "AUTO_XRAY_BOTH", 0, "Both", "X-Ray during object and mesh select"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem select_through_items[] = {
|
||||
{SELECT_THROUGH_OBJECT, "SELECT_THROUGH_OBJECT", 0, "Object", "Select through objects"},
|
||||
{SELECT_THROUGH_EDIT, "SELECT_THROUGH_EDIT", 0, "Mesh", "Select through mesh"},
|
||||
{SELECT_THROUGH_BOTH, "SELECT_THROUGH_BOTH", 0, "Both", "Select through objects and mesh"},
|
||||
{SELECT_THROUGH_DISABLE, "SELECT_THROUGH_DISABLE", 0, "Disable", "No select through"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem object_select_items[] = {
|
||||
{OBJECT_TOUCH, "OBJECT_TOUCH", 0, "Touch", "Select objects that are touched by the box"},
|
||||
{OBJECT_ENCLOSE,
|
||||
"OBJECT_ENCLOSE",
|
||||
0,
|
||||
"Enclose",
|
||||
"Select objects that are fully inside the box"},
|
||||
{OBJECT_ORIGIN,
|
||||
"OBJECT_ORIGIN",
|
||||
0,
|
||||
"Origin",
|
||||
"Select objects if their origin is touched by the box"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem face_select_items[] = {
|
||||
{FACE_DEFAULT,
|
||||
"FACE_DEFAULT",
|
||||
0,
|
||||
"Default",
|
||||
"Select faces that are touched by the box in Near Select. Select faces if their center is "
|
||||
"touched by the box in X-Ray and Select Through"},
|
||||
{FACE_TOUCH, "FACE_TOUCH", 0, "Touch", "Select faces that are touched by the box"},
|
||||
{FACE_ENCLOSE, "FACE_ENCLOSE", 0, "Enclose", "Select faces that are fully inside the box"},
|
||||
{FACE_CENTER,
|
||||
"FACE_CENTER",
|
||||
0,
|
||||
"Center",
|
||||
"Select faces if their center is touched by the box"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem edge_select_items[] = {
|
||||
{EDGE_DEFAULT,
|
||||
"EDGE_DEFAULT",
|
||||
0,
|
||||
"Default",
|
||||
"Select edges that are fully inside the box. If no edges are fully inside the box, select "
|
||||
"edges that are touched by the box"},
|
||||
{EDGE_TOUCH, "EDGE_TOUCH", 0, "Touch", "Select edges that are touched by the box"},
|
||||
{EDGE_ENCLOSE, "EDGE_ENCLOSE", 0, "Enclose", "Select edges that are fully inside the box"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem backface_filter_items[] = {
|
||||
{BACKFACE_DEFAULT, "BACKFACE_DEFAULT", 0, "Default", "Select backfacing mesh"},
|
||||
{BACKFACE_NEAR,
|
||||
"NEAR",
|
||||
0,
|
||||
"Fix Near",
|
||||
"Ignore backfacing mesh when not using X-Ray or Select Through, verts don't need "
|
||||
"filtering"},
|
||||
{BACKFACE_XRAY,
|
||||
"XRAY",
|
||||
0,
|
||||
"Front X-Ray",
|
||||
"Ignore backfacing mesh in X-Ray and Select Through"},
|
||||
{BACKFACE_NONE, "NONE", 0, "No Backface", "Don't select backfacing mesh"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
WM_operator_properties_border(ot);
|
||||
|
||||
prop = RNA_def_enum(ot->srna, "auto_xray", auto_xray_items, 0, "Auto X-Ray", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "select_through", select_through_items, 0, "Select Through", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "object_type", object_select_items, 0, "Object", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "face_type", face_select_items, 0, "Face", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "edge_type", edge_select_items, 0, "Edge", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "backface_filter", backface_filter_items, 0, "Backface", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
|
||||
if (deselect) {
|
||||
prop = RNA_def_boolean(
|
||||
ot->srna, "deselect", false, "Deselect", "Deselect rather than select items");
|
||||
|
@ -521,9 +611,100 @@ void WM_operator_properties_gesture_box_zoom(wmOperatorType *ot)
|
|||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
}
|
||||
|
||||
static const EnumPropertyItem auto_xray_items[] = {
|
||||
{AUTO_XRAY_DISABLE, "AUTO_XRAY_DISABLE", 0, "Disable", "No Auto X-Ray"},
|
||||
{AUTO_XRAY_OBJECT, "AUTO_XRAY_OBJECT", 0, "Object", "X-Ray during object select"},
|
||||
{AUTO_XRAY_EDIT, "AUTO_XRAY_EDIT", 0, "Mesh", "X-Ray during mesh select"},
|
||||
{AUTO_XRAY_BOTH, "AUTO_XRAY_BOTH", 0, "Both", "X-Ray during object and mesh select"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem select_through_items[] = {
|
||||
{SELECT_THROUGH_OBJECT, "SELECT_THROUGH_OBJECT", 0, "Object", "Select through objects"},
|
||||
{SELECT_THROUGH_EDIT, "SELECT_THROUGH_EDIT", 0, "Mesh", "Select through mesh"},
|
||||
{SELECT_THROUGH_BOTH, "SELECT_THROUGH_BOTH", 0, "Both", "Select through objects and mesh"},
|
||||
{SELECT_THROUGH_DISABLE, "SELECT_THROUGH_DISABLE", 0, "Disable", "No select through"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
void WM_operator_properties_gesture_lasso(wmOperatorType *ot)
|
||||
{
|
||||
PropertyRNA *prop;
|
||||
static const EnumPropertyItem object_select_items[] = {
|
||||
{OBJECT_ORIGIN,
|
||||
"OBJECT_ORIGIN",
|
||||
0,
|
||||
"Origin",
|
||||
"Select objects if their origin is touched by the lasso"},
|
||||
{OBJECT_TOUCH, "OBJECT_TOUCH", 0, "Touch", "Select objects that are touched by the lasso"},
|
||||
{OBJECT_ENCLOSE,
|
||||
"OBJECT_ENCLOSE",
|
||||
0,
|
||||
"Enclose",
|
||||
"Select objects that are fully inside the lasso"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem face_select_items[] = {
|
||||
{FACE_DEFAULT,
|
||||
"FACE_DEFAULT",
|
||||
0,
|
||||
"Default",
|
||||
"Select faces that are touched by the lasso in Near Select. Select faces if their center "
|
||||
"is touched by the lasso in X-Ray and Select Through"},
|
||||
{FACE_TOUCH, "FACE_TOUCH", 0, "Touch", "Select faces that are touched by the lasso"},
|
||||
{FACE_ENCLOSE, "FACE_ENCLOSE", 0, "Enclose", "Select faces that are fully inside the lasso"},
|
||||
{FACE_CENTER,
|
||||
"FACE_CENTER",
|
||||
0,
|
||||
"Center",
|
||||
"Select faces if their center is touched by the lasso"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem edge_select_items[] = {
|
||||
{EDGE_DEFAULT,
|
||||
"EDGE_DEFAULT",
|
||||
0,
|
||||
"Default",
|
||||
"Select edges that are fully inside the lasso. If no edges are fully inside the lasso, "
|
||||
"select edges that are touched by the lasso"},
|
||||
{EDGE_TOUCH, "EDGE_TOUCH", 0, "Touch", "Select edges that are touched by the lasso"},
|
||||
{EDGE_ENCLOSE, "EDGE_ENCLOSE", 0, "Enclose", "Select edges that are fully inside the lasso"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem backface_filter_items[] = {
|
||||
{BACKFACE_DEFAULT, "BACKFACE_DEFAULT", 0, "Default", "Select backfacing mesh"},
|
||||
{BACKFACE_NEAR,
|
||||
"NEAR",
|
||||
0,
|
||||
"Fix Near",
|
||||
"Ignore backfacing mesh when not using X-Ray or Select Through, verts don't need "
|
||||
"filtering"},
|
||||
{BACKFACE_XRAY,
|
||||
"XRAY",
|
||||
0,
|
||||
"Front X-Ray",
|
||||
"Ignore backfacing mesh in X-Ray and Select Through"},
|
||||
{BACKFACE_NONE, "NONE", 0, "No Backface", "Don't select backfacing mesh"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
WM_operator_properties_border(ot);
|
||||
|
||||
prop = RNA_def_enum(ot->srna, "auto_xray", auto_xray_items, 0, "Auto X-Ray", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "select_through", select_through_items, 0, "Select Through", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "object_type", object_select_items, 0, "Object", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "face_type", face_select_items, 0, "Face", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "edge_type", edge_select_items, 0, "Edge", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "backface_filter", backface_filter_items, 0, "Backface", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_collection_runtime(ot->srna, "path", &RNA_OperatorMousePath, "Path", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
}
|
||||
|
@ -562,6 +743,85 @@ void WM_operator_properties_gesture_circle(wmOperatorType *ot)
|
|||
PropertyRNA *prop;
|
||||
const int radius_default = 25;
|
||||
|
||||
static const EnumPropertyItem auto_xray_items[] = {
|
||||
{AUTO_XRAY_DISABLE, "AUTO_XRAY_DISABLE", 0, "Disable", "No Auto X-Ray"},
|
||||
{AUTO_XRAY_OBJECT, "AUTO_XRAY_OBJECT", 0, "Object", "X-Ray during object select"},
|
||||
{AUTO_XRAY_EDIT, "AUTO_XRAY_EDIT", 0, "Mesh", "X-Ray during mesh select"},
|
||||
{AUTO_XRAY_BOTH, "AUTO_XRAY_BOTH", 0, "Both", "X-Ray during object and mesh select"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem select_through_items[] = {
|
||||
{SELECT_THROUGH_OBJECT, "SELECT_THROUGH_OBJECT", 0, "Object", "Select through objects"},
|
||||
{SELECT_THROUGH_EDIT, "SELECT_THROUGH_EDIT", 0, "Mesh", "Select through mesh"},
|
||||
{SELECT_THROUGH_BOTH, "SELECT_THROUGH_BOTH", 0, "Both", "Select through objects and mesh"},
|
||||
{SELECT_THROUGH_DISABLE, "SELECT_THROUGH_DISABLE", 0, "Disable", "No select through"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem object_select_items[] = {
|
||||
{OBJECT_ORIGIN,
|
||||
"OBJECT_ORIGIN",
|
||||
0,
|
||||
"Origin",
|
||||
"Select objects if their origin is touched by the circle"},
|
||||
{OBJECT_TOUCH, "OBJECT_TOUCH", 0, "Touch", "Select objects that are touched by the circle"},
|
||||
{OBJECT_ENCLOSE,
|
||||
"OBJECT_ENCLOSE",
|
||||
0,
|
||||
"Enclose",
|
||||
"Select objects that are fully inside the circle"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem face_select_items[] = {
|
||||
{FACE_DEFAULT,
|
||||
"FACE_DEFAULT",
|
||||
0,
|
||||
"Default",
|
||||
"Select faces that are touched by the circle in Near Select. Select faces if their center "
|
||||
"is touched by the circle in X-Ray and Select Through"},
|
||||
{FACE_TOUCH, "FACE_TOUCH", 0, "Touch", "Select faces that are touched by the circle"},
|
||||
{FACE_ENCLOSE,
|
||||
"FACE_ENCLOSE",
|
||||
0,
|
||||
"Enclose",
|
||||
"Select faces that are fully inside the circle"},
|
||||
{FACE_CENTER,
|
||||
"FACE_CENTER",
|
||||
0,
|
||||
"Center",
|
||||
"Select faces if their center is touched by the circle"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem edge_select_items[] = {
|
||||
{EDGE_TOUCH, "EDGE_TOUCH", 0, "Touch", "Select edges that are touched by the circle"},
|
||||
{EDGE_ENCLOSE,
|
||||
"EDGE_ENCLOSE",
|
||||
0,
|
||||
"Enclose",
|
||||
"Select edges that are fully inside the circle"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
static const EnumPropertyItem backface_filter_items[] = {
|
||||
{BACKFACE_DEFAULT, "BACKFACE_DEFAULT", 0, "Default", "Select backfacing mesh"},
|
||||
{BACKFACE_NEAR,
|
||||
"NEAR",
|
||||
0,
|
||||
"Fix Near",
|
||||
"Ignore backfacing mesh when not using X-Ray or Select Through, verts don't need "
|
||||
"filtering"},
|
||||
{BACKFACE_XRAY,
|
||||
"XRAY",
|
||||
0,
|
||||
"Front X-Ray",
|
||||
"Ignore backfacing mesh in X-Ray and Select Through"},
|
||||
{BACKFACE_NONE, "NONE", 0, "No Backface", "Don't select backfacing mesh"},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
prop = RNA_def_int(ot->srna, "x", 0, INT_MIN, INT_MAX, "X", "", INT_MIN, INT_MAX);
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_int(ot->srna, "y", 0, INT_MIN, INT_MAX, "Y", "", INT_MIN, INT_MAX);
|
||||
|
@ -570,6 +830,19 @@ void WM_operator_properties_gesture_circle(wmOperatorType *ot)
|
|||
|
||||
prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
|
||||
prop = RNA_def_enum(ot->srna, "auto_xray", auto_xray_items, 0, "Auto X-Ray", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "select_through", select_through_items, 0, "Select Through", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "object_type", object_select_items, 0, "Object", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "face_type", face_select_items, 0, "Face", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "edge_type", edge_select_items, 0, "Edge", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_enum(ot->srna, "backface_filter", backface_filter_items, 0, "Backface", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
}
|
||||
|
||||
void WM_operator_properties_mouse_select(wmOperatorType *ot)
|
||||
|
|
Loading…
Reference in New Issue