[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [38194] branches/soc-2011-pepper: Merging trunk up to r38193.

Joerg Mueller nexyon at gmail.com
Thu Jul 7 18:34:19 CEST 2011


Revision: 38194
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38194
Author:   nexyon
Date:     2011-07-07 16:34:19 +0000 (Thu, 07 Jul 2011)
Log Message:
-----------
Merging trunk up to r38193.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=38193

Modified Paths:
--------------
    branches/soc-2011-pepper/source/blender/collada/MeshImporter.cpp
    branches/soc-2011-pepper/source/blender/collada/MeshImporter.h
    branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c
    branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner.c
    branches/soc-2011-pepper/source/blender/makesrna/intern/rna_pose.c
    branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
    branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/SConscript

Property Changed:
----------------
    branches/soc-2011-pepper/


Property changes on: branches/soc-2011-pepper
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk/blender:36830-38167
   + /trunk/blender:36830-38193

Modified: branches/soc-2011-pepper/source/blender/collada/MeshImporter.cpp
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/MeshImporter.cpp	2011-07-07 16:09:57 UTC (rev 38193)
+++ branches/soc-2011-pepper/source/blender/collada/MeshImporter.cpp	2011-07-07 16:34:19 UTC (rev 38194)
@@ -144,15 +144,18 @@
 }
 #endif
 
-void UVDataWrapper::getUV(int uv_index[2], float *uv)
+void UVDataWrapper::getUV(int uv_index, float *uv)
 {
+	int stride = mVData->getStride(0);
+	if(stride==0) stride = 2;
+
 	switch(mVData->getType()) {
 	case COLLADAFW::MeshVertexData::DATA_TYPE_FLOAT:
 		{
 			COLLADAFW::ArrayPrimitiveType<float>* values = mVData->getFloatValues();
 			if (values->empty()) return;
-			uv[0] = (*values)[uv_index[0]];
-			uv[1] = (*values)[uv_index[1]];
+			uv[0] = (*values)[uv_index*stride];
+			uv[1] = (*values)[uv_index*stride + 1];
 			
 		}
 		break;
@@ -160,8 +163,8 @@
 		{
 			COLLADAFW::ArrayPrimitiveType<double>* values = mVData->getDoubleValues();
 			if (values->empty()) return;
-			uv[0] = (float)(*values)[uv_index[0]];
-			uv[1] = (float)(*values)[uv_index[1]];
+			uv[0] = (float)(*values)[uv_index*stride];
+			uv[1] = (float)(*values)[uv_index*stride + 1];
 			
 		}
 		break;
@@ -197,54 +200,36 @@
 void MeshImporter::set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
 				 COLLADAFW::IndexList& index_list, unsigned int *tris_indices)
 {
-	int uv_indices[4][2];
-
 	// per face vertex indices, this means for quad we have 4 indices, not 8
 	COLLADAFW::UIntValuesArray& indices = index_list.getIndices();
 
-	// make indices into FloatOrDoubleArray
-	for (int i = 0; i < 3; i++) {
-		int uv_index = indices[tris_indices[i]];
-		uv_indices[i][0] = uv_index * 2;
-		uv_indices[i][1] = uv_index * 2 + 1;
-	}
-
-	uvs.getUV(uv_indices[0], mtface->uv[0]);
-	uvs.getUV(uv_indices[1], mtface->uv[1]);
-	uvs.getUV(uv_indices[2], mtface->uv[2]);
+	uvs.getUV(indices[tris_indices[0]], mtface->uv[0]);
+	uvs.getUV(indices[tris_indices[1]], mtface->uv[1]);
+	uvs.getUV(indices[tris_indices[2]], mtface->uv[2]);
 }
 
 void MeshImporter::set_face_uv(MTFace *mtface, UVDataWrapper &uvs,
 				COLLADAFW::IndexList& index_list, int index, bool quad)
 {
-	int uv_indices[4][2];
-
 	// per face vertex indices, this means for quad we have 4 indices, not 8
 	COLLADAFW::UIntValuesArray& indices = index_list.getIndices();
 
-	// make indices into FloatOrDoubleArray
-	for (int i = 0; i < (quad ? 4 : 3); i++) {
-		int uv_index = indices[index + i];
-		uv_indices[i][0] = uv_index * 2;
-		uv_indices[i][1] = uv_index * 2 + 1;
-	}
+	uvs.getUV(indices[index + 0], mtface->uv[0]);
+	uvs.getUV(indices[index + 1], mtface->uv[1]);
+	uvs.getUV(indices[index + 2], mtface->uv[2]);
 
-	uvs.getUV(uv_indices[0], mtface->uv[0]);
-	uvs.getUV(uv_indices[1], mtface->uv[1]);
-	uvs.getUV(uv_indices[2], mtface->uv[2]);
+	if (quad) uvs.getUV(indices[index + 3], mtface->uv[3]);
 
-	if (quad) uvs.getUV(uv_indices[3], mtface->uv[3]);
-
 #ifdef COLLADA_DEBUG
 	/*if (quad) {
 		fprintf(stderr, "face uv:\n"
-				"((%d, %d), (%d, %d), (%d, %d), (%d, %d))\n"
+				"((%d, %d, %d, %d))\n"
 				"((%.1f, %.1f), (%.1f, %.1f), (%.1f, %.1f), (%.1f, %.1f))\n",
 
-				uv_indices[0][0], uv_indices[0][1],
-				uv_indices[1][0], uv_indices[1][1],
-				uv_indices[2][0], uv_indices[2][1],
-				uv_indices[3][0], uv_indices[3][1],
+				indices[index + 0],
+				indices[index + 1],
+				indices[index + 2],
+				indices[index + 3],
 
 				mtface->uv[0][0], mtface->uv[0][1],
 				mtface->uv[1][0], mtface->uv[1][1],
@@ -253,12 +238,12 @@
 	}
 	else {
 		fprintf(stderr, "face uv:\n"
-				"((%d, %d), (%d, %d), (%d, %d))\n"
+				"((%d, %d, %d))\n"
 				"((%.1f, %.1f), (%.1f, %.1f), (%.1f, %.1f))\n",
 
-				uv_indices[0][0], uv_indices[0][1],
-				uv_indices[1][0], uv_indices[1][1],
-				uv_indices[2][0], uv_indices[2][1],
+				indices[index + 0],
+				indices[index + 1],
+				indices[index + 2],
 
 				mtface->uv[0][0], mtface->uv[0][1],
 				mtface->uv[1][0], mtface->uv[1][1],

Modified: branches/soc-2011-pepper/source/blender/collada/MeshImporter.h
===================================================================
--- branches/soc-2011-pepper/source/blender/collada/MeshImporter.h	2011-07-07 16:09:57 UTC (rev 38193)
+++ branches/soc-2011-pepper/source/blender/collada/MeshImporter.h	2011-07-07 16:34:19 UTC (rev 38194)
@@ -69,7 +69,7 @@
 	void print();
 #endif
 
-	void getUV(int uv_index[2], float *uv);
+	void getUV(int uv_index, float *uv);
 };
 
 class MeshImporter : public MeshImporterBase

Modified: branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c	2011-07-07 16:09:57 UTC (rev 38193)
+++ branches/soc-2011-pepper/source/blender/editors/interface/interface_templates.c	2011-07-07 16:34:19 UTC (rev 38194)
@@ -34,6 +34,7 @@
 #include "MEM_guardedalloc.h"
 
 #include "DNA_anim_types.h"
+#include "DNA_key_types.h"
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
 
@@ -2093,6 +2094,7 @@
 	}
 	else if(itemptr->type == &RNA_ShapeKey) {
 		Object *ob= (Object*)activeptr->data;
+		Key *key= (Key*)itemptr->data;
 
 		split= uiLayoutSplit(sub, 0.75f, 0);
 
@@ -2100,7 +2102,7 @@
 
 		uiBlockSetEmboss(block, UI_EMBOSSN);
 		row= uiLayoutRow(split, 1);
-		if(i == 0) uiItemL(row, "", ICON_NONE);
+		if(i == 0 || (key->type != KEY_RELATIVE)) uiItemL(row, "", ICON_NONE);
 		else uiItemR(row, itemptr, "value", 0, "", ICON_NONE);
 
 		if(ob->mode == OB_MODE_EDIT && !((ob->shapeflag & OB_SHAPE_EDIT_MODE) && ob->type == OB_MESH))

Modified: branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner.c
===================================================================
--- branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner.c	2011-07-07 16:09:57 UTC (rev 38193)
+++ branches/soc-2011-pepper/source/blender/editors/space_outliner/outliner.c	2011-07-07 16:34:19 UTC (rev 38194)
@@ -5262,7 +5262,7 @@
 	outliner_draw_selection(ar, soops, &soops->tree, &starty);
 	
 	// grey hierarchy lines
-	UI_ThemeColorBlend(TH_BACK, TH_TEXT, 0.2f);
+	UI_ThemeColorBlend(TH_BACK, TH_TEXT, 0.4f);
 	starty= (int)ar->v2d.tot.ymax-UI_UNIT_Y/2-OL_Y_OFFSET;
 	startx= 6;
 	outliner_draw_hierarchy(soops, &soops->tree, startx, &starty);

Modified: branches/soc-2011-pepper/source/blender/makesrna/intern/rna_pose.c
===================================================================
--- branches/soc-2011-pepper/source/blender/makesrna/intern/rna_pose.c	2011-07-07 16:09:57 UTC (rev 38193)
+++ branches/soc-2011-pepper/source/blender/makesrna/intern/rna_pose.c	2011-07-07 16:34:19 UTC (rev 38194)
@@ -585,6 +585,25 @@
 	pchan_apply_mat4(pchan, (float (*)[4])values, FALSE); /* no compat for predictable result */
 }
 
+static void rna_PoseChannel_matrix_set(PointerRNA *ptr, const float *values)
+{
+	bPoseChannel *pchan= (bPoseChannel*)ptr->data;
+	Object *ob= (Object*)ptr->id.data;
+	float umat[4][4]= MAT4_UNITY;
+	float tmat[4][4];
+
+	/* recalculate pose matrix with only parent transformations,
+	 * bone loc/sca/rot is ignored, scene and frame are not used. */
+	where_is_pose_bone(NULL, ob, pchan, 0.0f, FALSE);
+
+	/* find the matrix, need to remove the bone transforms first so this is
+	 * calculated as a matrix to set rather then a difference ontop of whats
+	 * already there. */
+	pchan_apply_mat4(pchan, umat, FALSE);
+	armature_mat_pose_to_bone(pchan, (float (*)[4])values, tmat);
+	pchan_apply_mat4(pchan, tmat, FALSE); /* no compat for predictable result */
+}
+
 #else
 
 static void rna_def_bone_group(BlenderRNA *brna)
@@ -830,8 +849,9 @@
 	prop= RNA_def_property(srna, "matrix", PROP_FLOAT, PROP_MATRIX);
 	RNA_def_property_float_sdna(prop, NULL, "pose_mat");
 	RNA_def_property_multi_array(prop, 2, matrix_dimsize);
-	RNA_def_property_clear_flag(prop, PROP_EDITABLE); 
+	RNA_def_property_float_funcs(prop, NULL, "rna_PoseChannel_matrix_set", NULL);
 	RNA_def_property_ui_text(prop, "Pose Matrix", "Final 4x4 matrix after constraints and drivers are applied (object space)");
+	RNA_def_property_update(prop, NC_OBJECT|ND_POSE, "rna_Pose_update");
 
 	/* Head/Tail Coordinates (in Pose Space) - Automatically calculated... */
 	prop= RNA_def_property(srna, "head", PROP_FLOAT, PROP_TRANSLATION);

Modified: branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp
===================================================================
--- branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2011-07-07 16:09:57 UTC (rev 38193)
+++ branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp	2011-07-07 16:34:19 UTC (rev 38194)
@@ -64,6 +64,7 @@
 #include "BKE_node.h"	
 #include "BKE_report.h"
 #include "BKE_library.h"
+#include "BLI_threads.h"
 #include "BLI_blenlib.h"
 #include "DNA_scene_types.h"
 #include "DNA_userdef_types.h"
@@ -399,7 +400,11 @@
 		  ::DisposeNibReference(nibRef);
     */
 #endif // __APPLE__
-
+	
+	// We don't use threads directly in the BGE, but we need to call this so things like
+	// freeing up GPU_Textures works correctly.
+	BLI_threadapi_init();
+	
 	RNA_init();
 
 	init_nodesystem();

Modified: branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/SConscript
===================================================================
--- branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/SConscript	2011-07-07 16:09:57 UTC (rev 38193)
+++ branches/soc-2011-pepper/source/gameengine/GamePlayer/ghost/SConscript	2011-07-07 16:34:19 UTC (rev 38194)
@@ -40,6 +40,8 @@
         '#source/blender/gpu',
         '#extern/glew/include']
 
+incs.append(env['BF_PTHREADS_INC'])
+
 defs = [ 'GLEW_STATIC' ]
 
 if env['WITH_BF_PYTHON']:




More information about the Bf-blender-cvs mailing list