diff options
author | Joseph Eagar <joeedh@gmail.com> | 2010-03-09 07:32:40 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2010-03-09 07:32:40 +0300 |
commit | 71003b9bcc88ecf6138c3debb9abba4637c8e61a (patch) | |
tree | 7f85d40231311a36a72f731a7c07b8dbd6fff577 /source/blender/blenkernel/intern/effect.c | |
parent | ea540496c8281dcba899fb6b29c1bcfbb53a0482 (diff) | |
parent | 790d6ca256e6b572826b2bf214c6fd6c8a623969 (diff) |
merge with trunk at r27259 and commit of a patch by anthony jones to fix msvc (though further work may be needed because changes made by the merge
Diffstat (limited to 'source/blender/blenkernel/intern/effect.c')
-rw-r--r-- | source/blender/blenkernel/intern/effect.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 0f4d09f82d3..f8193a3a7b0 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. * All rights reserved. @@ -593,7 +593,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin float cfra = eff->scene->r.cfra; int ret = 0; - if(eff->pd->shape==PFIELD_SHAPE_SURFACE && eff->surmd) { + if(eff->pd && eff->pd->shape==PFIELD_SHAPE_SURFACE && eff->surmd) { /* closest point in the object surface is an effector */ float vec[3]; @@ -606,7 +606,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin efd->size = 0.0f; } - else if(eff->pd->shape==PFIELD_SHAPE_POINTS) { + else if(eff->pd && eff->pd->shape==PFIELD_SHAPE_POINTS) { if(eff->ob->derivedFinal) { DerivedMesh *dm = eff->ob->derivedFinal; @@ -658,6 +658,8 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin Object *ob = eff->ob; Object obcopy = *ob; + /* XXX this is not thread-safe, but used from multiple threads by + particle system */ where_is_object_time(eff->scene, ob, cfra); /* use z-axis as normal*/ @@ -665,7 +667,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin normalize_v3(efd->nor); /* for vortex the shape chooses between old / new force */ - if(eff->pd->shape == PFIELD_SHAPE_PLANE) { + if(eff->pd && eff->pd->shape == PFIELD_SHAPE_PLANE) { /* efd->loc is closes point on effector xy-plane */ float temp[3]; sub_v3_v3v3(temp, point->loc, ob->obmat[3]); @@ -696,7 +698,7 @@ int get_effector_data(EffectorCache *eff, EffectorData *efd, EffectedPoint *poin efd->distance = len_v3(efd->vec_to_point); /* rest length for harmonic effector, will have to see later if this could be extended to other effectors */ - if(eff->pd->forcefield == PFIELD_HARMONIC && eff->pd->f_size) + if(eff->pd && eff->pd->forcefield == PFIELD_HARMONIC && eff->pd->f_size) mul_v3_fl(efd->vec_to_point, (efd->distance-eff->pd->f_size)/efd->distance); if(eff->flag & PE_USE_NORMAL_DATA) { |