79 int current_id_index = 0;
81 ids[current_id_index++] = &mpt->ob->id;
115 mpt->
mpath = pchan->mpath;
148 if ((cframe < mpath->start_frame) || (cframe >= mpath->
end_frame)) {
155 Object *ob_eval = mpt->ob_eval;
175 mul_m4_v3(ob_eval->object_to_world().ptr(), mpv->
co);
179 copy_v3_v3(mpv->
co, ob_eval->object_to_world().location());
189 float mframe =
float(cframe);
203 mpath_eval = (pchan_eval) ? pchan_eval->
mpath :
nullptr;
206 mpath_eval = ob_eval->
mpath;
209 if (mpath_eval && mpath_eval->
length == mpath->
length) {
223 if (mpt->
pchan !=
nullptr) {
226 return &mpt->
ob->
avs;
236 *r_sfra =
min_ii(*r_sfra, mpt->mpath->start_frame);
237 *r_efra =
max_ii(*r_efra, mpt->mpath->end_frame);
245 if (current_frame <= mpt->mpath->start_frame) {
249 float current_frame_float = current_frame;
272 float current_frame_float = current_frame;
293 if (adt ==
nullptr || fcurves.
is_empty()) {
313 if (current_frame < mpt->mpath->start_frame || current_frame > mpt->
mpath->
end_frame) {
330 for (
FCurve *fcu : fcurves) {
344 if (fcu_sfra <= fcu_efra) {
345 *r_sfra =
min_ii(*r_sfra, fcu_sfra);
346 *r_efra =
max_ii(*r_efra, fcu_efra);
397 BLI_assert_msg(
false,
"This should not happen, function should have exited earlier.");
420 const int cfra = scene->
r.
cfra;
421 int sfra = INT_MAX, efra = INT_MIN;
428 if (cfra < sfra || cfra > efra) {
457 if (is_active_depsgraph) {
508 int mpt_sfra, mpt_efra;
510 if (mpt_sfra <= mpt_efra) {
511 sfra =
min_ii(sfra, mpt_sfra);
512 efra =
max_ii(efra, mpt_efra);
524 "Calculating MotionPaths between frames %d - %d (%d frames)",
546 scene->
r.
cfra = cfra;
551 if (is_active_depsgraph) {
Functions and classes to work with Actions.
Functions for backward compatibility with the legacy Action API.
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
bool ANIM_bonecoll_is_visible_pchan(const bArmature *armature, const bPoseChannel *pchan)
Blender kernel action and pose functionality.
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
bActionGroup * BKE_action_group_find_name(bAction *act, const char name[])
AnimData * BKE_animdata_from_id(const ID *id)
void BKE_scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain)
void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
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,...)
Depsgraph * DEG_graph_new(Main *bmain, Scene *scene, ViewLayer *view_layer, eEvaluationMode mode)
bool DEG_is_active(const Depsgraph *depsgraph)
void DEG_make_inactive(Depsgraph *depsgraph)
void DEG_make_active(Depsgraph *depsgraph)
void DEG_graph_build_from_ids(Depsgraph *graph, blender::Span< ID * > ids)
T * DEG_get_evaluated(const Depsgraph *depsgraph, T *id)
@ MOTIONPATH_RANGE_KEYS_ALL
@ MOTIONPATH_RANGE_KEYS_SELECTED
@ MOTIONPATH_RANGE_MANUAL
@ MOTIONPATH_FLAG_BAKE_CAMERA
@ 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.
Depsgraph * animviz_depsgraph_build(Main *bmain, Scene *scene, ViewLayer *view_layer, blender::Span< MPathTarget * > targets)
static void motionpaths_calc_bake_targets(blender::Span< MPathTarget * > targets, int cframe, Depsgraph *depsgraph, Object *camera)
static void motionpath_get_global_framerange(blender::Span< MPathTarget * > targets, int *r_sfra, int *r_efra)
static void motionpath_calculate_update_range(MPathTarget *mpt, AnimData *adt, blender::Vector< FCurve * > fcurves, int current_frame, int *r_sfra, int *r_efra)
static int motionpath_get_prev_prev_keyframe(MPathTarget *mpt, AnimKeylist *keylist, int current_frame)
static int motionpath_get_prev_keyframe(MPathTarget *mpt, AnimKeylist *keylist, int current_frame)
static bool motionpath_check_can_use_keyframe_range(MPathTarget *, AnimData *adt, blender::Span< FCurve * > fcurves)
void animviz_free_motionpath_targets(blender::Vector< MPathTarget * > &targets)
static int motionpath_get_next_next_keyframe(MPathTarget *mpt, AnimKeylist *keylist, int current_frame)
void animviz_motionpath_compute_range(Object *ob, Scene *scene)
static void motionpaths_calc_update_scene(Depsgraph *depsgraph)
static void motionpath_free_free_tree_data(blender::MutableSpan< MPathTarget * > targets)
static int motionpath_get_next_keyframe(MPathTarget *mpt, AnimKeylist *keylist, int current_frame)
static bAnimVizSettings * animviz_target_settings_get(const MPathTarget *mpt)
void animviz_calc_motionpaths(Depsgraph *depsgraph, Main *bmain, Scene *scene, blender::MutableSpan< MPathTarget * > targets, eAnimvizCalcRange range, bool restore)
void animviz_build_motionpath_targets(Object *ob, blender::Vector< MPathTarget * > &r_targets)
BPy_StructRNA * depsgraph
constexpr bool is_empty() const
constexpr int64_t size() const
constexpr bool is_empty() const
void append(const T &value)
bool is_action_layered() const
const bActionGroup * channel_group_find(StringRef name) const
const ActKeyColumn * ED_keylist_find_prev(const AnimKeylist *keylist, const float cfra)
void fcurve_to_keylist(AnimData *adt, FCurve *fcu, AnimKeylist *keylist, const int saction_flag, blender::float2 range, const bool use_nla_remapping)
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist)
bool ED_keylist_all_keys_frame_range(const AnimKeylist *keylist, Bounds< float > *r_frame_range)
AnimKeylist * ED_keylist_create()
void ED_keylist_free(AnimKeylist *keylist)
bool ED_keylist_selected_keys_frame_range(const AnimKeylist *keylist, Bounds< float > *r_frame_range)
const ActKeyColumn * ED_keylist_find_next(const AnimKeylist *keylist, const float cfra)
const ActKeyColumn * ED_keylist_find_exact(const AnimKeylist *keylist, const float cfra)
void action_to_keylist(AnimData *adt, bAction *dna_action, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void action_group_to_keylist(AnimData *adt, bActionGroup *agrp, AnimKeylist *keylist, const int saction_flag, blender::float2 range)
void * MEM_callocN(size_t len, const char *str)
void MEM_freeN(void *vmemh)
Vector< FCurve * > fcurves_for_assigned_action(AnimData *adt)
bool assigned_action_has_keyframes(AnimData *adt)
const animrig::Channelbag * channelbag_for_action_slot(const Action &action, slot_handle_t slot_handle)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
Vector< T * > listbase_to_vector(ListBase &list)
GPUBatchHandle * batch_line
GPUVertBufHandle * points_vbo
GPUBatchHandle * batch_points