74 int current_id_index = 0;
76 ids[current_id_index++] = &mpt->ob->id;
131 for (mpt = targets->
first; mpt; mpt = mpt->
next) {
137 if ((cframe < mpath->start_frame) || (cframe >= mpath->
end_frame)) {
171 float mframe = (
float)(cframe);
185 mpath_eval = (pchan_eval) ? pchan_eval->
mpath :
NULL;
188 mpath_eval = ob_eval->
mpath;
191 if (mpath_eval && mpath_eval->
length == mpath->
length) {
208 return &mpt->
ob->
avs;
216 *r_sfra =
min_ii(*r_sfra, mpt->mpath->start_frame);
217 *r_efra =
max_ii(*r_efra, mpt->mpath->end_frame);
226 if (current_frame <= mpt->mpath->start_frame) {
230 float current_frame_float = current_frame;
255 float current_frame_float = current_frame;
276 if (adt ==
NULL || fcurve_list ==
NULL) {
296 if (current_frame < mpt->mpath->start_frame || current_frame > mpt->
mpath->
end_frame) {
327 if (fcu_sfra <= fcu_efra) {
328 *r_sfra =
min_ii(*r_sfra, fcu_sfra);
329 *r_efra =
max_ii(*r_efra, fcu_efra);
371 BLI_assert_msg(
false,
"This should not happen, function should have exited earlier.");
395 int sfra = INT_MAX, efra = INT_MIN;
402 if (cfra < sfra || cfra > efra) {
431 if (is_active_depsgraph) {
467 int mpt_sfra, mpt_efra;
469 if (mpt_sfra <= mpt_efra) {
470 sfra =
min_ii(sfra, mpt_sfra);
471 efra =
max_ii(efra, mpt_efra);
484 "Calculating MotionPaths between frames %d - %d (%d frames)",
511 if (is_active_depsgraph) {
typedef float(TangentPoint)[2]
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
struct bActionGroup * BKE_action_group_find_name(struct bAction *act, const char name[])
struct AnimData * BKE_animdata_from_id(const struct ID *id)
void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain)
void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph)
#define BLI_assert_msg(a, msg)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_listbase_count(const struct ListBase *listbase) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define CLOG_INFO(clg_ref, level,...)
Depsgraph * DEG_graph_new(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer, eEvaluationMode mode)
struct Depsgraph Depsgraph
bool DEG_is_active(const struct Depsgraph *depsgraph)
void DEG_make_active(struct Depsgraph *depsgraph)
void DEG_make_inactive(struct Depsgraph *depsgraph)
void DEG_graph_build_from_ids(struct Depsgraph *graph, struct ID **ids, int num_ids)
struct Object * DEG_get_evaluated_object(const struct Depsgraph *depsgraph, struct Object *object)
@ MOTIONPATH_RANGE_KEYS_ALL
@ MOTIONPATH_RANGE_KEYS_SELECTED
@ ANIMVIZ_CALC_RANGE_FULL
@ ANIMVIZ_CALC_RANGE_CURRENT_FRAME
@ ANIMVIZ_CALC_RANGE_CHANGED
#define GPU_BATCH_DISCARD_SAFE(batch)
#define GPU_VERTBUF_DISCARD_SAFE(verts)
Read Guarded memory(de)allocation.
static int motionpath_get_prev_keyframe(MPathTarget *mpt, struct AnimKeylist *keylist, int current_frame)
static void motionpaths_calc_bake_targets(ListBase *targets, int cframe)
static void motionpath_get_global_framerange(ListBase *targets, int *r_sfra, int *r_efra)
static int motionpath_get_prev_prev_keyframe(MPathTarget *mpt, struct AnimKeylist *keylist, int current_frame)
void animviz_calc_motionpaths(Depsgraph *depsgraph, Main *bmain, Scene *scene, ListBase *targets, eAnimvizCalcRange range, bool restore)
void animviz_get_object_motionpaths(Object *ob, ListBase *targets)
Depsgraph * animviz_depsgraph_build(Main *bmain, Scene *scene, ViewLayer *view_layer, ListBase *targets)
void animviz_motionpath_compute_range(Object *ob, Scene *scene)
static int motionpath_get_next_next_keyframe(MPathTarget *mpt, struct AnimKeylist *keylist, int current_frame)
static bool motionpath_check_can_use_keyframe_range(MPathTarget *UNUSED(mpt), AnimData *adt, ListBase *fcurve_list)
static void motionpath_calculate_update_range(MPathTarget *mpt, AnimData *adt, ListBase *fcurve_list, int current_frame, int *r_sfra, int *r_efra)
static void motionpaths_calc_update_scene(struct Depsgraph *depsgraph)
struct MPathTarget MPathTarget
static void motionpath_free_free_tree_data(ListBase *targets)
static bAnimVizSettings * animviz_target_settings_get(MPathTarget *mpt)
static int motionpath_get_next_keyframe(MPathTarget *mpt, struct AnimKeylist *keylist, int current_frame)
const Depsgraph * depsgraph
void fcurve_to_keylist(AnimData *adt, FCurve *fcu, AnimKeylist *keylist, const int saction_flag)
AnimKeylist * ED_keylist_create()
bool ED_keylist_selected_keys_frame_range(const struct AnimKeylist *keylist, Range2f *r_frame_range)
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist)
const ActKeyColumn * ED_keylist_find_next(const AnimKeylist *keylist, const float cfra)
void ED_keylist_free(AnimKeylist *keylist)
bool ED_keylist_all_keys_frame_range(const struct AnimKeylist *keylist, Range2f *r_frame_range)
void action_to_keylist(AnimData *adt, bAction *act, AnimKeylist *keylist, const int saction_flag)
void agroup_to_keylist(AnimData *adt, bActionGroup *agrp, AnimKeylist *keylist, const int saction_flag)
const ActKeyColumn * ED_keylist_find_prev(const AnimKeylist *keylist, const float cfra)
const ActKeyColumn * ED_keylist_find_exact(const AnimKeylist *keylist, const float cfra)
void *(* MEM_malloc_arrayN)(size_t len, size_t size, const char *str)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
struct AnimKeylist * keylist
struct MPathTarget * next
struct MPathTarget * prev
struct GPUVertBuf * points_vbo
struct GPUBatch * batch_points
struct GPUBatch * batch_line
struct bPoseChannel * next