|
Blender V5.0
|
#include "DNA_armature_types.h"#include "DNA_object_types.h"#include "DNA_pointcloud_types.h"#include "BLI_bounds.hh"#include "BLI_listbase.h"#include "BLI_math_matrix.h"#include "BLI_math_matrix.hh"#include "BLI_math_rotation.h"#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_pointcloud.hh"#include "ED_screen.hh"#include "ED_transverts.hh"#include "ANIM_action.hh"#include "ANIM_armature.hh"#include "ANIM_bone_collections.hh"#include "ANIM_keyframing.hh"#include "ANIM_keyingsets.hh"#include "view3d_intern.hh"Go to the source code of this file.
|
static |
Definition at line 1126 of file view3d_snap.cc.
References init(), mask(), blender::threading::parallel_reduce(), transform(), 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 855 of file view3d_snap.cc.
References BKE_object_movieclip_get(), BKE_tracking_camera_get_reconstructed_interpolate(), BKE_tracking_get_camera_object_matrix(), RenderData::cfra, copy_m4_m4(), INIT_MINMAX, invert_m4(), LISTBASE_FOREACH, max, mid_v3_v3v3(), min, minmax_v3v3_v3(), mul_m4_m4m4(), mul_v3_m4v3(), MovieTracking::objects, pos, Scene::r, TRACK_HAS_BUNDLE, TRACK_SELECTED, MovieClip::tracking, 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 1148 of file view3d_snap.cc.
References add_v3_v3(), BKE_mball_minmax_ex(), bounds(), bounds_min_max_with_transform(), copy_m3_m4(), copy_v3_v3(), Object::data, DEG_get_original(), ED_transverts_check_obedit(), ED_transverts_create_from_obedit(), ED_transverts_free(), TransVert::flag, Curves::geometry, blender::bke::crazyspace::get_evaluated_curves_deformation(), blender::bke::crazyspace::get_evaluated_grease_pencil_drawing_deformation(), IndexMask::is_empty(), TransVert::loc, TransVert::maploc, mask(), blender::bounds::merge(), minmax_v3v3_v3(), mul_m3_v3(), OB_CURVES, OB_GREASE_PENCIL, OB_MBALL, OB_POINTCLOUD, blender::bke::crazyspace::GeometryDeformation::positions, blender::ed::greasepencil::retrieve_editable_and_selected_points(), blender::ed::greasepencil::retrieve_editable_drawings(), blender::ed::curves::retrieve_selected_points(), blender::ed::pointcloud::retrieve_selected_points(), SELECT, TM_ALL_JOINTS, TM_CALC_MAPLOC, blender::bke::greasepencil::Layer::to_world_space(), TransVertStore::transverts, TransVertStore::transverts_tot, TX_VERT_USE_MAPLOC, and Object::type.
Referenced by view3d_calc_minmax_selected().
| bool ED_view3d_snap_selected_to_location | ( | bContext * | C, |
| wmOperator * | op, | ||
| const float | target_loc_global[3], | ||
| const int | pivot_point ) |
Definition at line 699 of file view3d_snap.cc.
References C, and snap_selected_to_location_rotation().
Referenced by blender::ed::object::object_transform_to_mouse_exec().
|
static |
Definition at line 289 of file view3d_snap.cc.
References bPoseChannel_Runtime::flag, flag, bPoseChannel::parent, pose_bone_runtime_flag_test_recursive(), and bPoseChannel::runtime.
Referenced by pose_bone_runtime_flag_test_recursive(), and snap_selected_to_location_rotation().
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 1049 of file view3d_snap.cc.
References C, 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_rotation().
|
static |
Definition at line 1058 of file view3d_snap.cc.
References C, CTX_data_scene(), Scene::cursor, DEG_id_tag_update(), Scene::id, ID_RECALC_SYNC_TO_EVAL, View3DCursor::location, 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 1093 of file view3d_snap.cc.
References C, CTX_data_scene(), Scene::cursor, DEG_id_tag_update(), Scene::id, 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 810 of file view3d_snap.cc.
References C, CTX_data_scene(), CTX_wm_region(), CTX_wm_view3d(), Scene::cursor, DEG_id_tag_update(), ED_view3d_grid_view_scale(), floorf, Scene::id, ID_RECALC_SYNC_TO_EVAL, View3DCursor::location, 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 904 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, bundle_midpoint(), C, 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(), DEG_get_evaluated_view_layer(), DEG_get_original(), depsgraph, ED_transverts_check_obedit(), ED_transverts_create_from_obedit(), ED_transverts_free(), View3D::flag2, FOREACH_SELECTED_OBJECT_BEGIN, FOREACH_SELECTED_OBJECT_END, i, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), INIT_MINMAX, LISTBASE_FOREACH, TransVert::loc, max, 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, POSE_SELECTED, 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_rotation().
|
static |
Definition at line 1009 of file view3d_snap.cc.
References C, CTX_data_scene(), Scene::cursor, DEG_id_tag_update(), Scene::id, ID_RECALC_SYNC_TO_EVAL, View3DCursor::location, NC_SPACE, ND_SPACE_VIEW3D, OPERATOR_CANCELLED, OPERATOR_FINISHED, snap_curs_to_sel_ex(), Scene::toolsettings, ToolSettings::transform_pivot_point, 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 72 of file view3d_snap.cc.
References add_v3_v3(), ANIM_bonecoll_is_visible_pchan(), ANIM_deselect_keys_in_animation_editors(), ANIM_KS_LOCATION_ID, blender::Vector< T, InlineBufferCapacity, Allocator >::append(), blender::Vector< T, InlineBufferCapacity, Allocator >::append_unchecked(), 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_protected_location_set(), BKE_object_where_is_calc_ex(), BKE_pchan_protected_location_set(), 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, C, 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(), blender::Vector< T, InlineBufferCapacity, Allocator >::data(), blender::ed::object::data_xform_container_create(), blender::ed::object::data_xform_container_destroy(), blender::ed::object::data_xform_container_item_ensure(), blender::ed::object::data_xform_container_update_all(), DEG_get_evaluated_view_layer(), DEG_get_original(), 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, blender::animrig::get_keyingset_for_autokeying(), Object::id, ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, invert_m3_m3(), invert_m4_m4(), blender::animrig::is_autokey_on(), LISTBASE_FOREACH, TransVert::loc, mul_m3_v3(), mul_m4_v3(), NC_OBJECT, ND_TRANSFORM, OB_MESH, OBEDIT_FROM_OBACT, blender::ed::object::object_xform_skip_child_container_destroy(), blender::ed::object::object_xform_skip_child_container_update_all(), OBPOSE_FROM_OBACT, OPERATOR_FINISHED, Object::parent, Object::pose, POSE_DO_UNLOCK, POSE_LOCKED, POSE_SELECTED, 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(), Scene::toolsettings, BMesh::totvertsel, ToolSettings::transform_flag, TransVertStore::transverts, TransVertStore::transverts_tot, WM_event_add_notifier(), blender::ed::object::xform_skip_child_container_create(), and blender::ed::object::xform_skip_child_container_item_ensure_from_array().
Referenced by VIEW3D_OT_snap_selected_to_grid().
|
static |
Snaps each selected object to the location of the active selected object.
Definition at line 773 of file view3d_snap.cc.
References BKE_report(), C, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::reports, RPT_ERROR, snap_calc_active_center(), and snap_selected_to_location_rotation().
Referenced by VIEW3D_OT_snap_selected_to_active().
|
static |
Definition at line 720 of file view3d_snap.cc.
References C, CTX_data_scene(), Scene::cursor, View3DCursor::location, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_boolean_get(), snap_selected_to_location_rotation(), Scene::toolsettings, and ToolSettings::transform_pivot_point.
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.
| target_loc_global | a location in global space to snap to (eg. 3D cursor or active object). |
| target_orientation_global | a 3d cursor which will provides rotation. When non-null objects are rotated to match the rotation of the 3d cursor, otherwise, keep their original rotation. Note that a more generic orientation parameter could be supported in future, but for now, only the 3d cursor is used. |
| 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 314 of file view3d_snap.cc.
References add_v3_v3(), add_v3_v3v3(), ANIM_deselect_keys_in_animation_editors(), 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_flag_test_recursive(), BKE_object_get_parent_matrix(), BKE_object_pose_array_get(), BKE_object_protected_location_set(), BKE_object_protected_rotation_axisangle_set(), BKE_object_protected_rotation_euler_set(), BKE_object_protected_rotation_quaternion_set(), BKE_pchan_mat3_to_rot(), BKE_pchan_protected_location_set(), BKE_pchan_protected_rotation_axisangle_set(), BKE_pchan_protected_rotation_euler_set(), BKE_pchan_protected_rotation_quaternion_set(), BKE_scene_graph_evaluated_ensure(), BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BMEditMesh::bm, BONE_CONNECTED, blender::animrig::bone_is_visible(), C, copy_m3_m4(), copy_v3_v3(), copy_v4_v4(), 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(), blender::Vector< T, InlineBufferCapacity, Allocator >::data(), blender::ed::object::data_xform_container_create(), blender::ed::object::data_xform_container_destroy(), blender::ed::object::data_xform_container_item_ensure(), blender::ed::object::data_xform_container_update_all(), DEG_get_evaluated(), 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, blender::animrig::get_keyingset_for_autokeying(), ID_RECALC_GEOMETRY, ID_RECALC_TRANSFORM, blender::Vector< T, InlineBufferCapacity, Allocator >::index_range(), invert_m3_m3(), invert_m4_m4(), blender::animrig::is_autokey_on(), LISTBASE_FOREACH, TransVert::loc, mat3_normalized_to_quat(), mat3_to_axis_angle(), mat3_to_eulO(), mul_m3_m3m3(), mul_m3_m4m4(), mul_m3_v3(), mul_m4_v3(), mul_v3_m3v3(), mul_v3_m4v3(), NC_OBJECT, ND_TRANSFORM, OB_DONE, OB_MESH, blender::ed::object::object_xform_skip_child_container_destroy(), blender::ed::object::object_xform_skip_child_container_update_all(), Main::objects, OBPOSE_FROM_OBACT, Object::parent, pose_bone_runtime_flag_test_recursive(), POSE_DO_UNLOCK, POSE_LOCKED, POSE_RUNTIME_TRANSFORM, POSE_SELECTED, blender::MatBase< T, NumCol, NumRow, Alignment >::ptr(), wmOperator::reports, ROT_MODE_AXISANGLE, ROT_MODE_QUAT, View3DCursor::rotation_angle, View3DCursor::rotation_axis, View3DCursor::rotation_euler, View3DCursor::rotation_mode, View3DCursor::rotation_quaternion, SCE_XFORM_DATA_ORIGIN, SCE_XFORM_SKIP_CHILDREN, blender::ed::object::shape_key_report_if_locked(), blender::Vector< T, InlineBufferCapacity, Allocator >::size(), snap_calc_active_center(), snap_curs_to_sel_ex(), sub_v3_v3(), sub_v3_v3v3(), Scene::toolsettings, BMesh::totvertsel, ToolSettings::transform_flag, TransVertStore::transverts, TransVertStore::transverts_tot, Object::type, V3D_AROUND_ACTIVE, WM_event_add_notifier(), blender::ed::object::xform_skip_child_container_create(), blender::ed::object::xform_skip_child_container_item_ensure_from_array(), and blender::MatBase< float, 3, 3 >::zero().
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 1071 of file view3d_snap.cc.
References ED_operator_view3d_active(), OPTYPE_REGISTER, ot, and snap_curs_to_active_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_cursor_to_center | ( | wmOperatorType * | ot | ) |
Definition at line 1105 of file view3d_snap.cc.
References ED_operator_view3d_active(), OPTYPE_REGISTER, ot, and snap_curs_to_center_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_cursor_to_grid | ( | wmOperatorType * | ot | ) |
Definition at line 830 of file view3d_snap.cc.
References ED_operator_region_view3d_active(), OPTYPE_REGISTER, ot, and snap_curs_to_grid_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_cursor_to_selected | ( | wmOperatorType * | ot | ) |
Definition at line 1022 of file view3d_snap.cc.
References ED_operator_view3d_active(), OPTYPE_REGISTER, ot, and snap_curs_to_sel_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_selected_to_active | ( | wmOperatorType * | ot | ) |
Definition at line 788 of file view3d_snap.cc.
References ED_operator_view3d_active(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and snap_selected_to_active_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_selected_to_cursor | ( | wmOperatorType * | ot | ) |
Definition at line 739 of file view3d_snap.cc.
References ED_operator_view3d_active(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, RNA_def_boolean(), and snap_selected_to_cursor_exec().
Referenced by view3d_operatortypes().
| void VIEW3D_OT_snap_selected_to_grid | ( | wmOperatorType * | ot | ) |
Definition at line 267 of file view3d_snap.cc.
References ED_operator_region_view3d_active(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and snap_sel_to_grid_exec().
Referenced by view3d_operatortypes().