Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_snap.c
| Show First 20 Lines • Show All 224 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| /* *************************************************** */ | /* *************************************************** */ | ||||
| /** Snaps the selection as a whole (use_offset=true) or each selected object to the given location. | /** Snaps the selection as a whole (use_offset=true) or each selected object to the given location. | ||||
| * | * | ||||
| * \param snap_target_global: a location in global space to snap to (eg. 3D cursor or active object). | * \param snap_target_global: a location in global space to snap to (eg. 3D cursor or active object). | ||||
| * \param use_offset: if the selected objects should maintain their relative offsets and be snapped by the selection | * \param use_offset: if the selected objects should maintain their relative offsets and be snapped by the selection | ||||
| * pivot point (median, active), or if every object origin should be snapped to the given location. | * pivot point (mean, active), or if every object origin should be snapped to the given location. | ||||
| **/ | **/ | ||||
| static int snap_selected_to_location(bContext *C, const float snap_target_global[3], const bool use_offset) | static int snap_selected_to_location(bContext *C, const float snap_target_global[3], const bool use_offset) | ||||
| { | { | ||||
| Depsgraph *depsgraph = CTX_data_depsgraph(C); | Depsgraph *depsgraph = CTX_data_depsgraph(C); | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| Object *obact = CTX_data_active_object(C); | Object *obact = CTX_data_active_object(C); | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| ▲ Show 20 Lines • Show All 634 Lines • Show Last 20 Lines | |||||