diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2021-11-25 15:45:32 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2021-11-25 16:16:12 +0300 |
commit | ffddf9e5c9175d25078ca441b21e5eb478ecd106 (patch) | |
tree | ed6efd177f9310af4b92c67bcb27192a7e1a4fce /source/blender/blenkernel/intern/anim_path.c | |
parent | 845716e6002752bed1bf78a911a47729816a1c80 (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
Diffstat (limited to 'source/blender/blenkernel/intern/anim_path.c')
-rw-r--r-- | source/blender/blenkernel/intern/anim_path.c | 4 |
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 de470a15041..ff94a04e75e 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) { |