Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/anim.c
| Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
| #include "BKE_report.h" | #include "BKE_report.h" | ||||
| #include "DEG_depsgraph.h" | #include "DEG_depsgraph.h" | ||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "DEG_depsgraph_build.h" | #include "DEG_depsgraph_build.h" | ||||
| #include "GPU_batch.h" | #include "GPU_batch.h" | ||||
| #include "CLG_log.h" | |||||
| static CLG_LogRef LOG = {"bke.anim"}; | |||||
| // XXX bad level call... | // XXX bad level call... | ||||
| extern short compare_ak_cfraPtr(void *node, void *data); | extern short compare_ak_cfraPtr(void *node, void *data); | ||||
| extern void agroup_to_keylist(struct AnimData *adt, struct bActionGroup *agrp, struct DLRBT_Tree *keys, int saction_flag); | extern void agroup_to_keylist(struct AnimData *adt, struct bActionGroup *agrp, struct DLRBT_Tree *keys, int saction_flag); | ||||
| extern void action_to_keylist(struct AnimData *adt, struct bAction *act, struct DLRBT_Tree *keys, int saction_flag); | extern void action_to_keylist(struct AnimData *adt, struct bAction *act, struct DLRBT_Tree *keys, int saction_flag); | ||||
| /* --------------------- */ | /* --------------------- */ | ||||
| /* forward declarations */ | /* forward declarations */ | ||||
| ▲ Show 20 Lines • Show All 416 Lines • ▼ Show 20 Lines | if (adt) { | ||||
| } | } | ||||
| else { | else { | ||||
| action_to_keylist(adt, adt->action, &mpt->keys, 0); | action_to_keylist(adt, adt->action, &mpt->keys, 0); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* calculate path over requested range */ | /* calculate path over requested range */ | ||||
| printf("Calculating MotionPaths between frames %d - %d (%d frames)\n", sfra, efra, efra - sfra + 1); | CLOG_INFO(&LOG, 1, "Calculating MotionPaths between frames %d - %d (%d frames)", sfra, efra, efra - sfra + 1); | ||||
| for (CFRA = sfra; CFRA <= efra; CFRA++) { | for (CFRA = sfra; CFRA <= efra; CFRA++) { | ||||
| if (current_frame_only) { | if (current_frame_only) { | ||||
| /* For current frame, only update tagged. */ | /* For current frame, only update tagged. */ | ||||
| BKE_scene_graph_update_tagged(depsgraph, bmain); | BKE_scene_graph_update_tagged(depsgraph, bmain); | ||||
| } | } | ||||
| else { | else { | ||||
| /* Update relevant data for new frame. */ | /* Update relevant data for new frame. */ | ||||
| motionpaths_calc_update_scene(bmain, depsgraph); | motionpaths_calc_update_scene(bmain, depsgraph); | ||||
| ▲ Show 20 Lines • Show All 194 Lines • ▼ Show 20 Lines | int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float quat[4], float *radius, float *weight) | ||||
| float fac; | float fac; | ||||
| float data[4]; | float data[4]; | ||||
| int cycl = 0, s0, s1, s2, s3; | int cycl = 0, s0, s1, s2, s3; | ||||
| ListBase *nurbs; | ListBase *nurbs; | ||||
| if (ob == NULL || ob->type != OB_CURVE) return 0; | if (ob == NULL || ob->type != OB_CURVE) return 0; | ||||
| cu = ob->data; | cu = ob->data; | ||||
| if (ob->runtime.curve_cache == NULL || ob->runtime.curve_cache->path == NULL || ob->runtime.curve_cache->path->data == NULL) { | if (ob->runtime.curve_cache == NULL || ob->runtime.curve_cache->path == NULL || ob->runtime.curve_cache->path->data == NULL) { | ||||
| printf("no path!\n"); | CLOG_WARN(&LOG, "no path!"); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| path = ob->runtime.curve_cache->path; | path = ob->runtime.curve_cache->path; | ||||
| pp = path->data; | pp = path->data; | ||||
| /* test for cyclic */ | /* test for cyclic */ | ||||
| bl = ob->runtime.curve_cache->bev.first; | bl = ob->runtime.curve_cache->bev.first; | ||||
| if (!bl) return 0; | if (!bl) return 0; | ||||
| ▲ Show 20 Lines • Show All 78 Lines • Show Last 20 Lines | |||||