Blender V2.61 - r43446
Defines | Functions

anim_sys.c File Reference

#include <stdio.h>
#include <string.h>
#include <stddef.h>
#include <float.h>
#include <math.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_dynstr.h"
#include "BLI_utildefines.h"
#include "DNA_anim_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_scene_types.h"
#include "DNA_texture_types.h"
#include "DNA_world_types.h"
#include "BKE_animsys.h"
#include "BKE_action.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_library.h"
#include "BKE_report.h"
#include "BKE_utildefines.h"
#include "RNA_access.h"
#include "nla_private.h"

Go to the source code of this file.

Defines

#define ANIMDATA_IDS_CB(first)
#define ANIMDATA_NODETREE_IDS_CB(first, NtId_Type)
#define RENAMEFIX_ANIM_IDS(first)
#define RENAMEFIX_ANIM_NODETREE_IDS(first, NtId_Type)
#define ANIMSYS_FLOAT_AS_BOOL(value)   ((value) > ((1.0f-FLT_EPSILON)))
#define EVAL_ANIM_IDS(first, aflag)
#define EVAL_ANIM_NODETREE_IDS(first, NtId_Type, aflag)

Functions

short id_type_can_have_animdata (ID *id)
AnimDataBKE_animdata_from_id (ID *id)
AnimDataBKE_id_add_animdata (ID *id)
short BKE_animdata_set_action (ReportList *reports, ID *id, bAction *act)
void BKE_free_animdata (ID *id)
AnimDataBKE_copy_animdata (AnimData *adt, const short do_action)
int BKE_copy_animdata_id (ID *id_to, ID *id_from, const short do_action)
void BKE_copy_animdata_id_action (ID *id)
static void make_local_strips (ListBase *strips)
void BKE_animdata_make_local (AnimData *adt)
void BKE_relink_animdata (AnimData *adt)
static short animpath_matches_basepath (const char path[], const char basepath[])
void action_move_fcurves_by_basepath (bAction *srcAct, bAction *dstAct, const char basepath[])
void BKE_animdata_separate_by_basepath (ID *srcID, ID *dstID, ListBase *basepaths)
static short check_rna_path_is_valid (ID *owner_id, const char *path)
static char * rna_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, char *oldpath, int verify_paths)
static void fcurves_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, ListBase *curves, int verify_paths)
static void drivers_path_rename_fix (ID *owner_id, const char *prefix, const char *oldName, const char *newName, const char *oldKey, const char *newKey, ListBase *curves, int verify_paths)
static void nlastrips_path_rename_fix (ID *owner_id, const char *prefix, char *oldName, char *newName, ListBase *strips, int verify_paths)
void BKE_animdata_fix_paths_rename (ID *owner_id, AnimData *adt, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, int verify_paths)
void BKE_animdata_main_cb (Main *mainptr, ID_AnimData_Edit_Callback func, void *user_data)
void BKE_all_animdata_fix_paths_rename (const char *prefix, const char *oldName, const char *newName)
KS_PathBKE_keyingset_find_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, int UNUSED(group_mode))
KeyingSetBKE_keyingset_add (ListBase *list, const char name[], short flag, short keyingflag)
KS_PathBKE_keyingset_add_path (KeyingSet *ks, ID *id, const char group_name[], const char rna_path[], int array_index, short flag, short groupmode)
void BKE_keyingset_free_path (KeyingSet *ks, KS_Path *ksp)
void BKE_keyingsets_copy (ListBase *newlist, ListBase *list)
void BKE_keyingset_free (KeyingSet *ks)
void BKE_keyingsets_free (ListBase *list)
static short animsys_remap_path (AnimMapper *UNUSED(remap), char *path, char **dst)
static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_index, float value)
static short animsys_execute_fcurve (PointerRNA *ptr, AnimMapper *remap, FCurve *fcu)
static void animsys_evaluate_fcurves (PointerRNA *ptr, ListBase *list, AnimMapper *remap, float ctime)
static void animsys_evaluate_drivers (PointerRNA *ptr, AnimData *adt, float ctime)
static void action_idcode_patch_check (ID *id, bAction *act)
void animsys_evaluate_action_group (PointerRNA *ptr, bAction *act, bActionGroup *agrp, AnimMapper *remap, float ctime)
void animsys_evaluate_action (PointerRNA *ptr, bAction *act, AnimMapper *remap, float ctime)
static float nlastrip_get_influence (NlaStrip *strip, float cframe)
static void nlastrip_evaluate_controls (NlaStrip *strip, float ctime)
NlaEvalStripnlastrips_ctime_get_strip (ListBase *list, ListBase *strips, short index, float ctime)
static NlaEvalChannelnlaevalchan_find_match (ListBase *channels, PointerRNA *ptr, PropertyRNA *prop, int array_index)
static NlaEvalChannelnlaevalchan_verify (PointerRNA *ptr, ListBase *channels, NlaEvalStrip *nes, FCurve *fcu, short *newChan)
static void nlaevalchan_accumulate (NlaEvalChannel *nec, NlaEvalStrip *nes, short newChan, float value)
static void nlaevalchan_buffers_accumulate (ListBase *channels, ListBase *tmp_buffer, NlaEvalStrip *nes)
static void nlaeval_fmodifiers_join_stacks (ListBase *result, ListBase *list1, ListBase *list2)
static void nlaeval_fmodifiers_split_stacks (ListBase *list1, ListBase *list2)
static void nlastrip_evaluate_actionclip (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
static void nlastrip_evaluate_transition (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
static void nlastrip_evaluate_meta (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
void nlastrip_evaluate (PointerRNA *ptr, ListBase *channels, ListBase *modifiers, NlaEvalStrip *nes)
void nladata_flush_channels (ListBase *channels)
static void animsys_evaluate_nla (ListBase *echannels, PointerRNA *ptr, AnimData *adt, float ctime)
static void animsys_calculate_nla (PointerRNA *ptr, AnimData *adt, float ctime)
static void animsys_evaluate_overrides (PointerRNA *ptr, AnimData *adt)
void BKE_animsys_evaluate_animdata (Scene *scene, ID *id, AnimData *adt, float ctime, short recalc)
void BKE_animsys_evaluate_all_animation (Main *main, Scene *scene, float ctime)

Detailed Description

Definition in file anim_sys.c.


Define Documentation

#define ANIMDATA_IDS_CB (   first)
Value:
for (id= first; id; id= id->next) { \
        AnimData *adt= BKE_animdata_from_id(id); \
        if (adt) func(id, adt, user_data); \
    }

Referenced by BKE_animdata_main_cb().

#define ANIMDATA_NODETREE_IDS_CB (   first,
  NtId_Type 
)
Value:
for (id= first; id; id= id->next) { \
        AnimData *adt= BKE_animdata_from_id(id); \
        NtId_Type *ntp= (NtId_Type *)id; \
        if (ntp->nodetree) { \
            AnimData *adt2= BKE_animdata_from_id((ID *)ntp); \
            if (adt2) func(id, adt2, user_data); \
        } \
        if (adt) func(id, adt, user_data); \
    }

Referenced by BKE_animdata_main_cb().

#define ANIMSYS_FLOAT_AS_BOOL (   value)    ((value) > ((1.0f-FLT_EPSILON)))

Definition at line 1109 of file anim_sys.c.

Referenced by animsys_write_rna_setting(), and nladata_flush_channels().

#define EVAL_ANIM_IDS (   first,
  aflag 
)
Value:
for (id= first; id; id= id->next) { \
        if (ID_REAL_USERS(id) > 0) { \
            AnimData *adt= BKE_animdata_from_id(id); \
            BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag); \
        } \
    }

Referenced by BKE_animsys_evaluate_all_animation().

#define EVAL_ANIM_NODETREE_IDS (   first,
  NtId_Type,
  aflag 
)
Value:
for (id= first; id; id= id->next) { \
        if (ID_REAL_USERS(id) > 0) { \
            AnimData *adt= BKE_animdata_from_id(id); \
            NtId_Type *ntp= (NtId_Type *)id; \
            if (ntp->nodetree) { \
                AnimData *adt2= BKE_animdata_from_id((ID *)ntp->nodetree); \
                BKE_animsys_evaluate_animdata(scene, (ID *)ntp->nodetree, adt2, ctime, ADT_RECALC_ANIM); \
            } \
            BKE_animsys_evaluate_animdata(scene, id, adt, ctime, aflag); \
        } \
    }

Referenced by BKE_animsys_evaluate_all_animation().

#define RENAMEFIX_ANIM_IDS (   first)
Value:
for (id= first; id; id= id->next) { \
        AnimData *adt= BKE_animdata_from_id(id); \
        BKE_animdata_fix_paths_rename(id, adt, prefix, oldName, newName, 0, 0, 1);\
    }

Referenced by BKE_all_animdata_fix_paths_rename().

#define RENAMEFIX_ANIM_NODETREE_IDS (   first,
  NtId_Type 
)
Value:
for (id= first; id; id= id->next) { \
        AnimData *adt= BKE_animdata_from_id(id); \
        NtId_Type *ntp= (NtId_Type *)id; \
        if (ntp->nodetree) { \
            AnimData *adt2= BKE_animdata_from_id((ID *)ntp); \
            BKE_animdata_fix_paths_rename((ID *)ntp, adt2, prefix, oldName, newName, 0, 0, 1);\
        } \
        BKE_animdata_fix_paths_rename(id, adt, prefix, oldName, newName, 0, 0, 1);\
    }

Referenced by BKE_all_animdata_fix_paths_rename().


Function Documentation

static void action_idcode_patch_check ( ID id,
bAction act 
) [static]
void action_move_fcurves_by_basepath ( bAction srcAct,
bAction dstAct,
const char  basepath[] 
)
static short animpath_matches_basepath ( const char  path[],
const char  basepath[] 
) [static]
static void animsys_calculate_nla ( PointerRNA ptr,
AnimData adt,
float  ctime 
) [static]
void animsys_evaluate_action ( PointerRNA ptr,
bAction act,
AnimMapper remap,
float  ctime 
)
void animsys_evaluate_action_group ( PointerRNA ptr,
bAction act,
bActionGroup agrp,
AnimMapper remap,
float  ctime 
)
static void animsys_evaluate_drivers ( PointerRNA ptr,
AnimData adt,
float  ctime 
) [static]
static void animsys_evaluate_fcurves ( PointerRNA ptr,
ListBase list,
AnimMapper remap,
float  ctime 
) [static]
static void animsys_evaluate_nla ( ListBase echannels,
PointerRNA ptr,
AnimData adt,
float  ctime 
) [static]
static void animsys_evaluate_overrides ( PointerRNA ptr,
AnimData adt 
) [static]
static short animsys_execute_fcurve ( PointerRNA ptr,
AnimMapper remap,
FCurve fcu 
) [static]
static short animsys_remap_path ( AnimMapper UNUSEDremap,
char *  path,
char **  dst 
) [static]

Definition at line 1094 of file anim_sys.c.

Referenced by animsys_execute_fcurve(), and nlaevalchan_verify().

static short animsys_write_rna_setting ( PointerRNA ptr,
char *  path,
int  array_index,
float  value 
) [static]
void BKE_all_animdata_fix_paths_rename ( const char *  prefix,
const char *  oldName,
const char *  newName 
)
void BKE_animdata_fix_paths_rename ( ID owner_id,
AnimData adt,
const char *  prefix,
const char *  oldName,
const char *  newName,
int  oldSubscript,
int  newSubscript,
int  verify_paths 
)
AnimData* BKE_animdata_from_id ( ID id) [read]
void BKE_animdata_main_cb ( Main mainptr,
ID_AnimData_Edit_Callback  func,
void *  user_data 
)
void BKE_animdata_make_local ( AnimData adt)
void BKE_animdata_separate_by_basepath ( ID srcID,
ID dstID,
ListBase basepaths 
)
short BKE_animdata_set_action ( ReportList reports,
ID id,
bAction act 
)
void BKE_animsys_evaluate_all_animation ( Main main,
Scene scene,
float  ctime 
)
void BKE_animsys_evaluate_animdata ( Scene scene,
ID id,
AnimData adt,
float  ctime,
short  recalc 
)
AnimData* BKE_copy_animdata ( AnimData adt,
const short  do_action 
) [read]
int BKE_copy_animdata_id ( ID id_to,
ID id_from,
const short  do_action 
)
void BKE_copy_animdata_id_action ( ID id)
void BKE_free_animdata ( ID id)
AnimData* BKE_id_add_animdata ( ID id) [read]
KeyingSet* BKE_keyingset_add ( ListBase list,
const char  name[],
short  flag,
short  keyingflag 
) [read]
KS_Path* BKE_keyingset_add_path ( KeyingSet ks,
ID id,
const char  group_name[],
const char  rna_path[],
int  array_index,
short  flag,
short  groupmode 
) [read]
KS_Path* BKE_keyingset_find_path ( KeyingSet ks,
ID id,
const char  group_name[],
const char  rna_path[],
int  array_index,
int   UNUSEDgroup_mode 
)
void BKE_keyingset_free ( KeyingSet ks)
void BKE_keyingset_free_path ( KeyingSet ks,
KS_Path ksp 
)
void BKE_keyingsets_copy ( ListBase newlist,
ListBase list 
)
void BKE_keyingsets_free ( ListBase list)
void BKE_relink_animdata ( AnimData adt)
static short check_rna_path_is_valid ( ID owner_id,
const char *  path 
) [static]

Definition at line 548 of file anim_sys.c.

References NULL, RNA_id_pointer_create(), and RNA_path_resolve().

Referenced by rna_path_rename_fix().

static void drivers_path_rename_fix ( ID owner_id,
const char *  prefix,
const char *  oldName,
const char *  newName,
const char *  oldKey,
const char *  newKey,
ListBase curves,
int  verify_paths 
) [static]
static void fcurves_path_rename_fix ( ID owner_id,
const char *  prefix,
char *  oldName,
char *  newName,
ListBase curves,
int  verify_paths 
) [static]
short id_type_can_have_animdata ( ID id)
static void make_local_strips ( ListBase strips) [static]
void nladata_flush_channels ( ListBase channels)
static void nlaeval_fmodifiers_join_stacks ( ListBase result,
ListBase list1,
ListBase list2 
) [static]
static void nlaeval_fmodifiers_split_stacks ( ListBase list1,
ListBase list2 
) [static]
static void nlaevalchan_accumulate ( NlaEvalChannel nec,
NlaEvalStrip nes,
short  newChan,
float  value 
) [static]
static void nlaevalchan_buffers_accumulate ( ListBase channels,
ListBase tmp_buffer,
NlaEvalStrip nes 
) [static]
static NlaEvalChannel* nlaevalchan_find_match ( ListBase channels,
PointerRNA ptr,
PropertyRNA prop,
int  array_index 
) [static]
static NlaEvalChannel* nlaevalchan_verify ( PointerRNA ptr,
ListBase channels,
NlaEvalStrip nes,
FCurve fcu,
short *  newChan 
) [static]
void nlastrip_evaluate ( PointerRNA ptr,
ListBase channels,
ListBase modifiers,
NlaEvalStrip nes 
)
static void nlastrip_evaluate_actionclip ( PointerRNA ptr,
ListBase channels,
ListBase modifiers,
NlaEvalStrip nes 
) [static]
static void nlastrip_evaluate_controls ( NlaStrip strip,
float  ctime 
) [static]
static void nlastrip_evaluate_meta ( PointerRNA ptr,
ListBase channels,
ListBase modifiers,
NlaEvalStrip nes 
) [static]
static void nlastrip_evaluate_transition ( PointerRNA ptr,
ListBase channels,
ListBase modifiers,
NlaEvalStrip nes 
) [static]
static float nlastrip_get_influence ( NlaStrip strip,
float  cframe 
) [static]
NlaEvalStrip* nlastrips_ctime_get_strip ( ListBase list,
ListBase strips,
short  index,
float  ctime 
)
static void nlastrips_path_rename_fix ( ID owner_id,
const char *  prefix,
char *  oldName,
char *  newName,
ListBase strips,
int  verify_paths 
) [static]
static char* rna_path_rename_fix ( ID owner_id,
const char *  prefix,
const char *  oldName,
const char *  newName,
char *  oldpath,
int  verify_paths 
) [static]