Blender V2.61 - r43446
|
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_armature_types.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_editVert.h"
#include "BLI_linklist.h"
#include "BLI_utildefines.h"
#include "BKE_armature.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_lattice.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_scene.h"
#include "BKE_tracking.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_armature.h"
#include "ED_mesh.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_curve.h"
#include "view3d_intern.h"
Go to the source code of this file.
Definition in file view3d_snap.c.
#define TM_ALL_JOINTS 1 |
Definition at line 193 of file view3d_snap.c.
Referenced by make_trans_verts(), minmax_verts(), and snap_curs_to_sel().
#define TM_SKIP_HANDLES 2 |
Definition at line 194 of file view3d_snap.c.
Referenced by make_trans_verts(), and snap_curs_to_sel().
Definition at line 758 of file view3d_snap.c.
References BKE_get_tracking_mat(), BKE_tracking_get_interpolated_camera(), BKE_tracking_object_tracks(), MovieTrackingTrack::bundle_pos, RenderData::cfra, copy_m4_m4(), DO_MINMAX, ListBase::first, MovieTrackingTrack::flag, MovieTrackingObject::flag, INIT_MINMAX, invert_m4(), MAT4_UNITY, max, mid_v3_v3v3(), min, mul_v3_m4v3(), mult_m4_m4m4(), MovieTrackingTrack::next, MovieTrackingObject::next, object_get_movieclip(), MovieTracking::objects, Object::obmat, Scene::r, TRACK_HAS_BUNDLE, TRACK_SELECTED, MovieClip::tracking, and TRACKING_OBJECT_CAMERA.
Referenced by snap_curs_to_sel().
static void make_trans_verts | ( | Object * | obedit, |
float * | min, | ||
float * | max, | ||
int | mode | ||
) | [static] |
Definition at line 195 of file view3d_snap.c.
References add_v3_v3(), BPoint::alfa, BezTriple::alfa, Nurb::bezt, BLI_countlist(), BONE_CONNECTED, BONE_ROOTSEL, BONE_TIPSEL, Nurb::bp, EditVert::co, copy_v3_v3(), CU_BEZIER, curve_editnurbs(), Object::data, Lattice::def, DO_MINMAX, bArmature::edbo, EditMesh::edges, Mesh::edit_mesh, MetaBall::editelems, Lattice::editlatt, ELEM, EditFace::f, EditEdge::f, EditVert::f, BPoint::f1, BezTriple::f1, EditVert::f1, BezTriple::f2, BezTriple::f3, EditMesh::faces, ListBase::first, MetaElem::flag, EditBone::flag, TransVert::flag, EditFace::h, EditEdge::h, EditVert::h, EditBone::head, BPoint::hide, BezTriple::hide, INIT_MINMAX, EditLatt::latt, bArmature::layer, EditBone::layer, TransVert::loc, MEM_callocN(), MEM_freeN(), mid_v3_v3v3(), mul_v3_fl(), MetaElem::next, Nurb::next, EditBone::next, EditFace::next, EditEdge::next, EditVert::next, EditVert::no, TransVert::nor, NULL, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MBALL, OB_MESH, OB_SURF, TransVert::oldloc, TransVert::oldval, EditBone::parent, Lattice::pntsu, Nurb::pntsu, Lattice::pntsv, Nurb::pntsv, Lattice::pntsw, MetaElem::rad, SCE_SELECT_EDGE, SCE_SELECT_VERTEX, SELECT, EditMesh::selectmode, EditBone::tail, TM_ALL_JOINTS, TM_SKIP_HANDLES, tottrans, transvmain, Nurb::type, Object::type, EditFace::v1, EditEdge::v1, EditFace::v2, EditEdge::v2, EditFace::v3, EditFace::v4, TransVert::val, BPoint::vec, BezTriple::vec, EditMesh::verts, and MetaElem::x.
Referenced by minmax_verts(), snap_curs_to_sel(), snap_sel_to_curs(), and snap_sel_to_grid().
int minmax_verts | ( | Object * | obedit, |
float * | min, | ||
float * | max | ||
) |
Definition at line 1005 of file view3d_snap.c.
References add_v3_v3(), copy_m3_m4(), copy_v3_v3(), DO_MINMAX, ELEM5, TransVert::loc, make_trans_verts(), MEM_freeN(), mul_m3_v3(), NULL, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MESH, OB_SURF, Object::obmat, TM_ALL_JOINTS, tottrans, transvmain, and Object::type.
Referenced by viewselected_exec().
static int snap_curs_to_active | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 921 of file view3d_snap.c.
References copy_v3_v3(), CTX_data_active_object(), CTX_data_edit_object(), CTX_data_scene(), CTX_wm_view3d(), Object::data, Mesh::edit_mesh, EM_editselection_center(), EM_get_actSelection(), give_cursor(), mul_m4_v3(), NC_SPACE, ND_SPACE_VIEW3D, OB_MESH, Object::obmat, OPERATOR_FINISHED, Object::type, and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_active().
static int snap_curs_to_center | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 971 of file view3d_snap.c.
References CTX_data_scene(), CTX_wm_view3d(), give_cursor(), NC_SPACE, ND_SPACE_VIEW3D, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_center().
static int snap_curs_to_grid | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 722 of file view3d_snap.c.
References CTX_data_scene(), CTX_wm_region_data(), CTX_wm_view3d(), floorf, give_cursor(), RegionView3D::gridview, NC_SPACE, ND_SPACE_VIEW3D, OPERATOR_FINISHED, and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_grid().
static int snap_curs_to_sel | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 810 of file view3d_snap.c.
References add_v3_v3(), View3D::around, bPoseChannel::bone, BONE_SELECTED, bundle_midpoint(), bPose::chanbase, copy_m3_m4(), copy_v3_v3(), CTX_data_active_object(), CTX_DATA_BEGIN, CTX_data_edit_object(), CTX_DATA_END, CTX_data_scene(), CTX_wm_view3d(), Object::data, DO_MINMAX, ELEM6, ListBase::first, Bone::flag, View3D::flag2, give_cursor(), INIT_MINMAX, Bone::layer, bArmature::layer, TransVert::loc, make_trans_verts(), max, MEM_freeN(), mid_v3_v3v3(), min, Object::mode, mul_m3_v3(), mul_m4_v3(), mul_v3_fl(), NC_SPACE, ND_SPACE_VIEW3D, bPoseChannel::next, NULL, OB_ARMATURE, OB_CAMERA, OB_CURVE, OB_LATTICE, OB_MBALL, OB_MESH, OB_MODE_POSE, OB_SURF, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, Object::pose, bPoseChannel::pose_head, TM_ALL_JOINTS, TM_SKIP_HANDLES, tottrans, transvmain, Object::type, V3D_CENTROID, V3D_SHOW_RECONSTRUCTION, and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_cursor_to_selected().
static int snap_sel_to_curs | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 595 of file view3d_snap.c.
References ANIM_get_keyingset_for_autokeying(), ANIM_KS_LOCATION_ID, Bone::arm_mat, bPoseChannel::bone, BONE_CONNECTED, BONE_SELECTED, copy_m3_m4(), copy_v3_v3(), CTX_DATA_BEGIN, CTX_data_edit_object(), CTX_DATA_END, CTX_data_main(), CTX_data_scene(), CTX_wm_view3d(), DAG_id_tag_update(), DAG_ids_flush_update(), ED_autokeyframe_object(), ED_autokeyframe_pchan(), ELEM6, Bone::flag, give_cursor(), invert_m3_m3(), invert_m4_m4(), bArmature::layer, Bone::layer, bPoseChannel::loc, TransVert::loc, make_trans_verts(), MEM_freeN(), mul_m3_v3(), mul_m4_v3(), NC_OBJECT, ND_TRANSFORM, bPoseChannel::next, NULL, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_LOCK_LOCX, OB_LOCK_LOCY, OB_LOCK_LOCZ, OB_MBALL, OB_MESH, OB_MODE_POSE, OB_RECALC_DATA, OB_RECALC_OB, OB_SURF, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, originmat, POSE_DO_UNLOCK, POSE_LOCKED, bPoseChannel::protectflag, special_transvert_update(), sub_v3_v3v3(), tottrans, transvmain, Object::type, where_is_object(), and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_selected_to_cursor().
static int snap_sel_to_grid | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 452 of file view3d_snap.c.
References add_v3_v3(), ANIM_get_keyingset_for_autokeying(), ANIM_KS_LOCATION_ID, Bone::arm_mat, bPoseChannel::bone, BONE_CONNECTED, BONE_SELECTED, copy_m3_m4(), copy_v3_v3(), CTX_DATA_BEGIN, CTX_data_edit_object(), CTX_DATA_END, CTX_data_main(), CTX_data_scene(), CTX_wm_region_data(), DAG_id_tag_update(), DAG_ids_flush_update(), ED_autokeyframe_object(), ED_autokeyframe_pchan(), ELEM6, Bone::flag, floorf, RegionView3D::gridview, invert_m3_m3(), invert_m4_m4(), bArmature::layer, Bone::layer, bPoseChannel::loc, TransVert::loc, make_trans_verts(), MEM_freeN(), mul_m3_v3(), mul_m4_v3(), NC_OBJECT, ND_TRANSFORM, bPoseChannel::next, NULL, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_LOCK_LOCX, OB_LOCK_LOCY, OB_LOCK_LOCZ, OB_MBALL, OB_MESH, OB_MODE_POSE, OB_RECALC_DATA, OB_RECALC_OB, OB_SURF, Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, originmat, POSE_DO_UNLOCK, POSE_LOCKED, bPoseChannel::pose_mat, bPoseChannel::protectflag, special_transvert_update(), sub_v3_v3(), tottrans, transvmain, Object::type, where_is_object(), and WM_event_add_notifier().
Referenced by VIEW3D_OT_snap_selected_to_grid().
static void special_transvert_update | ( | Object * | obedit | ) | [static] |
Definition at line 93 of file view3d_snap.c.
References add_v3_v3(), add_v3_v3v3(), ARM_MIRROR_EDIT, Nurb::bezt, BONE_CONNECTED, BONE_ROOTSEL, BONE_TIPSEL, copy_v3_v3(), curve_editnurbs(), DAG_id_tag_update(), Object::data, bArmature::edbo, Mesh::edit_mesh, Lattice::editlatt, ELEM, BezTriple::f1, BezTriple::f2, BezTriple::f3, ListBase::first, Lattice::flag, bArmature::flag, EditBone::flag, EditBone::head, EditLatt::latt, TransVert::loc, LT_OUTSIDE, EditBone::next, Nurb::next, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MESH, OB_SURF, TransVert::oldloc, outside_lattice(), EditBone::parent, Nurb::pntsu, recalc_editnormals(), SELECT, sub_v3_v3v3(), EditBone::tail, test2DNurb(), testhandlesNurb(), tottrans, transform_armature_mirror_update(), transvmain, Object::type, and BezTriple::vec.
Referenced by snap_sel_to_curs(), and snap_sel_to_grid().
void VIEW3D_OT_snap_cursor_to_active | ( | wmOperatorType * | ot | ) |
Definition at line 954 of file view3d_snap.c.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and snap_curs_to_active().
Referenced by view3d_operatortypes().
void VIEW3D_OT_snap_cursor_to_center | ( | wmOperatorType * | ot | ) |
Definition at line 987 of file view3d_snap.c.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and snap_curs_to_center().
Referenced by view3d_operatortypes().
void VIEW3D_OT_snap_cursor_to_grid | ( | wmOperatorType * | ot | ) |
Definition at line 741 of file view3d_snap.c.
References wmOperatorType::description, ED_operator_region_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and snap_curs_to_grid().
Referenced by view3d_operatortypes().
void VIEW3D_OT_snap_cursor_to_selected | ( | wmOperatorType * | ot | ) |
Definition at line 904 of file view3d_snap.c.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and snap_curs_to_sel().
Referenced by view3d_operatortypes().
void VIEW3D_OT_snap_selected_to_cursor | ( | wmOperatorType * | ot | ) |
Definition at line 705 of file view3d_snap.c.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and snap_sel_to_curs().
Referenced by view3d_operatortypes().
void VIEW3D_OT_snap_selected_to_grid | ( | wmOperatorType * | ot | ) |
Definition at line 578 of file view3d_snap.c.
References wmOperatorType::description, ED_operator_region_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and snap_sel_to_grid().
Referenced by view3d_operatortypes().
float originmat[3][3] |
Definition at line 116 of file object.c.
Referenced by snap_sel_to_curs(), snap_sel_to_grid(), and solve_parenting().
int tottrans = 0 [static] |
Definition at line 90 of file view3d_snap.c.
Referenced by make_trans_verts(), minmax_verts(), snap_curs_to_sel(), snap_sel_to_curs(), snap_sel_to_grid(), and special_transvert_update().
TransVert* transvmain = NULL [static] |
Definition at line 89 of file view3d_snap.c.
Referenced by make_trans_verts(), minmax_verts(), snap_curs_to_sel(), snap_sel_to_curs(), snap_sel_to_grid(), and special_transvert_update().