diff options
author | Joshua Leung <aligorith@gmail.com> | 2011-11-12 08:40:53 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2011-11-12 08:40:53 +0400 |
commit | 8da281210063e3216d19848ecc82545fb1aeb58f (patch) | |
tree | 2b7d10e08685c0980c2cee21aeb846d66a51d97a /source/blender/blenkernel | |
parent | 4e83c67baa9ee50d9f1620186ce71de68c21202f (diff) |
Bugfix [#29125] Motion paths odd behaviour
* Made it impossible to try to calculate/create new motion paths lasting 0
frames (i.e. 250 to 250) since we cannot allocate a zero-length array for these.
Start frame can now be at most end-frame - 1, and end frame at least start frame
+ 1
* If an invalid configuration does occur, warnings/reports will now be issued in
response to this instead of silently failing (as per this bugreport).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_anim.h | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/anim.c | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/BKE_anim.h b/source/blender/blenkernel/BKE_anim.h index 44aebdf6205..c2b4e30ef3b 100644 --- a/source/blender/blenkernel/BKE_anim.h +++ b/source/blender/blenkernel/BKE_anim.h @@ -40,6 +40,7 @@ struct ListBase; struct bAnimVizSettings; struct bMotionPath; struct bPoseChannel; +struct ReportList; /* ---------------------------------------------------- */ /* Animation Visualisation */ @@ -49,7 +50,7 @@ void animviz_settings_init(struct bAnimVizSettings *avs); void animviz_free_motionpath_cache(struct bMotionPath *mpath); void animviz_free_motionpath(struct bMotionPath *mpath); -struct bMotionPath *animviz_verify_motionpaths(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan); +struct bMotionPath *animviz_verify_motionpaths(struct ReportList *reports, struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan); void animviz_get_object_motionpaths(struct Object *ob, ListBase *targets); void animviz_calc_motionpaths(struct Scene *scene, ListBase *targets); diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index c1f294fb102..36df1101a24 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -67,6 +67,7 @@ #include "BKE_utildefines.h" #include "BKE_depsgraph.h" #include "BKE_anim.h" +#include "BKE_report.h" // XXX bad level call... @@ -147,7 +148,7 @@ void animviz_free_motionpath(bMotionPath *mpath) * - ob: object to add paths for (must be provided) * - pchan: posechannel to add paths for (optional; if not provided, object-paths are assumed) */ -bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel *pchan) +bMotionPath *animviz_verify_motionpaths(ReportList *reports, Scene *scene, Object *ob, bPoseChannel *pchan) { bAnimVizSettings *avs; bMotionPath *mpath, **dst; @@ -170,6 +171,11 @@ bMotionPath *animviz_verify_motionpaths(Scene *scene, Object *ob, bPoseChannel * /* avoid 0 size allocs */ if (avs->path_sf >= avs->path_ef) { + BKE_reportf(reports, RPT_ERROR, + "Motion Path frame extents invalid for %s (%d to %d).%s\n", + (pchan)? pchan->name : ob->id.name, + avs->path_sf, avs->path_ef, + (avs->path_sf == avs->path_ef)? " Cannot have single-frame paths." : ""); return NULL; } |