|
Blender V4.3
|
#include "MEM_guardedalloc.h"#include "DNA_armature_types.h"#include "DNA_object_types.h"#include "BLI_bounds.hh"#include "BLI_math_matrix.h"#include "BLI_math_matrix.hh"#include "BLI_math_vector.h"#include "BLI_math_vector.hh"#include "BLI_utildefines.h"#include "BLI_vector.hh"#include "BKE_action.hh"#include "BKE_armature.hh"#include "BKE_context.hh"#include "BKE_crazyspace.hh"#include "BKE_editmesh.hh"#include "BKE_layer.hh"#include "BKE_main.hh"#include "BKE_mball.hh"#include "BKE_object.hh"#include "BKE_report.hh"#include "BKE_scene.hh"#include "BKE_tracking.h"#include "DEG_depsgraph.hh"#include "DEG_depsgraph_query.hh"#include "WM_api.hh"#include "WM_types.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "ED_anim_api.hh"#include "ED_curves.hh"#include "ED_grease_pencil.hh"#include "ED_keyframing.hh"#include "ED_object.hh"#include "ED_screen.hh"#include "ED_transverts.hh"#include "ANIM_action.hh"#include "ANIM_bone_collections.hh"#include "ANIM_keyframing.hh"#include "view3d_intern.hh"Go to the source code of this file.
|
static |
Definition at line 999 of file view3d_snap.cc.
References init(), and blender::math::transform_point().
Referenced by ED_view3d_minmax_verts().
Returns the center position of a tracking marker visible on the viewport (useful to snap to).
Definition at line 729 of file view3d_snap.cc.
References BKE_object_movieclip_get(), BKE_tracking_camera_get_reconstructed_interpolate(), BKE_tracking_get_camera_object_matrix(), copy_m4_m4(), INIT_MINMAX, invert_m4(), LISTBASE_FOREACH, mid_v3_v3v3(), min, minmax_v3v3_v3(), mul_m4_m4m4(), mul_v3_m4v3(), pos, TRACK_HAS_BUNDLE, TRACK_SELECTED, and TRACKING_OBJECT_CAMERA.
Referenced by snap_curs_to_sel_ex().
Calculates the bounding box corners (min and max) for obedit. The returned values are in global space.
Definition at line 1021 of file view3d_snap.cc.
References add_v3_v3(), BKE_mball_minmax_ex(), bounds_min_max_with_transform(), copy_m3_m4(), copy_v3_v3(), Object::data, DEG_get_original_object(), ED_transverts_check_obedit(), ED_transverts_create_from_obedit(), ED_transverts_free(), TransVert::flag, Curves::geometry, TransVert::loc, TransVert::maploc, minmax_v3v3_v3(), mul_m3_v3(), OB_CURVES, OB_GREASE_PENCIL, OB_MBALL, SELECT, TM_ALL_JOINTS, TM_CALC_MAPLOC, TransVertStore::transverts, TransVertStore::transverts_tot, TX_VERT_USE_MAPLOC, and Object::type.
Referenced by viewselected_exec().
| bool ED_view3d_snap_selected_to_location | ( | bContext * | C, |
| wmOperator * | op, | ||
| const float | snap_target_global[3], | ||
| const int | pivot_point ) |
Definition at line 582 of file view3d_snap.cc.
References snap_selected_to_location().
Referenced by blender::ed::object::object_transform_to_mouse_exec().
|
static |
Calculates the center position of the active object in global space.
NOTE: this could be exported to be a generic function. see: calculateCenterActive
Definition at line 922 of file view3d_snap.cc.
References blender::ed::object::calc_active_center(), and CTX_data_active_object().
Referenced by snap_curs_to_active_exec(), snap_selected_to_active_exec(), and snap_selected_to_location().
|
static |
Definition at line 931 of file view3d_snap.cc.
References CTX_data_scene(), DEG_id_tag_update(), ID_RECALC_SYNC_TO_EVAL, NC_SPACE, ND_SPACE_VIEW3D, OPERATOR_CANCELLED, OPERATOR_FINISHED, snap_calc_active_center(), and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_active().
|
static |
Snaps the 3D cursor location to the origin and clears cursor rotation.
Definition at line 966 of file view3d_snap.cc.
References CTX_data_scene(), DEG_id_tag_update(), ID_RECALC_SYNC_TO_EVAL, blender::MatBase< float, 4, 4 >::identity(), NC_SPACE, ND_SPACE_VIEW3D, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_center().
|
static |
Snaps the 3D cursor location to its nearest point on the grid.
Definition at line 684 of file view3d_snap.cc.
References CTX_data_scene(), CTX_wm_region(), CTX_wm_view3d(), DEG_id_tag_update(), ED_view3d_grid_view_scale(), floorf, ID_RECALC_SYNC_TO_EVAL, NC_SPACE, ND_SPACE_VIEW3D, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_grid().
Snaps the 3D cursor location to the median point of the selection.
Definition at line 778 of file view3d_snap.cc.
References add_v3_v3(), ANIM_bonecoll_is_visible_pchan(), BKE_editmesh_from_object(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BMEditMesh::bm, BONE_SELECTED, bundle_midpoint(), bPose::chanbase, copy_m3_m4(), copy_v3_v3(), count, CTX_data_active_object(), CTX_data_edit_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), Object::data, DEG_get_evaluated_object(), DEG_get_evaluated_view_layer(), DEG_get_original_object(), depsgraph, ED_transverts_check_obedit(), ED_transverts_create_from_obedit(), ED_transverts_free(), View3D::flag2, FOREACH_SELECTED_OBJECT_BEGIN, FOREACH_SELECTED_OBJECT_END, INIT_MINMAX, LISTBASE_FOREACH, TransVert::loc, mid_v3_v3v3(), min, minmax_v3v3_v3(), Object::mode, mul_m3_v3(), mul_m4_v3(), mul_v3_fl(), OB_CAMERA, OB_MESH, OB_MODE_POSE, Object::pose, TM_ALL_JOINTS, TM_SKIP_HANDLES, BMesh::totvertsel, TransVertStore::transverts, TransVertStore::transverts_tot, Object::type, V3D_AROUND_CENTER_BOUNDS, V3D_SHOW_RECONSTRUCTION, and zero_v3().
Referenced by snap_curs_to_sel_exec(), and snap_selected_to_location().
|
static |
Definition at line 882 of file view3d_snap.cc.
References CTX_data_scene(), DEG_id_tag_update(), ID_RECALC_SYNC_TO_EVAL, NC_SPACE, ND_SPACE_VIEW3D, OPERATOR_CANCELLED, OPERATOR_FINISHED, snap_curs_to_sel_ex(), and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_selected().
|
static |
Snaps every individual object center to its nearest point on the grid.
Definition at line 68 of file view3d_snap.cc.
References add_v3_v3(), ANIM_bonecoll_is_visible_pchan(), ANIM_deselect_keys_in_animation_editors(), ANIM_get_keyingset_for_autokeying(), ANIM_KS_LOCATION_ID, blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::animrig::autokeyframe_object(), blender::animrig::autokeyframe_pchan(), BKE_armature_loc_pose_to_bone(), BKE_editmesh_from_object(), BKE_object_pose_array_get(), BKE_object_where_is_calc_ex(), BKE_pose_channel_find_name(), BKE_scene_graph_evaluated_ensure(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BMEditMesh::bm, BONE_CONNECTED, BONE_SELECTED, copy_m3_m4(), copy_v3_v3(), CTX_data_active_object(), CTX_data_ensure_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_region(), CTX_wm_view3d(), DEG_get_evaluated_view_layer(), DEG_get_original_object(), DEG_id_tag_update(), depsgraph, ED_transverts_check_obedit(), ED_transverts_create_from_obedit(), ED_transverts_free(), ED_transverts_update_obedit(), ED_view3d_grid_view_scale(), bPose::flag, floorf, FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN, FOREACH_SELECTED_EDITABLE_OBJECT_END, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, invert_m3_m3(), invert_m4_m4(), blender::animrig::is_autokey_on(), LISTBASE_FOREACH, bPoseChannel::loc, Object::loc, TransVert::loc, mul_m3_v3(), mul_m4_v3(), NC_OBJECT, ND_TRANSFORM, OB_LOCK_LOCX, OB_LOCK_LOCY, OB_LOCK_LOCZ, OB_MESH, OBEDIT_FROM_OBACT, OBPOSE_FROM_OBACT, OPERATOR_FINISHED, Object::parent, Object::pose, POSE_DO_UNLOCK, POSE_LOCKED, bPoseChannel::protectflag, Object::protectflag, wmOperator::reports, SCE_XFORM_DATA_ORIGIN, SCE_XFORM_SKIP_CHILDREN, blender::ed::object::shape_key_report_if_locked(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), sub_v3_v3(), BMesh::totvertsel, TransVertStore::transverts, TransVertStore::transverts_tot, and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_selected_to_grid().
|
static |
Snaps each selected object to the location of the active selected object.
Definition at line 647 of file view3d_snap.cc.
References BKE_report(), OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, snap_calc_active_center(), and snap_selected_to_location().
Referenced by VIEW3D_OT_snap_selected_to_active().
|
static |
Definition at line 603 of file view3d_snap.cc.
References CTX_data_scene(), OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), and snap_selected_to_location().
Referenced by VIEW3D_OT_snap_selected_to_cursor().
|
static |
Snaps the selection as a whole (use_offset=true) or each selected object to the given location.
| snap_target_global | a location in global space to snap to (eg. 3D cursor or active object). |
| 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. |
Definition at line 307 of file view3d_snap.cc.
References add_v3_v3(), add_v3_v3v3(), ANIM_deselect_keys_in_animation_editors(), ANIM_get_keyingset_for_autokeying(), ANIM_KS_LOCATION_ID, blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::animrig::autokeyframe_object(), blender::animrig::autokeyframe_pchan(), BKE_armature_bone_flag_test_recursive(), BKE_armature_loc_pose_to_bone(), BKE_editmesh_from_object(), BKE_object_flag_test_recursive(), BKE_object_get_parent_matrix(), BKE_object_pose_array_get(), BKE_scene_graph_evaluated_ensure(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BMEditMesh::bm, BONE_CONNECTED, BONE_SELECTED, BONE_TRANSFORM, copy_m3_m4(), copy_v3_v3(), CTX_data_active_object(), CTX_data_depsgraph_pointer(), CTX_data_edit_object(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_get_evaluated_object(), DEG_id_tag_update(), depsgraph, ED_transverts_check_obedit(), ED_transverts_create_from_obedit(), ED_transverts_free(), ED_transverts_update_obedit(), ListBase::first, FOREACH_SELECTED_EDITABLE_OBJECT_BEGIN, FOREACH_SELECTED_EDITABLE_OBJECT_END, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, invert_m3_m3(), invert_m4_m4(), blender::animrig::is_autokey_on(), LISTBASE_FOREACH, TransVert::loc, mul_m3_m4m4(), mul_m3_v3(), mul_m4_v3(), mul_v3_m3v3(), mul_v3_m4v3(), NC_OBJECT, ND_TRANSFORM, OB_DONE, OB_LOCK_LOCX, OB_LOCK_LOCY, OB_LOCK_LOCZ, OB_MESH, Main::objects, OBPOSE_FROM_OBACT, Object::parent, PBONE_VISIBLE, POSE_DO_UNLOCK, POSE_LOCKED, wmOperator::reports, SCE_XFORM_DATA_ORIGIN, SCE_XFORM_SKIP_CHILDREN, blender::ed::object::shape_key_report_if_locked(), snap_calc_active_center(), snap_curs_to_sel_ex(), sub_v3_v3(), sub_v3_v3v3(), BMesh::totvertsel, TransVertStore::transverts, TransVertStore::transverts_tot, Object::type, V3D_AROUND_ACTIVE, and WM_event_add_notifier().
Referenced by ED_view3d_snap_selected_to_location(), snap_selected_to_active_exec(), and snap_selected_to_cursor_exec().
| void VIEW3D_OT_snap_cursor_to_active | ( | wmOperatorType * | ot | ) |
Definition at line 944 of file view3d_snap.cc.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and snap_curs_to_active_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_cursor_to_center | ( | wmOperatorType * | ot | ) |
Definition at line 978 of file view3d_snap.cc.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and snap_curs_to_center_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_cursor_to_grid | ( | wmOperatorType * | ot | ) |
Definition at line 704 of file view3d_snap.cc.
References wmOperatorType::description, ED_operator_region_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and snap_curs_to_grid_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_cursor_to_selected | ( | wmOperatorType * | ot | ) |
Definition at line 895 of file view3d_snap.cc.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and snap_curs_to_sel_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_selected_to_active | ( | wmOperatorType * | ot | ) |
Definition at line 662 of file view3d_snap.cc.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and snap_selected_to_active_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_selected_to_cursor | ( | wmOperatorType * | ot | ) |
Definition at line 618 of file view3d_snap.cc.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), snap_selected_to_cursor_exec(), and wmOperatorType::srna.
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_selected_to_grid | ( | wmOperatorType * | ot | ) |
Definition at line 277 of file view3d_snap.cc.
References wmOperatorType::description, ED_operator_region_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, and snap_sel_to_grid_exec().
Referenced by view3d_operatortypes().