Merging r58266 through r58279 from trunk into soc-2013-depsgraph_mt
[blender.git] / source / blender / blenkernel / intern / effect.c
index 0df8684044a082efb64133faedfa810eb6a50b20..81b0de9fd32c59bd0ed63b6ef058161388c91a93 100644 (file)
@@ -67,6 +67,7 @@
 #include "BKE_blender.h"
 #include "BKE_collision.h"
 #include "BKE_constraint.h"
+#include "BKE_curve.h"
 #include "BKE_deform.h"
 #include "BKE_depsgraph.h"
 #include "BKE_displist.h"
@@ -176,10 +177,10 @@ static void precalculate_effector(EffectorCache *eff)
        if (eff->pd->forcefield == PFIELD_GUIDE && eff->ob->type==OB_CURVE) {
                Curve *cu= eff->ob->data;
                if (cu->flag & CU_PATH) {
-                       if (cu->path==NULL || cu->path->data==NULL)
+                       if (eff->ob->curve_cache == NULL || eff->ob->curve_cache->path==NULL || eff->ob->curve_cache->path->data==NULL)
                                BKE_displist_make_curveTypes(eff->scene, eff->ob, 0);
 
-                       if (cu->path && cu->path->data) {
+                       if (eff->ob->curve_cache->path && eff->ob->curve_cache->path->data) {
                                where_on_path(eff->ob, 0.0, eff->guide_loc, eff->guide_dir, NULL, &eff->guide_radius, NULL);
                                mul_m4_v3(eff->ob->obmat, eff->guide_loc);
                                mul_mat3_m4_v3(eff->ob->obmat, eff->guide_dir);