80 int current_id_index = 0;
84 ids[current_id_index++] = &mpt->ob->id;
120 mpt->
mpath = pchan->mpath;
144 if ((cframe < mpath->start_frame) || (cframe >= mpath->
end_frame)) {
151 Object *ob_eval = mpt->ob_eval;
171 mul_m4_v3(ob_eval->object_to_world().ptr(), mpv->
co);
175 copy_v3_v3(mpv->
co, ob_eval->object_to_world().location());
185 float mframe =
float(cframe);
199 mpath_eval = (pchan_eval) ? pchan_eval->
mpath :
nullptr;
202 mpath_eval = ob_eval->
mpath;
205 if (mpath_eval && mpath_eval->
length == mpath->
length) {
219 if (mpt->
pchan !=
nullptr) {
222 return &mpt->
ob->
avs;
230 *r_sfra =
min_ii(*r_sfra, mpt->mpath->start_frame);
231 *r_efra =
max_ii(*r_efra, mpt->mpath->end_frame);
238 if (current_frame <= mpt->mpath->start_frame) {
242 float current_frame_float = current_frame;
265 float current_frame_float = current_frame;
286 if (adt ==
nullptr || fcurve_list ==
nullptr) {
306 if (current_frame < mpt->mpath->start_frame || current_frame > mpt->
mpath->
end_frame) {
337 if (fcu_sfra <= fcu_efra) {
338 *r_sfra =
min_ii(*r_sfra, fcu_sfra);
339 *r_efra =
max_ii(*r_efra, fcu_efra);
390 BLI_assert_msg(
false,
"This should not happen, function should have exited earlier.");
409 if (
ELEM(
nullptr, targets, targets->
first)) {
413 const int cfra = scene->
r.
cfra;
414 int sfra = INT_MAX, efra = INT_MIN;
421 if (cfra < sfra || cfra > efra) {
450 if (is_active_depsgraph) {
486 int mpt_sfra, mpt_efra;
488 if (mpt_sfra <= mpt_efra) {
489 sfra =
min_ii(sfra, mpt_sfra);
490 efra =
max_ii(efra, mpt_efra);
503 "Calculating MotionPaths between frames %d - %d (%d frames)",
525 scene->
r.
cfra = cfra;
530 if (is_active_depsgraph) {
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)
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(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)
Object * DEG_get_evaluated_object(const Depsgraph *depsgraph, Object *object)
@ 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.
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a or normal between camera
static void motionpaths_calc_bake_targets(ListBase *targets, int cframe, Depsgraph *depsgraph, Object *camera)
static void motionpath_get_global_framerange(ListBase *targets, int *r_sfra, int *r_efra)
static bool motionpath_check_can_use_keyframe_range(MPathTarget *, AnimData *adt, ListBase *fcurve_list)
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)
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 int motionpath_get_next_next_keyframe(MPathTarget *mpt, AnimKeylist *keylist, int current_frame)
void animviz_motionpath_compute_range(Object *ob, Scene *scene)
static bAnimVizSettings * animviz_target_settings_get(MPathTarget *mpt)
static void motionpaths_calc_update_scene(Depsgraph *depsgraph)
static int motionpath_get_next_keyframe(MPathTarget *mpt, AnimKeylist *keylist, int current_frame)
static void motionpath_calculate_update_range(MPathTarget *mpt, AnimData *adt, ListBase *fcurve_list, int current_frame, int *r_sfra, int *r_efra)
Depsgraph * animviz_depsgraph_build(Main *bmain, Scene *scene, ViewLayer *view_layer, ListBase *targets)
static void motionpath_free_free_tree_data(ListBase *targets)
BPy_StructRNA * depsgraph
draw_view in_light_buf[] float
const ActKeyColumn * ED_keylist_find_prev(const AnimKeylist *keylist, const float cfra)
bool ED_keylist_selected_keys_frame_range(const AnimKeylist *keylist, Range2f *r_frame_range)
void ED_keylist_prepare_for_direct_access(AnimKeylist *keylist)
bool ED_keylist_all_keys_frame_range(const AnimKeylist *keylist, Range2f *r_frame_range)
AnimKeylist * ED_keylist_create()
void ED_keylist_free(AnimKeylist *keylist)
void fcurve_to_keylist(AnimData *adt, FCurve *fcu, AnimKeylist *keylist, const int saction_flag, blender::float2 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)
Vector< FCurve * > fcurves_for_assigned_action(AnimData *adt)
VecBase< T, 3 > transform_point(const CartesianBasis &basis, const VecBase< T, 3 > &v)
GPUBatchHandle * batch_line
GPUVertBufHandle * points_vbo
GPUBatchHandle * batch_points