Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_snap.c
| Show First 20 Lines • Show All 594 Lines • ▼ Show 20 Lines | static int snap_selected_to_cursor_exec(bContext *C, wmOperator *op) | ||||
| const bool use_offset = RNA_boolean_get(op->ptr, "use_offset"); | const bool use_offset = RNA_boolean_get(op->ptr, "use_offset"); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| const float *snap_target_global = scene->cursor.location; | const float *snap_target_global = scene->cursor.location; | ||||
| const int pivot_point = scene->toolsettings->transform_pivot_point; | const int pivot_point = scene->toolsettings->transform_pivot_point; | ||||
| if (snap_selected_to_location(C, snap_target_global, use_offset, pivot_point, true)) { | if (snap_selected_to_location(C, snap_target_global, use_offset, pivot_point, true)) { | ||||
| return OPERATOR_CANCELLED; | |||||
| } | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| return OPERATOR_CANCELLED; | |||||
| } | |||||
| void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot) | void VIEW3D_OT_snap_selected_to_cursor(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Snap Selection to Cursor"; | ot->name = "Snap Selection to Cursor"; | ||||
| ot->description = "Snap selected item(s) to the 3D cursor"; | ot->description = "Snap selected item(s) to the 3D cursor"; | ||||
| ot->idname = "VIEW3D_OT_snap_selected_to_cursor"; | ot->idname = "VIEW3D_OT_snap_selected_to_cursor"; | ||||
| ▲ Show 20 Lines • Show All 429 Lines • Show Last 20 Lines | |||||