Blender V2.61 - r43446
|
#include <string.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLO_sys_types.h"
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_lattice_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_view3d_types.h"
#include "DNA_modifier_types.h"
#include "DNA_movieclip_types.h"
#include "RNA_access.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_curve.h"
#include "BKE_depsgraph.h"
#include "BKE_displist.h"
#include "BKE_fcurve.h"
#include "BKE_lattice.h"
#include "BKE_mesh.h"
#include "BKE_nla.h"
#include "BKE_context.h"
#include "BKE_tracking.h"
#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_image.h"
#include "ED_keyframing.h"
#include "ED_markers.h"
#include "ED_mesh.h"
#include "ED_particle.h"
#include "ED_screen_types.h"
#include "ED_space_api.h"
#include "ED_uvedit.h"
#include "ED_view3d.h"
#include "ED_curve.h"
#include "ED_clip.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_rand.h"
#include "BLI_utildefines.h"
#include "WM_types.h"
#include "WM_api.h"
#include "UI_resources.h"
#include "transform.h"
Go to the source code of this file.
Definition in file transform_generics.c.
Definition at line 268 of file transform_generics.c.
References AnimData::act_extendmode, AnimData::action, add_nlastrip_to_stack(), ADT_NLA_EDIT_ON, ANIMPLAY_FLAG_JUMPED, ANIMRECORD_FLAG_WITHNLA, ToolSettings::autokey_flag, BKE_animdata_from_id(), calc_action_range(), wmTimer::customdata, ELEM3, NlaStrip::extendmode, NlaStrip::flag, AnimData::flag, ScreenAnimData::flag, bAction::id, IS_AUTOKEY_FLAG, NLASTRIP_EXTEND_NOTHING, NLASTRIP_FLAG_ACTIVE, NLASTRIP_FLAG_AUTO_BLENDS, NLASTRIP_FLAG_SELECT, NULL, io_export_cycles_xml::strip(), Scene::toolsettings, and ID::us.
Referenced by recalcData_view3d().
void applyTransObjects | ( | TransInfo * | t | ) |
Definition at line 1322 of file transform_generics.c.
References copy_v3_v3(), data, TransInfo::data, TransData::ext, TransData::iloc, TransDataExtension::irot, TransDataExtension::isize, TransData::loc, recalcData(), TransDataExtension::rot, TransDataExtension::size, and TransInfo::total.
void calculateCenter | ( | TransInfo * | t | ) |
Definition at line 1525 of file transform_generics.c.
References TransInfo::ar, TransInfo::around, BKE_mesh_get_editmesh(), calculateCenter2D(), calculateCenterBound(), calculateCenterCursor(), calculateCenterCursor2D(), calculateCenterCursorGraph2D(), calculateCenterMedian(), View3D::camera, TransCon::center, TransInfo::center, TransInfo::center2d, TransInfo::con, copy_v3_v3(), Object::data, ED_curve_actSelection(), ELEM, EM_editselection_center(), EM_get_actSelection(), TransInfo::flag, if(), initgrabz(), TransInfo::mode, mul_m4_v3(), normalize_v3(), OB_CURVE, OB_MESH, OB_SURF, OBACT, TransInfo::obedit, Object::obmat, RegionView3D::persp, TransInfo::poseobj, projectIntView(), ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_CAMOB, TransInfo::scene, SPACE_IMAGE, SPACE_IPO, SPACE_VIEW3D, TransInfo::spacetype, T_EDIT, T_OBJECT, T_POSE, TFM_TRANSLATION, Object::type, V3D_ACTIVE, V3D_CENTER, V3D_CENTROID, V3D_CURSOR, V3D_LOCAL, TransInfo::view, and TransInfo::viewinv.
Referenced by calculateTransformCenter(), and initTransform().
void calculateCenter2D | ( | TransInfo * | t | ) |
Definition at line 1398 of file transform_generics.c.
References TransInfo::center, TransInfo::center2d, copy_v3_v3(), TransInfo::flag, mul_m4_v3(), TransInfo::obedit, Object::obmat, TransInfo::poseobj, projectIntView(), T_EDIT, and T_POSE.
Referenced by calculateCenter(), calculateCenterBound(), calculateCenterCursor(), calculateCenterCursor2D(), calculateCenterCursorGraph2D(), calculateCenterMedian(), and setTransformViewMatrices().
void calculateCenterBound | ( | TransInfo * | t | ) |
Definition at line 1495 of file transform_generics.c.
References add_v3_v3v3(), calculateCenter2D(), TransInfo::center, TransData::center, copy_v3_v3(), TransInfo::data, TransData::flag, i, max, min, minmax_v3v3_v3(), mul_v3_fl(), TD_NOCENTER, TD_SELECTED, and TransInfo::total.
Referenced by calculateCenter().
void calculateCenterCursor | ( | TransInfo * | t | ) |
Definition at line 1413 of file transform_generics.c.
References calculateCenter2D(), TransInfo::center, copy_m3_m4(), copy_v3_v3(), TransInfo::flag, give_cursor(), invert_m3_m3(), mul_m3_v3(), TransInfo::obedit, Object::obmat, TransInfo::poseobj, TransInfo::scene, sub_v3_v3v3(), T_EDIT, T_POSE, and TransInfo::view.
Referenced by calculateCenter().
void calculateCenterCursor2D | ( | TransInfo * | t | ) |
Definition at line 1434 of file transform_generics.c.
References calculateCenter2D(), TransInfo::center, SpaceImage::cursor, ED_space_image_uv_aspect(), ListBase::first, NULL, TransInfo::sa, SPACE_IMAGE, ScrArea::spacedata, and TransInfo::spacetype.
Referenced by calculateCenter().
static void calculateCenterCursorGraph2D | ( | TransInfo * | t | ) | [static] |
Definition at line 1454 of file transform_generics.c.
References calculateCenter2D(), TransInfo::center, SpaceIpo::cursorVal, ListBase::first, TransInfo::sa, TransInfo::scene, and ScrArea::spacedata.
Referenced by calculateCenter().
void calculateCenterMedian | ( | TransInfo * | t | ) |
Definition at line 1466 of file transform_generics.c.
References add_v3_v3(), calculateCenter2D(), TransInfo::center, TransData::center, copy_v3_v3(), TransInfo::data, TransData::flag, i, mul_v3_fl(), TD_NOCENTER, TD_SELECTED, and TransInfo::total.
Referenced by calculateCenter().
void calculatePropRatio | ( | TransInfo * | t | ) |
Definition at line 1648 of file transform_generics.c.
References BLI_frand(), BLI_rand(), BLI_srand(), TransInfo::data, TransData::dist, TransData::factor, TransData::flag, TransInfo::flag, i, TransData::loc, TransInfo::mirror, PROP_CONST, PROP_LIN, TransInfo::prop_mode, PROP_RANDOM, PROP_ROOT, PROP_SHARP, TransInfo::prop_size, PROP_SMOOTH, PROP_SPHERE, TransInfo::proptext, TransData::rdist, restoreElement(), sqrt(), T_MIRROR, T_PROP_CONNECTED, T_PROP_EDIT, TD_NOACTION, TD_NOTCONNECTED, TD_SELECTED, TD_SKIP, and TransInfo::total.
Referenced by initTransform(), and transformEvent().
Definition at line 141 of file transform_generics.c.
References copy_v3_v3(), TransInfo::data, eModifierMode_Realtime, eModifierType_Mirror, fabs(), fabsf, ListBase::first, TransData::flag, MirrorModifierData::flag, i, TransData::iloc, invert_m4_m4(), TransData::loc, MirrorModifierData::mirror_ob, MOD_MIR_AXIS_X, MOD_MIR_AXIS_Y, MOD_MIR_AXIS_Z, MOD_MIR_CLIPPING, ModifierData::mode, Object::modifiers, mul_m4_v3(), mult_m4_m4m4(), ModifierData::next, NULL, Object::obmat, TD_NOACTION, TD_SKIP, MirrorModifierData::tolerance, TransInfo::total, and ModifierData::type.
Referenced by recalcData_view3d().
void drawLine | ( | TransInfo * | t, |
float * | center, | ||
float * | dir, | ||
char | axis, | ||
short | options | ||
) |
Definition at line 929 of file transform_generics.c.
References add_v3_v3v3(), copy_v3_v3(), DRAWLIGHT, View3D::far, mul_v3_fl(), setlinestyle(), SPACE_VIEW3D, TransInfo::spacetype, sub_v3_v3v3(), TH_GRID, UI_GetThemeColor3ubv(), UI_make_axis_color(), and TransInfo::view.
Referenced by drawConstraint(), and drawObjectConstraint().
static void editmesh_apply_to_mirror | ( | TransInfo * | t | ) | [static] |
Definition at line 239 of file transform_generics.c.
References EditVert::co, TransInfo::data, TransData::extra, TransData::flag, i, TransData::loc, NULL, TD_MIRROR_EDGE, TD_NOACTION, TD_SKIP, and TransInfo::total.
Referenced by recalcData_view3d().
static int fcu_test_selected | ( | FCurve * | fcu | ) | [static] |
Definition at line 315 of file transform_generics.c.
References BEZSELECTED, FCurve::bezt, i, NULL, and FCurve::totvert.
void getViewVector | ( | TransInfo * | t, |
float | coord[3], | ||
float | vec[3] | ||
) |
Definition at line 113 of file transform_generics.c.
References copy_v3_v3(), mul_m4_v4(), normalize_v3(), TransInfo::persp, RV3D_ORTHO, sub_v3_v3v3(), TransInfo::viewinv, and TransInfo::viewmat.
Referenced by axisProjection(), and planeProjection().
int initTransInfo | ( | bContext * | C, |
TransInfo * | t, | ||
wmOperator * | op, | ||
wmEvent * | event | ||
) |
Definition at line 974 of file transform_generics.c.
References bScreen::animtimer, TransInfo::animtimer, TransInfo::ar, SpaceIpo::around, SpaceImage::around, View3D::around, TransInfo::around, BIF_countTransformOrientation(), TransInfo::center, TransInfo::con, copy_v2_v2_int(), CTX_data_edit_object(), CTX_data_scene(), CTX_data_tool_settings(), CTX_EDGE, CTX_NO_PET, CTX_wm_area(), CTX_wm_region(), CTX_wm_screen(), TransInfo::current_orientation, Object::data, TransInfo::data, ELEM3, TransInfo::event_type, TransInfo::ext, ListBase::first, UserDef::flag, View3D::flag, TransInfo::flag, TransInfo::handleEvent, TransInfo::helpline, HLP_NONE, TransCon::imval, TransInfo::imval, initNumInput(), TransInfo::mat, ME_EDIT_MIRROR_X, TransInfo::mirror, TransInfo::mode, TransInfo::mval, wmEvent::mval, NULL, TransInfo::num, OB_MESH, TransInfo::obedit, TransInfo::options, PROP_EDIT_CONNECTED, PROP_EDIT_OFF, PROP_EDIT_ON, ToolSettings::prop_mode, TransInfo::prop_mode, TransInfo::prop_size, ToolSettings::proportional, ToolSettings::proportional_objects, ToolSettings::proportional_size, wmOperator::ptr, TransInfo::redraw, RNA_boolean_get(), RNA_boolean_set(), RNA_enum_get(), RNA_float_get(), RNA_struct_find_property(), RNA_struct_property_is_set(), TransInfo::sa, SCE_SELECT_FACE, TransInfo::scene, ToolSettings::selectmode, TransInfo::settings, setTransformViewMatrices(), SPACE_EMPTY, SPACE_IMAGE, SPACE_IPO, SPACE_NODE, SPACE_VIEW3D, ScrArea::spacedata, ScrArea::spacetype, TransInfo::spacetype, T_MIRROR, T_MODAL, T_PROP_CONNECTED, T_PROP_EDIT, T_RELEASE_CONFIRM, T_V3D_ALIGN, TFM_CREASE, TFM_RESIZE, TFM_ROTATION, TFM_TRACKBALL, TransInfo::total, TransInfo::transform, View3D::twmode, View3D::twtype, TransInfo::twtype, Object::type, U, unit_m3(), USER_RELEASECONFIRM, ToolSettings::uvcalc_flag, UVCALC_TRANSFORM_CORRECT, ARegion::v2d, V3D_ALIGN, V3D_CENTER, V3D_LOCAL, V3D_MANIP_CUSTOM, V3D_MANIP_GLOBAL, TransInfo::val, TransInfo::vec, and TransInfo::view.
Referenced by calculateTransformCenter(), and initTransform().
Definition at line 1262 of file transform_generics.c.
References TransInfo::ar, BLI_freelistN(), CTX_wm_manager(), TransInfo::customData, TransInfo::customFree, MouseInput::data, TransInfo::data, TransInfo::data2d, TransInfo::draw_handle_apply, TransInfo::draw_handle_cursor, TransInfo::draw_handle_pixel, TransInfo::draw_handle_view, ED_region_draw_cb_exit(), ED_uvedit_live_unwrap_end(), TransInfo::ext, ListBase::first, TransInfo::flag, SpaceImage::flag, TransData::flag, TransData::hdata, MEM_freeN(), TransInfo::mouse, NULL, TransSnap::points, TransInfo::sa, SI_LIVE_UNWRAP, SPACE_IMAGE, SPACE_VIEW3D, ScrArea::spacedata, TransInfo::spacetype, TransInfo::state, T_MODAL, TD_BEZTRIPLE, TRANS_CANCEL, TransInfo::tsnap, TransInfo::twtype, View3D::twtype, ARegion::type, and WM_paint_cursor_end().
Referenced by calculateTransformCenter(), initTransform(), and transformEnd().
void recalcData | ( | TransInfo * | t | ) |
Definition at line 901 of file transform_generics.c.
References flushTransNodes(), flushTransSeq(), recalcData_actedit(), recalcData_clip(), recalcData_graphedit(), recalcData_image(), recalcData_nla(), recalcData_view3d(), SPACE_ACTION, SPACE_CLIP, SPACE_IMAGE, SPACE_IPO, SPACE_NLA, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, and TransInfo::spacetype.
Referenced by Align(), applyTransObjects(), BakeTime(), Bevel(), BevelWeight(), BoneEnvelope(), BoneRoll(), BoneSize(), Crease(), CurveShrinkFatten(), EdgeSlide(), Mirror(), PushPull(), Resize(), restoreTransObjects(), Rotation(), SeqSlide(), Shear(), ShrinkFatten(), Tilt(), TimeScale(), TimeSlide(), TimeTranslate(), ToSphere(), Trackball(), Translation(), and Warp().
static void recalcData_actedit | ( | TransInfo * | t | ) | [static] |
Definition at line 331 of file transform_generics.c.
References ListBase::first, NULL, TransInfo::sa, TransInfo::scene, and ScrArea::spacedata.
Referenced by recalcData().
static void recalcData_clip | ( | TransInfo * | t | ) | [static] |
Definition at line 640 of file transform_generics.c.
References BKE_tracking_clamp_track(), BKE_tracking_ensure_marker(), BKE_tracking_get_tracks(), CLAMP_PAT_DIM, CLAMP_PAT_POS, CLAMP_SEARCH_DIM, CLAMP_SEARCH_POS, DAG_id_tag_update(), ED_space_clip(), ListBase::first, MovieTrackingMarker::flag, flushTransTracking(), MovieClipUser::framenr, MovieClip::id, TransInfo::mode, MovieTrackingTrack::next, TransInfo::sa, ScrArea::spacedata, TransInfo::state, TFM_RESIZE, TFM_TRANSLATION, TRACK_AREA_PAT, TRACK_AREA_SEARCH, TRACK_AREA_SELECTED, TRACK_VIEW_SELECTED, MovieClip::tracking, TRANS_CANCEL, MovieTrackingTrack::transflag, and SpaceClip::user.
Referenced by recalcData().
static void recalcData_graphedit | ( | TransInfo * | t | ) | [static] |
Definition at line 379 of file transform_generics.c.
References ListBase::first, NULL, TransInfo::sa, and ScrArea::spacedata.
Referenced by recalcData().
static void recalcData_image | ( | TransInfo * | t | ) | [static] |
Definition at line 626 of file transform_generics.c.
References DAG_id_tag_update(), Object::data, ED_uvedit_live_unwrap_re_solve(), ListBase::first, SpaceImage::flag, flushTransUVs(), OB_MESH, TransInfo::obedit, TransInfo::sa, SI_LIVE_UNWRAP, ScrArea::spacedata, and Object::type.
Referenced by recalcData().
static void recalcData_nla | ( | TransInfo * | t | ) | [static] |
Definition at line 444 of file transform_generics.c.
References ANIM_id_update(), BKE_nlameta_flush_transforms(), BKE_nlatrack_add_strip(), BKE_nlatrack_has_space(), BLI_addtail(), BLI_remlink(), TransInfo::customData, ED_markers_find_nearest_marker_time(), NlaStrip::end, ListBase::first, FPS, TransDataNla::h1, TransDataNla::h2, TransDataNla::handle, i, TransDataNla::id, Scene::markers, NlaTrack::next, NlaStrip::next, NLACHANNEL_STEP, NLASTRIP_TYPE_TRANSITION, TransDataNla::nlt, NULL, TransDataNla::oldTrack, NlaTrack::prev, NlaStrip::prev, RNA_float_set(), RNA_NlaStrip, RNA_pointer_create(), TransInfo::sa, SACTSNAP_FRAME, SACTSNAP_MARKER, TransInfo::scene, SNLA_DRAWTIME, SNLA_NOREALTIMEUPDATES, ScrArea::spacedata, NlaStrip::start, TransInfo::state, TransDataNla::strip, io_export_cycles_xml::strip(), NlaTrack::strips, TransInfo::total, TransDataNla::trackIndex, TRANS_CANCEL, and NlaStrip::type.
Referenced by recalcData().
static void recalcData_view3d | ( | TransInfo * | t | ) | [static] |
Definition at line 686 of file transform_generics.c.
References animrecord_check_state(), TransInfo::animtimer, applyProject(), ARM_DELAYDEFORM, ARM_MIRROR_EDIT, autokeyframe_ob_cb_func(), autokeyframe_pose_cb_func(), TransData::axismtx, Scene::basact, BONE_CONNECTED, BONE_TIPSEL, calchandlesNurb(), clipMirrorModifier(), TransInfo::context, copy_v3_v3(), CTX_NO_MIRROR, curve_editnurbs(), DAG_id_tag_update(), TransInfo::data, Object::data, EditBone::dist, ED_rollBoneToVector(), bArmature::edbo, Lattice::editlatt, editmesh_apply_to_mirror(), ELEM, TransData::extra, FALSE, ListBase::first, TransData::flag, bArmature::flag, EditBone::flag, TransInfo::flag, Lattice::flag, flushTransParticles(), EditBone::head, i, Object::id, IS_AUTOKEY_ON, EditLatt::latt, len_v3v3(), EditBone::length, LT_OUTSIDE, TransInfo::mat, Object::mode, TransInfo::mode, mul_m3_v3(), mul_qt_v3(), EditBone::next, Nurb::next, normalize_v3(), TransData::ob, OB_ARMATURE, OB_CURVE, OB_LATTICE, OB_MESH, OB_MODE_PARTICLE_EDIT, OB_RECALC_DATA, OB_RECALC_OB, OB_SURF, TransInfo::obedit, Base::object, EditBone::oldlength, TransInfo::options, outside_lattice(), EditBone::parent, PE_get_current(), TransInfo::poseobj, EditBone::rad_head, EditBone::rad_tail, recalc_editnormals(), EditBone::roll, rotation_between_vecs_to_quat(), TransInfo::scene, TransInfo::state, sub_v3_v3v3(), T_AUTOIK, T_MIRROR, T_POSE, EditBone::tail, TD_NOACTION, TD_SKIP, test2DNurb(), TFM_BONE_ENVELOPE, TFM_BONE_ROLL, TFM_ROTATION, TransInfo::total, TRANS_CANCEL, transform_armature_mirror_update(), Object::type, TransInfo::view, and where_is_pose().
Referenced by recalcData().
void resetTransRestrictions | ( | TransInfo * | t | ) |
Definition at line 968 of file transform_generics.c.
References TransInfo::flag, and T_ALL_RESTRICTIONS.
Referenced by transformEvent().
static void restoreElement | ( | TransData * | td | ) | [static] |
Definition at line 1338 of file transform_generics.c.
References copy_qt_qt(), copy_v3_v3(), TransData::ext, TransData::flag, TransDataCurveHandleFlags::h1, TransDataCurveHandleFlags::h2, TransData::hdata, TransDataCurveHandleFlags::ih1, TransDataCurveHandleFlags::ih2, TransData::iloc, TransDataExtension::iquat, TransDataExtension::irot, TransDataExtension::irotAngle, TransDataExtension::irotAxis, TransDataExtension::isize, TransData::ival, TransData::loc, TransDataExtension::quat, TransDataExtension::rot, TransDataExtension::rotAngle, TransDataExtension::rotAxis, TransDataExtension::size, TD_BEZTRIPLE, TD_NO_EXT, and TransData::val.
Referenced by calculatePropRatio(), and restoreTransObjects().
void restoreTransObjects | ( | TransInfo * | t | ) |
Definition at line 1373 of file transform_generics.c.
References data, TransInfo::data, TransInfo::data2d, TransData2D::h1, TransData2D::h2, TransData2D::ih1, TransData2D::ih2, TransInfo::mat, recalcData(), restoreElement(), TransInfo::total, and unit_m3().
Referenced by transformEnd(), and transformEvent().