[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13748] trunk/blender/source/blender/ blenkernel/intern/particle_system.c: particle bug - Edit Particles could reference invalid face indices's,

Campbell Barton ideasman42 at gmail.com
Mon Feb 18 15:06:50 CET 2008


Revision: 13748
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13748
Author:   campbellbarton
Date:     2008-02-18 15:06:45 +0100 (Mon, 18 Feb 2008)

Log Message:
-----------
particle bug - Edit Particles could reference invalid face indices's,
Now particles lookup every face in the derived mesh to be placed on the mesh.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/particle_system.c

Modified: trunk/blender/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle_system.c	2008-02-18 13:38:16 UTC (rev 13747)
+++ trunk/blender/source/blender/blenkernel/intern/particle_system.c	2008-02-18 14:06:45 UTC (rev 13748)
@@ -233,8 +233,9 @@
 					pa->num_dmcache= GET_INT_FROM_POINTER(nodearray[pa->num]->link);
 			}
 			else { /* FROM_FACE/FROM_VOLUME */
-				i= psys_particle_dm_face_lookup(ob, dm, pa->num, pa->fuv, nodearray[pa->num]);
-				pa->num_dmcache= i;
+				/* Note that somtimes the pa->num is over the nodearray size, this is bad, maybe there is a better place to fix this,
+				 * but for now passing NULL is OK. every face will be searched for the particle so its slower - Campbell */
+				pa->num_dmcache= psys_particle_dm_face_lookup(ob, dm, pa->num, pa->fuv, pa->num < totelem ? nodearray[pa->num] : NULL);
 			}
 		}
 





More information about the Bf-blender-cvs mailing list