Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_edit.c
| Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_utildefines.h" | #include "BLI_utildefines.h" | ||||
| #include "BKE_armature.h" | #include "BKE_armature.h" | ||||
| #include "BKE_camera.h" | #include "BKE_camera.h" | ||||
| #include "BKE_context.h" | #include "BKE_context.h" | ||||
| #include "BKE_font.h" | #include "BKE_font.h" | ||||
| #include "BKE_library.h" | #include "BKE_library.h" | ||||
| #include "BKE_localview.h" | |||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| #include "BKE_paint.h" | #include "BKE_paint.h" | ||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "BKE_scene.h" | #include "BKE_scene.h" | ||||
| #include "BKE_screen.h" | #include "BKE_screen.h" | ||||
| #include "BKE_action.h" | #include "BKE_action.h" | ||||
| #include "BKE_depsgraph.h" /* for ED_view3d_camera_lock_sync */ | #include "BKE_depsgraph.h" /* for ED_view3d_camera_lock_sync */ | ||||
| ▲ Show 20 Lines • Show All 4,667 Lines • ▼ Show 20 Lines | if (v3d->ob_centre_cursor) { | ||||
| if ((ED_view3d_project_float_global(ar, fp_prev, co_prev, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) && | if ((ED_view3d_project_float_global(ar, fp_prev, co_prev, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) && | ||||
| (ED_view3d_project_float_global(ar, fp_curr, co_curr, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK)) | (ED_view3d_project_float_global(ar, fp_curr, co_curr, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK)) | ||||
| { | { | ||||
| rv3d->ofs_lock[0] += (co_curr[0] - co_prev[0]) / (ar->winx * 0.5f); | rv3d->ofs_lock[0] += (co_curr[0] - co_prev[0]) / (ar->winx * 0.5f); | ||||
| rv3d->ofs_lock[1] += (co_curr[1] - co_prev[1]) / (ar->winy * 0.5f); | rv3d->ofs_lock[1] += (co_curr[1] - co_prev[1]) / (ar->winy * 0.5f); | ||||
| } | } | ||||
| } | } | ||||
| if (v3d->localvd) | if (v3d->localviewd) | ||||
| WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); | WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d); | ||||
| else | else | ||||
| WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene); | WM_event_add_notifier(C, NC_SCENE | NA_EDITED, scene); | ||||
| } | } | ||||
| static int view3d_cursor3d_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) | static int view3d_cursor3d_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event) | ||||
| { | { | ||||
| ED_view3d_cursor3d_update(C, event->mval); | ED_view3d_cursor3d_update(C, event->mval); | ||||
| ▲ Show 20 Lines • Show All 503 Lines • Show Last 20 Lines | |||||