Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_snap.c
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_mball.h" | #include "BKE_mball.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_tracking.h" | #include "BKE_tracking.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_query.h" | |||||
| #include "WM_api.h" | #include "WM_api.h" | ||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| #include "RNA_access.h" | #include "RNA_access.h" | ||||
| #include "RNA_define.h" | #include "RNA_define.h" | ||||
| #include "ED_object.h" | #include "ED_object.h" | ||||
| ▲ Show 20 Lines • Show All 717 Lines • ▼ Show 20 Lines | |||||
| static int snap_curs_to_center_exec(bContext *C, wmOperator *UNUSED(op)) | static int snap_curs_to_center_exec(bContext *C, wmOperator *UNUSED(op)) | ||||
| { | { | ||||
| Scene *scene = CTX_data_scene(C); | Scene *scene = CTX_data_scene(C); | ||||
| View3D *v3d = CTX_wm_view3d(C); | View3D *v3d = CTX_wm_view3d(C); | ||||
| float *curs; | float *curs; | ||||
| curs = ED_view3d_cursor3d_get(scene, v3d)->location; | curs = ED_view3d_cursor3d_get(scene, v3d)->location; | ||||
| zero_v3(curs); | zero_v3(curs); | ||||
| WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); | WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); | ||||
| DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE); | |||||
| return OPERATOR_FINISHED; | return OPERATOR_FINISHED; | ||||
| } | } | ||||
| void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot) | void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Snap Cursor to Center"; | ot->name = "Snap Cursor to Center"; | ||||
| ot->description = "Snap cursor to the Center"; | ot->description = "Snap cursor to the Center"; | ||||
| ▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines | |||||