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:
authorPhilipp Oeser <info@graphics-engineer.com>2021-11-25 15:45:32 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2021-11-28 18:23:16 +0300
commitc2971eea8434f6487ffa6e77d604c775a97b13ef (patch)
treef45c1bf4da5246503ce33d06a798cf5e5345fdae
parent647578b1439520544e26b119fe3d42e2dd0e0ff9 (diff)
Fix T93338: Curve Guide force field crash
Caused by {rBcf2baa585cc8}. For Curve Guide force fields to work, the `Path Animation` option has to be enabled. With it disabled, we are lacking the necessary `anim_path_accum_length` data initialized [done by `BKE_anim_path_calc_data`] which `BKE_where_on_path` relies on since above commit. Now just check for this before using it - and return early otherwise. Prior to said commit, `BKE_where_on_path` would equally return early with a similar message, so that is expected behavior here. Maniphest Tasks: T93338 Differential Revision: https://developer.blender.org/D13371
-rw-r--r--source/blender/blenkernel/intern/anim_path.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/anim_path.c b/source/blender/blenkernel/intern/anim_path.c
index af2b386a30a..3edfdaf7ffa 100644
--- a/source/blender/blenkernel/intern/anim_path.c
+++ b/source/blender/blenkernel/intern/anim_path.c
@@ -254,6 +254,10 @@ bool BKE_where_on_path(const Object *ob,
CLOG_WARN(&LOG, "No curve cache!");
return false;
}
+ if (ob->runtime.curve_cache->anim_path_accum_length == NULL) {
+ CLOG_WARN(&LOG, "No anim path!");
+ return false;
+ }
/* We only use the first curve. */
BevList *bl = ob->runtime.curve_cache->bev.first;
if (bl == NULL || !bl->nr) {