From 91ee88dfd0a0793708a4746690d3e01d3a5c1802 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 15 Apr 2013 12:04:55 +0000 Subject: Fix #34972: Blender crashes when Force Field-> Curve Guide is created Made it so where_on_path works correct when Curve does have editNurbs but no Curve->nurbs. --- source/blender/blenkernel/intern/anim.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/intern/anim.c') diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index c555b7de5d9..6fa33e8d3c5 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -626,6 +626,7 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua float fac; float data[4]; int cycl = 0, s0, s1, s2, s3; + ListBase *nurbs; if (ob == NULL || ob->type != OB_CURVE) return 0; cu = ob->data; @@ -668,8 +669,11 @@ int where_on_path(Object *ob, float ctime, float vec[4], float dir[3], float qua /* make compatible with vectoquat */ negate_v3(dir); //} - - nu = cu->nurb.first; + + nurbs = BKE_curve_editNurbs_get(cu); + if (!nurbs) + nurbs = &cu->nurb; + nu = nurbs->first; /* make sure that first and last frame are included in the vectors here */ if (nu->type == CU_POLY) key_curve_position_weights(1.0f - fac, data, KEY_LINEAR); -- cgit v1.2.3