[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [12462] branches/particles/source/blender/ blenkernel/intern: hair wasnt working properly before, now adding hair to a subsurf cube works again

Campbell Barton cbarton at metavr.com
Sat Nov 3 20:56:15 CET 2007


Revision: 12462
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=12462
Author:   campbellbarton
Date:     2007-11-03 20:56:14 +0100 (Sat, 03 Nov 2007)

Log Message:
-----------
hair wasnt working properly before, now adding hair to a subsurf cube works again

Modified Paths:
--------------
    branches/particles/source/blender/blenkernel/intern/particle.c
    branches/particles/source/blender/blenkernel/intern/particle_system.c

Modified: branches/particles/source/blender/blenkernel/intern/particle.c
===================================================================
--- branches/particles/source/blender/blenkernel/intern/particle.c	2007-11-03 19:23:13 UTC (rev 12461)
+++ branches/particles/source/blender/blenkernel/intern/particle.c	2007-11-03 19:56:14 UTC (rev 12462)
@@ -804,15 +804,13 @@
 		OrigSpaceFace *osface_node;
 		for(;node;node=node->next) {
 			node_index = (int *)node->link;
-			osface_node = osface+node_index;
-			if (*(oi+node_index) == index) {
-				if ( mface->v4 ) { /* check that this intersects - Its possible this misses :/ - could also check its not between */
-					if (IsectPQ2Df(fuv, osface_node->uv[0], osface_node->uv[1], osface_node->uv[2], osface_node->uv[3])) {
-						return node_index;
-					}
-				} else if (IsectPT2Df(fuv, osface_node->uv[0], osface_node->uv[1], osface_node->uv[2])) {
+			osface_node = osface + node_index;
+			if ( mface->v4 ) { /* check that this intersects - Its possible this misses :/ - could also check its not between */
+				if (IsectPQ2Df(fuv, osface_node->uv[0], osface_node->uv[1], osface_node->uv[2], osface_node->uv[3])) {
 					return node_index;
 				}
+			} else if (IsectPT2Df(fuv, osface_node->uv[0], osface_node->uv[1], osface_node->uv[2])) {
+				return node_index;
 			}
 		}
 	} else { /* if we have no node, try every face */
@@ -923,6 +921,7 @@
 			} else {
 				i = index_dmcache;
 			}
+			
 			printf("Index DMCACHE %i\n", index_dmcache);
 			
 			/* Any time this happens, and the face has not been removed,

Modified: branches/particles/source/blender/blenkernel/intern/particle_system.c
===================================================================
--- branches/particles/source/blender/blenkernel/intern/particle_system.c	2007-11-03 19:23:13 UTC (rev 12461)
+++ branches/particles/source/blender/blenkernel/intern/particle_system.c	2007-11-03 19:56:14 UTC (rev 12462)
@@ -194,7 +194,8 @@
 		for(p=0,pa=psys->particles; p<psys->totpart; p++,pa++) {
 			//i = pa->num;
 			//if (i<totface) // should never happen
-			pa->num_dmcache = psys_particle_dm_face_lookup(dm, p, pa->fuv, node_array[pa->num]);
+			i = psys_particle_dm_face_lookup(dm, p, pa->fuv, node_array[pa->num]);
+			pa->num_dmcache = i;
 		}
 
 		//for (i=0; i < totface; i++) {





More information about the Bf-blender-cvs mailing list