[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13724] trunk/blender/source/blender: Removed "roll" and "rotation" child particle kink modes as they couldn' t be made to work properly.

Janne Karhu jhkarh at utu.fi
Sun Feb 17 14:41:43 CET 2008


Revision: 13724
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13724
Author:   jhk
Date:     2008-02-17 14:41:42 +0100 (Sun, 17 Feb 2008)

Log Message:
-----------
Removed "roll" and "rotation" child particle kink modes as they couldn't be made to work properly. Will have to see later if these can be put back in so that they actually work.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/particle.c
    trunk/blender/source/blender/makesdna/DNA_particle_types.h
    trunk/blender/source/blender/src/buttons_object.c

Modified: trunk/blender/source/blender/blenkernel/intern/particle.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/particle.c	2008-02-17 12:46:09 UTC (rev 13723)
+++ trunk/blender/source/blender/blenkernel/intern/particle.c	2008-02-17 13:41:42 UTC (rev 13724)
@@ -1436,61 +1436,8 @@
 				}
 			}
 			break;
-		//case PART_KINK_ROT:
-		//	vec[axis]=1.0;
-
-		//	QuatMulVecf(par->rot,vec);
-
-		//	VecMulf(vec,amplitude*(float)sin(t));
-
-		//	VECADD(state->co,state->co,vec);
-		//	break;
 	}
 }
-static void do_postkink(ParticleKey *state, ParticleKey *par, float *par_rot, float time, float freq, float shape, float amplitude, short type, short axis, float obmat[][4])
-{
-	static ParticleKey first;
-	static float q[4];
-	float vec[3]={0.0,0.0,0.0};
-	float t;
-
-	CLAMP(time,0.0,1.0);
-
-	t=time;
-
-	t*=(float)M_PI*freq;
-
-	if(par==0) return;
-
-	switch(type){
-		case PART_KINK_ROLL:
-			if(time<(0.5+shape/2.0f)){
-				float *q2;
-				memcpy(&first,state,sizeof(ParticleKey));
-				Normalize(first.vel);
-				if(par_rot)
-					q2=par_rot;
-				else
-					q2=vectoquat(par->vel,axis,(axis+1)%3);
-				QUATCOPY(q,q2);
-			}
-			else{
-				float fac;
-				shape=0.5f+shape/2.0f;
-				t-=(float)M_PI*(shape*freq + 0.5f);
-
-				vec[axis]=1.0;
-				
-				QuatMulVecf(q,vec);
-
-				fac=amplitude*(1.0f+((1.0f-time)/(1.0f-shape)*(float)sin(t)));
-				VECADDFAC(state->co,first.co,vec,fac);
-				fac=amplitude*((1.0f-time)/(1.0f-shape)*(float)cos(t));
-				VECADDFAC(state->co,state->co,first.vel,fac);
-			}
-			break;
-	}
-}
 static void do_clump(ParticleKey *state, ParticleKey *par, float time, float clumpfac, float clumppow, float pa_clump)
 {
 	if(par && clumpfac!=0.0){
@@ -1601,7 +1548,6 @@
 					VECCOPY(key.co,pa_loc);
 					do_prekink(&key, &par, 0, guidetime, pd->kink_freq, pd->kink_shape, pd->kink_amp, pd->kink, pd->kink_axis, 0);
 					do_clump(&key, &par, guidetime, pd->clump_fac, pd->clump_pow, 1.0f);
-					do_postkink(&key, &par, 0, guidetime, pd->kink_freq, pd->kink_shape, pd->kink_amp, pd->kink, pd->kink_axis, 0);
 					VECCOPY(pa_loc,key.co);
 
 					VECADD(pa_loc,pa_loc,guidevec);
@@ -2122,10 +2068,6 @@
 				part->kink_freq * pa_kink, part->kink_shape, part->kink_amp, part->kink, part->kink_axis, ob->obmat);
 					
 			do_clump((ParticleKey*)state, (ParticleKey*)par, t, part->clumpfac, part->clumppow, pa_clump);
-
-			if(part->kink)
-				do_postkink((ParticleKey*)state, (ParticleKey*)par, par->rot, t,
-				part->kink_freq * pa_kink, part->kink_shape, part->kink_amp, part->kink, part->kink_axis, ob->obmat);
 		}
 
 		if(part->flag & PART_BRANCHING && ctx->between == 0 && part->flag & PART_ANIM_BRANCHING)
@@ -3565,10 +3507,6 @@
 		
 		do_clump(state, par, t, part->clumpfac, part->clumppow, 1.0f);
 
-		if(part->kink)
-			do_postkink(state, par, par->rot, t, part->kink_freq * pa_kink, part->kink_shape,
-			part->kink_amp, part->kink, part->kink_axis, ob->obmat);
-
 		if(part->rough1 != 0.0)
 			do_rough(orco, t, part->rough1, part->rough1_size, 0.0, state);
 
@@ -3666,10 +3604,6 @@
 		//	
 		//	/* TODO: pa_clump vgroup */
 		//	do_clump(state,key1,t,part->clumpfac,part->clumppow,0);
-
-		//	if(part->kink)			/* TODO: part->kink_freq*pa_kink */
-		//		do_postkink(state,key1,t,part->kink_freq,part->kink_shape,part->kink_amp,part->kink,part->kink_axis,ob->obmat);
-
 		//}
 		//else{
 			if (pa) { /* TODO PARTICLE - should this ever be NULL? - Campbell */

Modified: trunk/blender/source/blender/makesdna/DNA_particle_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_particle_types.h	2008-02-17 12:46:09 UTC (rev 13723)
+++ trunk/blender/source/blender/makesdna/DNA_particle_types.h	2008-02-17 13:41:42 UTC (rev 13724)
@@ -292,8 +292,6 @@
 #define PART_KINK_RADIAL	2
 #define PART_KINK_WAVE		3
 #define PART_KINK_BRAID		4
-#define PART_KINK_ROT		5
-#define PART_KINK_ROLL		6
 
 /* part->draw */
 #define PART_DRAW_VEL		1

Modified: trunk/blender/source/blender/src/buttons_object.c
===================================================================
--- trunk/blender/source/blender/src/buttons_object.c	2008-02-17 12:46:09 UTC (rev 13723)
+++ trunk/blender/source/blender/src/buttons_object.c	2008-02-17 13:41:42 UTC (rev 13724)
@@ -4034,14 +4034,14 @@
 		/* kink */
 		uiBlockBeginAlign(block);
 		if(part->kink) {
-			uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw/2,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path");
+			uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw/2,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path");
 			uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Axis %t|Z %x2|Y %x1|X %x0", butx+butw/2,buty,butw/2,buth, &part->kink_axis, 14.0, 0.0, 0, 0, "Which axis to use for offset");
 			uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Freq:",			butx,(buty-=buth),butw,buth, &part->kink_freq, 0.0, 10.0, 1, 3, "The frequency of the offset (1/total length)");
 			uiDefButF(block, NUMSLI, B_PART_RECALC_CHILD, "Shape:",		butx,(buty-=buth),butw,buth, &part->kink_shape, -0.999, 0.999, 1, 3, "Adjust the offset to the beginning/end");
 			uiDefButF(block, NUM, B_PART_RECALC_CHILD, "Amplitude:",	butx,(buty-=buth),butw,buth, &part->kink_amp, 0.0, 10.0, 1, 3, "The amplitude of the offset");
 		}
 		else {
-			uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Roll%x6|Rotation%x5|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path");
+			uiDefButS(block, MENU, B_PART_RECALC_CHILD, "Kink:%t|Braid%x4|Wave%x3|Radial%x2|Curl%x1|Nothing%x0", butx,(buty-=buth),butw,buth, &part->kink, 14.0, 0.0, 0, 0, "Type of periodic offset on the path");
 			buty-=3*buth;
 		}
 		uiBlockEndAlign(block);





More information about the Bf-blender-cvs mailing list