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:
authorSergey Sharybin <sergey.vfx@gmail.com>2013-04-15 16:04:55 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2013-04-15 16:04:55 +0400
commit91ee88dfd0a0793708a4746690d3e01d3a5c1802 (patch)
tree4296c8a55fa75d16241be503600c74b56a4c05ce /source/blender/blenkernel/intern/anim.c
parent82bf87772e5279f91995dda914da74b2a26d3e56 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/anim.c')
-rw-r--r--source/blender/blenkernel/intern/anim.c8
1 files changed, 6 insertions, 2 deletions
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);