WIP: Shift Extrude and Duplicate of meshes and objects #118968

Draft
Kyler Kelly-Tan wants to merge 20 commits from kylerk/blender:ShiftExtrude into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
1 changed files with 0 additions and 35 deletions
Showing only changes of commit fb12733803 - Show all commits

View File

@ -2268,42 +2268,7 @@ static void WIDGETGROUP_gizmo_invoke_prepare(const bContext *C,
}
}
/* Support shift click to constrain axis. */
int axis = -1;
switch (axis_idx) {
case MAN_AXIS_TRANS_X:
case MAN_AXIS_TRANS_Y:
case MAN_AXIS_TRANS_Z:
axis = axis_idx - MAN_AXIS_TRANS_X;
break;
case MAN_AXIS_SCALE_X:
case MAN_AXIS_SCALE_Y:
case MAN_AXIS_SCALE_Z:
axis = axis_idx - MAN_AXIS_SCALE_X;
break;
}
if (axis != -1) {
/* Swap single axis for two-axis constraint. */
const bool flip = (event->modifier & KM_SHIFT) != 0;
BLI_assert(axis_idx != -1);
const short axis_type = gizmo_get_axis_type(axis_idx);
if (axis_type != MAN_AXES_ROTATE) {
wmGizmoOpElem *gzop = WM_gizmo_operator_get(gz, 0);
PointerRNA *ptr = &gzop->ptr;
PropertyRNA *prop_constraint_axis = RNA_struct_find_property(ptr, "constraint_axis");
if (prop_constraint_axis) {
bool constraint[3] = {false};
constraint[axis] = true;
if (flip) {
for (int i = 0; i < ARRAY_SIZE(constraint); i++) {
constraint[i] = !constraint[i];
}
}
RNA_property_boolean_set_array(ptr, prop_constraint_axis, constraint);
}
}
}
}
static bool WIDGETGROUP_gizmo_poll_generic(View3D *v3d)