[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21237] branches/soc-2009-yukishiro/source /blender: a minor fix related to derived mesh again

Jingyuan Huang jingyuan.huang at gmail.com
Mon Jun 29 20:19:53 CEST 2009


Revision: 21237
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21237
Author:   yukishiro
Date:     2009-06-29 20:19:53 +0200 (Mon, 29 Jun 2009)

Log Message:
-----------
a minor fix related to derived mesh again

Modified Paths:
--------------
    branches/soc-2009-yukishiro/source/blender/blenkernel/intern/customdata.c
    branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
    branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c

Modified: branches/soc-2009-yukishiro/source/blender/blenkernel/intern/customdata.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/blenkernel/intern/customdata.c	2009-06-29 18:14:55 UTC (rev 21236)
+++ branches/soc-2009-yukishiro/source/blender/blenkernel/intern/customdata.c	2009-06-29 18:19:53 UTC (rev 21237)
@@ -831,6 +831,8 @@
 {
 	const LayerTypeInfo *typeInfo;
 
+	if (layer->type == CD_MSHCOEFFS) totelem = layer->totelem;
+
 	if(!(layer->flag & CD_FLAG_NOFREE) && layer->data) {
 		typeInfo = layerType_getInfo(layer->type);
 

Modified: branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c	2009-06-29 18:14:55 UTC (rev 21236)
+++ branches/soc-2009-yukishiro/source/blender/editors/space_view3d/drawobject.c	2009-06-29 18:19:53 UTC (rev 21237)
@@ -2451,7 +2451,7 @@
 				glColorMaterial(GL_FRONT,GL_DIFFUSE);
 				glEnable(GL_COLOR_MATERIAL); 
 				
-				dm->drawFacesColored(dm, me->flag, shcol, NULL);
+				dm->drawFacesColored(dm, 0, shcol, NULL); // single-sided
 				glDisable(GL_COLOR_MATERIAL);
 				GPU_disable_material();
 			} 

Modified: branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c
===================================================================
--- branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c	2009-06-29 18:14:55 UTC (rev 21236)
+++ branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c	2009-06-29 18:19:53 UTC (rev 21237)
@@ -589,13 +589,11 @@
 		if (coeffs != NULL && !recompute) continue;
 
 		if (coeffs == NULL) {
-			coeffs= MEM_callocN(sizeof(MShCoeffs) * num_verts, "sh coeffs");
-			CustomData_add_layer(&me->vdata, CD_MSHCOEFFS, CD_ASSIGN, coeffs, num_verts);
+			coeffs = CustomData_add_layer(&me->vdata, CD_MSHCOEFFS, CD_CALLOC, NULL, num_verts);
 		}
 		else if (recompute) {
-			MEM_freeN(coeffs);
-			coeffs= MEM_callocN(sizeof(MShCoeffs) * num_verts, "sh coeffs");
-			CustomData_set_layer(&me->vdata, CD_MSHCOEFFS, coeffs);
+			CustomData_free_layer_active(&me->vdata, CD_MSHCOEFFS, 0); // totelem is kept within the layer
+			coeffs = CustomData_add_layer(&me->vdata, CD_MSHCOEFFS, CD_CALLOC, NULL, num_verts);
 		}
 
                 for (i = 0; i < num_verts; i++) {
@@ -740,16 +738,11 @@
 void SH_rotateLightEnv(LightEnv *env, float *quat)
 {
 	int deg, l, m, n;
-	float q[3], eul[3];
+	float eul[3];
 	float new_coeffs[25][3];
 	ShWigner wigner;
 
-	// XXX
-	q[0]= quat[0];
-	q[1]= quat[2];
-	q[2]= quat[1];
-	q[3]= quat[3];
-	QuatToEul(q, eul);
+	QuatToEul(quat, eul);
 
 	// create wigner
 	deg = env->degree;





More information about the Bf-blender-cvs mailing list