Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2011-11-12 08:40:53 +0400
committerJoshua Leung <aligorith@gmail.com>2011-11-12 08:40:53 +0400
commit8da281210063e3216d19848ecc82545fb1aeb58f (patch)
tree2b7d10e08685c0980c2cee21aeb846d66a51d97a /source/blender/blenkernel/intern/anim.c
parent4e83c67baa9ee50d9f1620186ce71de68c21202f (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/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c8
1 files changed, 7 insertions, 1 deletions
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;
}