Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions | Variables

transform_conversions.c File Reference

#include <unistd.h>
#include <string.h>
#include <math.h>
#include "DNA_anim_types.h"
#include "DNA_armature_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meta_types.h"
#include "DNA_node_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "DNA_sequence_types.h"
#include "DNA_view3d_types.h"
#include "DNA_constraint_types.h"
#include "DNA_scene_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_movieclip_types.h"
#include "MEM_guardedalloc.h"
#include "BKE_action.h"
#include "BKE_armature.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_constraint.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
#include "BKE_gpencil.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_main.h"
#include "BKE_modifier.h"
#include "BKE_nla.h"
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_sequencer.h"
#include "BKE_pointcache.h"
#include "BKE_bmesh.h"
#include "BKE_scene.h"
#include "BKE_report.h"
#include "BKE_tracking.h"
#include "BKE_movieclip.h"
#include "BKE_node.h"
#include "ED_anim_api.h"
#include "ED_armature.h"
#include "ED_particle.h"
#include "ED_image.h"
#include "ED_keyframing.h"
#include "ED_keyframes_edit.h"
#include "ED_object.h"
#include "ED_markers.h"
#include "ED_mesh.h"
#include "ED_node.h"
#include "ED_types.h"
#include "ED_uvedit.h"
#include "ED_clip.h"
#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_view2d.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_editVert.h"
#include "BLI_utildefines.h"
#include "RNA_access.h"
#include "transform.h"
#include "BLO_sys_types.h"

Go to the source code of this file.

Classes

struct  tGPFtransdata
struct  BeztMap
struct  TransDataTracking

Defines

#define THRESHOLDFACTOR   (1.0f-0.0001f)
#define SEQ_TX_NESTED_METAS
#define XXX_DURIAN_ANIM_TX_HACK

Typedefs

typedef struct tGPFtransdata tGPFtransdata
typedef struct BeztMap BeztMap
typedef struct TransDataTracking TransDataTracking

Functions

static short constraints_list_needinv (TransInfo *t, ListBase *list)
static void qsort_trans_data (TransInfo *t, TransData *head, TransData *tail, TransData *temp)
void sort_trans_data_dist (TransInfo *t)
static void sort_trans_data (TransInfo *t)
static void set_prop_dist (TransInfo *t, short with_dist)
static void createTransTexspace (TransInfo *t)
static void createTransEdge (TransInfo *t)
static bKinematicConstrainthas_targetless_ik (bPoseChannel *pchan)
static short apply_targetless_ik (Object *ob)
static void add_pose_transdata (TransInfo *t, bPoseChannel *pchan, Object *ob, TransData *td)
static void bone_children_clear_transflag (int mode, short around, ListBase *lb)
int count_set_pose_transflags (int *out_mode, short around, Object *ob)
static void pchan_autoik_adjust (bPoseChannel *pchan, short chainlen)
void transform_autoik_update (TransInfo *t, short mode)
static void pose_grab_with_ik_clear (Object *ob)
static short pose_grab_with_ik_add (bPoseChannel *pchan)
static short pose_grab_with_ik_children (bPose *pose, Bone *bone)
static short pose_grab_with_ik (Object *ob)
static void createTransPose (TransInfo *t, Object *ob)
static void createTransArmatureVerts (TransInfo *t)
static void createTransMBallVerts (TransInfo *t)
static void calc_distanceCurveVerts (TransData *head, TransData *tail)
static TransDataCurveHandleFlagsinitTransDataCurveHandles (TransData *td, struct BezTriple *bezt)
static void createTransCurveVerts (bContext *C, TransInfo *t)
static void createTransLatticeVerts (TransInfo *t)
static void createTransParticleVerts (bContext *C, TransInfo *t)
void flushTransParticles (TransInfo *t)
static int connectivity_edge (float mtx[][3], EditVert *v1, EditVert *v2)
static void editmesh_set_connectivity_distance (EditMesh *em, float mtx[][3])
static void get_face_center (float *cent, EditMesh *em, EditVert *eve)
static void get_edge_center (float *cent, EditMesh *em, EditVert *eve)
static void VertsToTransData (TransInfo *t, TransData *td, EditMesh *em, EditVert *eve)
static void createTransEditVerts (bContext *C, TransInfo *t)
void flushTransNodes (TransInfo *t)
void flushTransSeq (TransInfo *t)
static void UVsToTransData (SpaceImage *sima, TransData *td, TransData2D *td2d, float *uv, int selected)
static void createTransUVs (bContext *C, TransInfo *t)
void flushTransUVs (TransInfo *t)
int clipUVTransform (TransInfo *t, float *vec, int resize)
static short FrameOnMouseSide (char side, float frame, float cframe)
static void createTransNlaData (bContext *C, TransInfo *t)
static void posttrans_gpd_clean (bGPdata *gpd)
static void posttrans_fcurve_clean (FCurve *fcu, const short use_handle)
static void posttrans_action_clean (bAnimContext *ac, bAction *act)
static int count_fcurve_keys (FCurve *fcu, char side, float cfra)
static int count_gplayer_frames (bGPDlayer *gpl, char side, float cfra)
static void TimeToTransData (TransData *td, float *time, AnimData *adt)
static TransDataActionFCurveToTransData (TransData *td, TransData2D **td2dv, FCurve *fcu, AnimData *adt, char side, float cfra)
void flushTransGPactionData (TransInfo *t)
static int GPLayerToTransData (TransData *td, tGPFtransdata *tfd, bGPDlayer *gpl, char side, float cfra)
static void createTransActionData (bContext *C, TransInfo *t)
static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt, BezTriple *bezt, int bi, short selected, short ishandle, short intvals, float mtx[3][3], float smtx[3][3])
static void createTransGraphEditData (bContext *C, TransInfo *t)
static BeztMapbezt_to_beztmaps (BezTriple *bezts, int totvert, const short UNUSED(use_handle))
static void sort_time_beztmaps (BeztMap *bezms, int totvert, const short UNUSED(use_handle))
static void beztmap_to_data (TransInfo *t, FCurve *fcu, BeztMap *bezms, int totvert, const short UNUSED(use_handle))
void remake_graph_transdata (TransInfo *t, ListBase *anim_data)
void flushTransGraphData (TransInfo *t)
static void SeqTransInfo (TransInfo *t, Sequence *seq, int *recursive, int *count, int *flag)
static int SeqTransCount (TransInfo *t, ListBase *seqbase, int depth)
static TransDataSeqToTransData (TransData *td, TransData2D *td2d, TransDataSeq *tdsq, Sequence *seq, int flag, int sel_flag)
static int SeqToTransData_Recursive (TransInfo *t, ListBase *seqbase, TransData *td, TransData2D *td2d, TransDataSeq *tdsq)
static void freeSeqData (TransInfo *t)
static void createTransSeqData (bContext *C, TransInfo *t)
static void ObjectToTransData (TransInfo *t, TransData *td, Object *ob)
static void set_trans_object_base_flags (TransInfo *t)
static int mark_children (Object *ob)
static int count_proportional_objects (TransInfo *t)
static void clear_trans_object_base_flags (TransInfo *t)
void autokeyframe_ob_cb_func (bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode)
void autokeyframe_pose_cb_func (bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode, short targetless_ik)
void special_aftertrans_update (bContext *C, TransInfo *t)
static void createTransObject (bContext *C, TransInfo *t)
static void NodeToTransData (TransData *td, TransData2D *td2d, bNode *node)
static void createTransNodeData (bContext *C, TransInfo *t)
static void markerToTransDataInit (TransData *td, TransData2D *td2d, TransDataTracking *tdt, MovieTrackingTrack *track, int area, float *loc, float *rel, float *off)
static void trackToTransData (SpaceClip *sc, TransData *td, TransData2D *td2d, TransDataTracking *tdt, MovieTrackingTrack *track)
static void transDataTrackingFree (TransInfo *t)
static void createTransTrackingData (bContext *C, TransInfo *t)
void flushTransTracking (TransInfo *t)
void createTransData (bContext *C, TransInfo *t)

Variables

ListBase editelems

Detailed Description

Definition in file transform_conversions.c.


Define Documentation

#define SEQ_TX_NESTED_METAS

Definition at line 2203 of file transform_conversions.c.

#define THRESHOLDFACTOR   (1.0f-0.0001f)

Definition at line 1823 of file transform_conversions.c.

#define XXX_DURIAN_ANIM_TX_HACK

Typedef Documentation

typedef struct BeztMap BeztMap
typedef struct tGPFtransdata tGPFtransdata

Function Documentation

static TransData* ActionFCurveToTransData ( TransData td,
TransData2D **  td2dv,
FCurve fcu,
AnimData adt,
char  side,
float  cfra 
) [static]
static void add_pose_transdata ( TransInfo t,
bPoseChannel pchan,
Object ob,
TransData td 
) [static]

Definition at line 515 of file transform_conversions.c.

References ARM_ENVELOPE, Bone::arm_mat, TransData::axismtx, bPoseChannel::bone, BONE_HINGE, BONE_HINGE_CHILD_TRANSFORM, Bone::bone_mat, BONE_NO_LOCAL_LOCATION, BONE_TRANSFORM_CHILD, TransData::center, TransData::con, bPoseChannel::constinv, CONSTRAINT_IK_AUTO, CONSTRAINT_IK_TIP, bPoseChannel::constraints, constraints_list_needinv(), copy_m3_m3(), copy_m3_m4(), copy_qt_qt(), copy_v3_v3(), data, Object::data, Bone::dist, bArmature::drawtype, ELEM, bPoseChannel::eul, TransData::ext, ListBase::first, bKinematicConstraint::flag, Bone::flag, TransData::flag, bKinematicConstraint::grabtarget, has_targetless_ik(), TransData::iloc, invert_m3_m3(), TransDataExtension::iquat, TransDataExtension::irot, TransDataExtension::irotAngle, TransDataExtension::irotAxis, TransDataExtension::isize, TransData::ival, TransDataExtension::l_smtx, bPoseChannel::loc, TransData::loc, TransInfo::mode, TransData::mtx, mul_m3_m3m3(), mul_serie_m3(), normalize_m3(), NULL, TransData::ob, Object::obmat, bPoseChannel::parent, bPoseChannel::pose_head, bPoseChannel::pose_mat, bPoseChannel::pose_tail, TransInfo::poseobj, bPoseChannel::protectflag, TransData::protectflag, bPoseChannel::quat, TransDataExtension::quat, TransDataExtension::rot, ROT_MODE_AXISANGLE, bPoseChannel::rotAngle, TransDataExtension::rotAngle, bPoseChannel::rotAxis, TransDataExtension::rotAxis, bPoseChannel::rotmode, TransDataExtension::rotOrder, bPoseChannel::size, TransDataExtension::size, TransData::smtx, TD_NO_LOC, TD_NOCENTER, TD_PBONE_LOCAL_MTX_C, TD_PBONE_LOCAL_MTX_P, TD_SELECTED, TFM_BONESIZE, TFM_RESIZE, TFM_TRANSLATION, unit_m3(), TransData::val, and Bone::xwidth.

Referenced by createTransPose().

static short apply_targetless_ik ( Object ob) [static]
void autokeyframe_ob_cb_func ( bContext C,
Scene scene,
View3D v3d,
Object ob,
int  tmode 
)
void autokeyframe_pose_cb_func ( bContext C,
Scene scene,
View3D v3d,
Object ob,
int  tmode,
short  targetless_ik 
)
static BeztMap* bezt_to_beztmaps ( BezTriple bezts,
int  totvert,
const short   UNUSEDuse_handle 
) [static]

Definition at line 3506 of file transform_conversions.c.

References i, BezTriple::ipo, MEM_callocN(), and NULL.

Referenced by remake_graph_transdata().

static void bezt_to_transdata ( TransData td,
TransData2D td2d,
AnimData adt,
BezTriple bezt,
int  bi,
short  selected,
short  ishandle,
short  intvals,
float  mtx[3][3],
float  smtx[3][3] 
) [static]
static void beztmap_to_data ( TransInfo t,
FCurve fcu,
BeztMap bezms,
int  totvert,
const short   UNUSEDuse_handle 
) [static]
static void bone_children_clear_transflag ( int  mode,
short  around,
ListBase lb 
) [static]
static void calc_distanceCurveVerts ( TransData head,
TransData tail 
) [static]
static void clear_trans_object_base_flags ( TransInfo t) [static]
int clipUVTransform ( TransInfo t,
float *  vec,
int  resize 
)
static int connectivity_edge ( float  mtx[][3],
EditVert v1,
EditVert v2 
) [static]
static short constraints_list_needinv ( TransInfo t,
ListBase list 
) [static]
static int count_fcurve_keys ( FCurve fcu,
char  side,
float  cfra 
) [static]
static int count_gplayer_frames ( bGPDlayer gpl,
char  side,
float  cfra 
) [static]
static int count_proportional_objects ( TransInfo t) [static]
int count_set_pose_transflags ( int *  out_mode,
short  around,
Object ob 
)
static void createTransActionData ( bContext C,
TransInfo t 
) [static]
static void createTransArmatureVerts ( TransInfo t) [static]
static void createTransCurveVerts ( bContext C,
TransInfo t 
) [static]
void createTransData ( bContext C,
TransInfo t 
)
static void createTransEdge ( TransInfo t) [static]
static void createTransEditVerts ( bContext C,
TransInfo t 
) [static]
static void createTransGraphEditData ( bContext C,
TransInfo t 
) [static]
static void createTransLatticeVerts ( TransInfo t) [static]
static void createTransMBallVerts ( TransInfo t) [static]
static void createTransNlaData ( bContext C,
TransInfo t 
) [static]
static void createTransNodeData ( bContext C,
TransInfo t 
) [static]
static void createTransObject ( bContext C,
TransInfo t 
) [static]
static void createTransParticleVerts ( bContext C,
TransInfo t 
) [static]
static void createTransPose ( TransInfo t,
Object ob 
) [static]
static void createTransSeqData ( bContext C,
TransInfo t 
) [static]
static void createTransTexspace ( TransInfo t) [static]
static void createTransTrackingData ( bContext C,
TransInfo t 
) [static]
static void createTransUVs ( bContext C,
TransInfo t 
) [static]
static void editmesh_set_connectivity_distance ( EditMesh em,
float  mtx[][3] 
) [static]
void flushTransGPactionData ( TransInfo t)
void flushTransGraphData ( TransInfo t)
void flushTransNodes ( TransInfo t)
void flushTransParticles ( TransInfo t)
void flushTransSeq ( TransInfo t)
void flushTransTracking ( TransInfo t)
void flushTransUVs ( TransInfo t)
static short FrameOnMouseSide ( char  side,
float  frame,
float  cframe 
) [static]
static void freeSeqData ( TransInfo t) [static]
static void get_edge_center ( float *  cent,
EditMesh em,
EditVert eve 
) [static]
static void get_face_center ( float *  cent,
EditMesh em,
EditVert eve 
) [static]
static int GPLayerToTransData ( TransData td,
tGPFtransdata tfd,
bGPDlayer gpl,
char  side,
float  cfra 
) [static]
static bKinematicConstraint* has_targetless_ik ( bPoseChannel pchan) [static]
static TransDataCurveHandleFlags* initTransDataCurveHandles ( TransData td,
struct BezTriple bezt 
) [static]
static int mark_children ( Object ob) [static]

Definition at line 4429 of file transform_conversions.c.

References BA_TRANSFORM_CHILD, Object::flag, Object::parent, and SELECT.

Referenced by count_proportional_objects().

static void markerToTransDataInit ( TransData td,
TransData2D td2d,
TransDataTracking tdt,
MovieTrackingTrack track,
int  area,
float *  loc,
float *  rel,
float *  off 
) [static]
static void NodeToTransData ( TransData td,
TransData2D td2d,
bNode node 
) [static]
static void ObjectToTransData ( TransInfo t,
TransData td,
Object ob 
) [static]
static void pchan_autoik_adjust ( bPoseChannel pchan,
short  chainlen 
) [static]
static short pose_grab_with_ik ( Object ob) [static]
static short pose_grab_with_ik_add ( bPoseChannel pchan) [static]
static short pose_grab_with_ik_children ( bPose pose,
Bone bone 
) [static]
static void pose_grab_with_ik_clear ( Object ob) [static]
static void posttrans_action_clean ( bAnimContext ac,
bAction act 
) [static]
static void posttrans_fcurve_clean ( FCurve fcu,
const short  use_handle 
) [static]
static void posttrans_gpd_clean ( bGPdata gpd) [static]
static void qsort_trans_data ( TransInfo t,
TransData head,
TransData tail,
TransData temp 
) [static]
void remake_graph_transdata ( TransInfo t,
ListBase anim_data 
)
static TransData* SeqToTransData ( TransData td,
TransData2D td2d,
TransDataSeq tdsq,
Sequence seq,
int  flag,
int  sel_flag 
) [static]
static int SeqToTransData_Recursive ( TransInfo t,
ListBase seqbase,
TransData td,
TransData2D td2d,
TransDataSeq tdsq 
) [static]
static int SeqTransCount ( TransInfo t,
ListBase seqbase,
int  depth 
) [static]
static void SeqTransInfo ( TransInfo t,
Sequence seq,
int *  recursive,
int *  count,
int *  flag 
) [static]
static void set_prop_dist ( TransInfo t,
short  with_dist 
) [static]
static void set_trans_object_base_flags ( TransInfo t) [static]
static void sort_time_beztmaps ( BeztMap bezms,
int  totvert,
const short   UNUSEDuse_handle 
) [static]
static void sort_trans_data ( TransInfo t) [static]

Definition at line 182 of file transform_conversions.c.

References TransInfo::data, TransData::flag, TD_SELECTED, and TransInfo::total.

Referenced by createTransData().

void sort_trans_data_dist ( TransInfo t)
void special_aftertrans_update ( bContext C,
TransInfo t 
)

Definition at line 4764 of file transform_conversions.c.

References ANIM_animdata_filter(), ANIM_animdata_get_context(), ANIM_editkeyframes_refresh(), ANIM_nla_mapping_apply_fcurve(), ANIM_nla_mapping_get(), ANIMCONT_ACTION, ANIMCONT_DOPESHEET, ANIMCONT_GPENCIL, ANIMCONT_SHAPEKEY, ANIMFILTER_CURVE_VISIBLE, ANIMFILTER_DATA_VISIBLE, ANIMFILTER_FOREDIT, apply_targetless_ik(), ARM_DELAYDEFORM, TransInfo::around, autokeyframe_ob_cb_func(), autokeyframe_pose_cb_func(), Object::avs, Scene::basact, BKE_nlastrips_clear_metas(), BKE_nlatrack_sort_strips(), BKE_ptcache_ids_from_object(), BKE_ptcache_object_reset(), BLI_freelistN(), PTCacheID::cache, bPose::chanbase, clear_trans_object_base_flags(), CONSTRAINT_IK_AUTO, count_set_pose_transflags(), CTX_AUTOCONFIRM, DAG_id_tag_update(), TransInfo::data, data, Object::data, bAnimListElem::data, bAnimContext::data, bAnimContext::datatype, ED_context_get_markers(), ED_markers_post_apply_transform(), ED_nla_postop_refresh(), ED_node_link_insert(), ED_node_link_intersect_test(), ED_node_update_hierarchy(), ED_objects_recalculate_paths(), ED_space_clip(), SpaceNode::edittree, ELEM, EM_automerge(), FALSE, filter(), ListBase::first, PointCache::flag, TransData::flag, bArmature::flag, bKinematicConstraint::flag, TransInfo::flag, SpaceIpo::flag, SpaceAction::flag, SpaceSeq::flag, TransInfo::frame_side, G, has_targetless_ik(), i, bGPdata::id, Object::id, MovieClip::id, ID_REAL_USERS, if(), bAnimListElem::key_data, Scene::markers, MAX_DUPLI_RECUR, mesh_octree_table(), Object::mode, TransInfo::mode, MOTIONPATH_BAKE_HAS_PATHS, NC_SCENE, ND_NODES, PTCacheID::next, bPoseChannel::next, ID::next, bAnimListElem::next, Scene::nodetree, nodeUpdateID(), NULL, TransData::ob, ob_get_key(), OB_MESH, OB_MODE_PARTICLE_EDIT, OB_RECALC_DATA, OB_RECALC_OB, OB_RECALC_TIME, TransInfo::obedit, Base::object, TransInfo::options, bAnimVizSettings::path_bakeflag, PE_get_current(), Object::pose, pose_grab_with_ik_clear(), TransInfo::poseobj, posttrans_action_clean(), posttrans_fcurve_clean(), posttrans_gpd_clean(), PTCACHE_OUTDATED, PTCACHE_RESET_OUTDATED, PTCACHE_TYPE_PARTICLES, Object::recalc, TransInfo::redraw, TransInfo::sa, SACTION_MARKERS_MOVE, SACTION_MOVING, SACTION_NOTRANSKEYCULL, TransInfo::scene, SEQ_MARKER_TRANS, SIPO_NOHANDLES, SIPO_NOTRANSKEYCULL, SPACE_ACTION, SPACE_CLIP, SPACE_IPO, SPACE_NLA, SPACE_NODE, SPACE_SEQ, SPACE_VIEW3D, ScrArea::spacedata, TransInfo::spacetype, TransInfo::state, NlaTrack::strips, T_AUTOIK, T_POSE, TD_NOACTION, TD_SKIP, TFM_DUMMY, TFM_SEQ_SLIDE, TFM_TIME_DUPLICATE, TFM_TIME_EXTEND, TFM_TIME_SCALE, TFM_TIME_TRANSLATE, TFM_TRANSLATION, TransInfo::total, TRANS_CANCEL, transformApply(), TREDRAW_HARD, PTCacheID::type, Object::type, TransInfo::values, TransInfo::view, where_is_pose(), and WM_event_add_notifier().

Referenced by calculateTransformCenter(), and transformEnd().

static void TimeToTransData ( TransData td,
float *  time,
AnimData adt 
) [static]

Definition at line 2928 of file transform_conversions.c.

References TransData::extra, TransData::ival, and TransData::val.

Referenced by ActionFCurveToTransData().

static void trackToTransData ( SpaceClip sc,
TransData td,
TransData2D td2d,
TransDataTracking tdt,
MovieTrackingTrack track 
) [static]
static void transDataTrackingFree ( TransInfo t) [static]
void transform_autoik_update ( TransInfo t,
short  mode 
)
static void UVsToTransData ( SpaceImage sima,
TransData td,
TransData2D td2d,
float *  uv,
int  selected 
) [static]
static void VertsToTransData ( TransInfo t,
TransData td,
EditMesh em,
EditVert eve 
) [static]

Variable Documentation