[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11520] branches/soc-2007-red_fox: Merge 11384:11517 from /trunk/blender

Levi Schooley redfox at hhofministries.org
Wed Aug 8 22:30:21 CEST 2007


Revision: 11520
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11520
Author:   red_fox
Date:     2007-08-08 22:30:20 +0200 (Wed, 08 Aug 2007)

Log Message:
-----------
Merge 11384:11517 from /trunk/blender

Just my weekly sync with /trunk/blender.

Levi

Modified Paths:
--------------
    branches/soc-2007-red_fox/intern/bsp/intern/BSP_CSGMesh_CFIterator.h
    branches/soc-2007-red_fox/intern/opennl/extern/ONL_opennl.h
    branches/soc-2007-red_fox/intern/opennl/intern/opennl.c
    branches/soc-2007-red_fox/release/scripts/3ds_import.py
    branches/soc-2007-red_fox/release/scripts/DirectX8Importer.py
    branches/soc-2007-red_fox/release/scripts/ac3d_import.py
    branches/soc-2007-red_fox/release/scripts/bpymodules/colladaImEx/collada.py
    branches/soc-2007-red_fox/release/scripts/bpymodules/colladaImEx/cstartup.py
    branches/soc-2007-red_fox/release/scripts/bpymodules/colladaImEx/cutils.py
    branches/soc-2007-red_fox/release/scripts/bpymodules/colladaImEx/helperObjects.py
    branches/soc-2007-red_fox/release/scripts/bpymodules/colladaImEx/xmlUtils.py
    branches/soc-2007-red_fox/release/scripts/bvh_import.py
    branches/soc-2007-red_fox/release/scripts/colladaExport14.py
    branches/soc-2007-red_fox/release/scripts/colladaImport14.py
    branches/soc-2007-red_fox/release/scripts/export_fbx.py
    branches/soc-2007-red_fox/release/scripts/import_obj.py
    branches/soc-2007-red_fox/release/scripts/lightwave_import.py
    branches/soc-2007-red_fox/release/scripts/ply_import.py
    branches/soc-2007-red_fox/release/scripts/vertexpaint_selfshadow_ao.py
    branches/soc-2007-red_fox/release/text/BlenderQuickStart.pdf
    branches/soc-2007-red_fox/source/blender/blenkernel/BKE_DerivedMesh.h
    branches/soc-2007-red_fox/source/blender/blenkernel/BKE_global.h
    branches/soc-2007-red_fox/source/blender/blenkernel/BKE_lattice.h
    branches/soc-2007-red_fox/source/blender/blenkernel/BKE_modifier.h
    branches/soc-2007-red_fox/source/blender/blenkernel/BKE_object.h
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/DerivedMesh.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/action.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/anim.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/armature.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/constraint.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/ipo.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/key.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/modifier.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/object.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/softbody.c
    branches/soc-2007-red_fox/source/blender/blenkernel/intern/subsurf_ccg.c
    branches/soc-2007-red_fox/source/blender/include/BIF_editarmature.h
    branches/soc-2007-red_fox/source/blender/include/BIF_editconstraint.h
    branches/soc-2007-red_fox/source/blender/include/BIF_interface.h
    branches/soc-2007-red_fox/source/blender/include/BIF_poseobject.h
    branches/soc-2007-red_fox/source/blender/include/BIF_resources.h
    branches/soc-2007-red_fox/source/blender/include/BSE_editipo.h
    branches/soc-2007-red_fox/source/blender/include/multires.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_action_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_armature_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_curve_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_mesh_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_modifier_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_object_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_screen_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_sequence_types.h
    branches/soc-2007-red_fox/source/blender/makesdna/DNA_space_types.h
    branches/soc-2007-red_fox/source/blender/python/BPY_extern.h
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Armature.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Blender.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Constraint.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Curve.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Draw.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Draw.h
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Effect.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Material.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/Mathutils.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/SurfNurb.c
    branches/soc-2007-red_fox/source/blender/python/api2_2x/doc/Blender.py
    branches/soc-2007-red_fox/source/blender/python/api2_2x/doc/Draw.py
    branches/soc-2007-red_fox/source/blender/python/api2_2x/doc/Mesh.py
    branches/soc-2007-red_fox/source/blender/python/api2_2x/sceneSequence.h
    branches/soc-2007-red_fox/source/blender/render/intern/source/convertblender.c
    branches/soc-2007-red_fox/source/blender/render/intern/source/rayshade.c
    branches/soc-2007-red_fox/source/blender/render/intern/source/raytrace.c
    branches/soc-2007-red_fox/source/blender/render/intern/source/shadeoutput.c
    branches/soc-2007-red_fox/source/blender/src/buttons_editing.c
    branches/soc-2007-red_fox/source/blender/src/drawobject.c
    branches/soc-2007-red_fox/source/blender/src/editarmature.c
    branches/soc-2007-red_fox/source/blender/src/interface_draw.c
    branches/soc-2007-red_fox/source/blender/src/outliner.c
    branches/soc-2007-red_fox/source/blender/src/poseobject.c
    branches/soc-2007-red_fox/source/gameengine/Converter/BL_SkinDeformer.cpp
    branches/soc-2007-red_fox/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp

Added Paths:
-----------
    branches/soc-2007-red_fox/release/scripts/bpymodules/colladaImEx/translator.py
    branches/soc-2007-red_fox/source/blender/include/BIF_meshlaplacian.h

Removed Paths:
-------------
    branches/soc-2007-red_fox/release/scripts/bpymodules/colladaImEx/translator.py

Modified: branches/soc-2007-red_fox/intern/bsp/intern/BSP_CSGMesh_CFIterator.h
===================================================================
--- branches/soc-2007-red_fox/intern/bsp/intern/BSP_CSGMesh_CFIterator.h	2007-08-08 18:24:02 UTC (rev 11519)
+++ branches/soc-2007-red_fox/intern/bsp/intern/BSP_CSGMesh_CFIterator.h	2007-08-08 20:30:20 UTC (rev 11520)
@@ -125,7 +125,8 @@
 	
 	BSP_CSGMesh_VertexIt * v_it = new BSP_CSGMesh_VertexIt;
 	v_it->mesh = mesh;
-	v_it->pos = &mesh->VertexSet()[0];
+	if( output->num_elements > 0 )
+		v_it->pos = &mesh->VertexSet()[0];
 	output->it = v_it;
 };			
 
@@ -257,11 +258,11 @@
 	
 	BSP_CSGMesh_FaceIt * f_it = new BSP_CSGMesh_FaceIt;
 	f_it->mesh = mesh;
-	f_it->pos = &mesh->FaceSet()[0];
+	if( output->num_elements > 0 )
+		f_it->pos = &mesh->FaceSet()[0];
 	f_it->face_triangle = 0;
 
 	output->it = f_it;
-
 };
 
 

Modified: branches/soc-2007-red_fox/intern/opennl/extern/ONL_opennl.h
===================================================================
--- branches/soc-2007-red_fox/intern/opennl/extern/ONL_opennl.h	2007-08-08 18:24:02 UTC (rev 11519)
+++ branches/soc-2007-red_fox/intern/opennl/extern/ONL_opennl.h	2007-08-08 20:30:20 UTC (rev 11520)
@@ -131,10 +131,12 @@
 void nlEnd(NLenum primitive);
 void nlCoefficient(NLuint index, NLfloat value);
 
-/* Setting random elements matrix/vector - not for least squares! */
+/* Setting random elements matrix/vector - not supported for
+   least squares! */
 
 void nlMatrixAdd(NLuint row, NLuint col, NLfloat value);
 void nlRightHandSideAdd(NLuint index, NLfloat value);
+void nlRightHandSideSet(NLuint index, NLfloat value);
 
 /* Solve */
 

Modified: branches/soc-2007-red_fox/intern/opennl/intern/opennl.c
===================================================================
--- branches/soc-2007-red_fox/intern/opennl/intern/opennl.c	2007-08-08 18:24:02 UTC (rev 11519)
+++ branches/soc-2007-red_fox/intern/opennl/intern/opennl.c	2007-08-08 20:30:20 UTC (rev 11520)
@@ -441,6 +441,7 @@
 	NLfloat  value;
 	NLboolean locked;
 	NLuint	index;
+	__NLRowColumn *a;
 } __NLVariable;
 
 #define __NL_STATE_INITIAL				0
@@ -453,13 +454,13 @@
 
 typedef struct {
 	NLenum		   state;
+	NLuint		   n;
 	__NLVariable*	variable;
-	NLuint		   n;
+	NLfloat*		b;
 	__NLSparseMatrix M;
 	__NLRowColumn	af;
 	__NLRowColumn	al;
 	NLfloat*		x;
-	NLfloat*		b;
 	NLfloat		 right_hand_side;
 	NLuint		   nb_variables;
 	NLuint		   current_row;
@@ -472,8 +473,8 @@
 	NLboolean		alloc_variable;
 	NLboolean		alloc_x;
 	NLboolean		alloc_b;
-	NLfloat		 error;
-	__NLMatrixFunc   matrix_vector_prod;
+	NLfloat			error;
+	__NLMatrixFunc	matrix_vector_prod;
 
 	struct __NLSuperLUContext {
 		NLboolean alloc_slu;
@@ -503,6 +504,8 @@
 
 void nlDeleteContext(NLContext context_in) {
 	__NLContext* context = (__NLContext*)(context_in);
+	int i;
+
 	if(__nlCurrentContext == context) {
 		__nlCurrentContext = NULL;
 	}
@@ -516,14 +519,19 @@
 		__nlRowColumnDestroy(&context->al);
 	}
 	if(context->alloc_variable) {
-		__NL_DELETE_ARRAY(context->variable);
+		for(i=0; i<context->nb_variables; i++) {
+			if(context->variable[i].a) {
+				__nlRowColumnDestroy(context->variable[i].a);
+				__NL_DELETE(context->variable[i].a);
+			}
+		}
 	}
+	if(context->alloc_b) {
+		__NL_DELETE_ARRAY(context->b);
+	}
 	if(context->alloc_x) {
 		__NL_DELETE_ARRAY(context->x);
 	}
-	if(context->alloc_b) {
-		__NL_DELETE_ARRAY(context->b);
-	}
 	if (context->slu.alloc_slu) {
 		__nlFree_SUPERLU(context);
 	}
@@ -727,8 +735,10 @@
 
 static void __nlVariablesToVector() {
 	NLuint i;
+
 	__nl_assert(__nlCurrentContext->alloc_x);
 	__nl_assert(__nlCurrentContext->alloc_variable);
+
 	for(i=0; i<__nlCurrentContext->nb_variables; i++) {
 		__NLVariable* v = &(__nlCurrentContext->variable[i]);
 		if(!v->locked) {
@@ -740,8 +750,10 @@
 
 static void __nlVectorToVariables() {
 	NLuint i;
+
 	__nl_assert(__nlCurrentContext->alloc_x);
 	__nl_assert(__nlCurrentContext->alloc_variable);
+
 	for(i=0; i<__nlCurrentContext->nb_variables; i++) {
 		__NLVariable* v = &(__nlCurrentContext->variable[i]);
 		if(!v->locked) {
@@ -760,8 +772,8 @@
 		__nlTransition(__NL_STATE_INITIAL, __NL_STATE_SYSTEM);
 
 		__nlCurrentContext->variable = __NL_NEW_ARRAY(
-			__NLVariable, __nlCurrentContext->nb_variables
-		);
+			__NLVariable, __nlCurrentContext->nb_variables);
+		
 		__nlCurrentContext->alloc_variable = NL_TRUE;
 	}
 }
@@ -771,69 +783,93 @@
 }
 
 static void __nlBeginMatrix() {
-	NLuint i;
+	NLuint i, j;
 	NLuint n = 0;
 	NLenum storage = __NL_ROWS;
+	__NLContext *context = __nlCurrentContext;
 
 	__nlTransition(__NL_STATE_SYSTEM, __NL_STATE_MATRIX);
 
-	if (!__nlCurrentContext->solve_again) {
-		for(i=0; i<__nlCurrentContext->nb_variables; i++) {
-			if(!__nlCurrentContext->variable[i].locked)
-				__nlCurrentContext->variable[i].index = n++;
+	if (!context->solve_again) {
+		for(i=0; i<context->nb_variables; i++) {
+			if(context->variable[i].locked) {
+				context->variable[i].index = ~0;
+				context->variable[i].a = __NL_NEW(__NLRowColumn);
+				__nlRowColumnConstruct(context->variable[i].a);
+			}
 			else
-				__nlCurrentContext->variable[i].index = ~0;
+				context->variable[i].index = n++;
 		}
 
-		__nlCurrentContext->n = n;
+		context->n = n;
 
 		/* a least squares problem results in a symmetric matrix */
-		if(__nlCurrentContext->least_squares)
-			__nlCurrentContext->symmetric = NL_TRUE;
+		if(context->least_squares)
+			context->symmetric = NL_TRUE;
 
-		if(__nlCurrentContext->symmetric)
+		if(context->symmetric)
 			storage = (storage | __NL_SYMMETRIC);
 
 		/* SuperLU storage does not support symmetric storage */
 		storage = (storage & ~__NL_SYMMETRIC);
 
-		__nlSparseMatrixConstruct(&__nlCurrentContext->M, n, n, storage);
-		__nlCurrentContext->alloc_M = NL_TRUE;
+		__nlSparseMatrixConstruct(&context->M, n, n, storage);
+		context->alloc_M = NL_TRUE;
 
-		__nlCurrentContext->x = __NL_NEW_ARRAY(NLfloat, n);
-		__nlCurrentContext->alloc_x = NL_TRUE;
-		
-		__nlCurrentContext->b = __NL_NEW_ARRAY(NLfloat, n);
-		__nlCurrentContext->alloc_b = NL_TRUE;
+		context->b = __NL_NEW_ARRAY(NLfloat, n);
+		context->alloc_b = NL_TRUE;
+
+		context->x = __NL_NEW_ARRAY(NLfloat, n);
+		context->alloc_x = NL_TRUE;
 	}
 	else {
 		/* need to recompute b only, A is not constructed anymore */
-		__NL_CLEAR_ARRAY(NLfloat, __nlCurrentContext->b, __nlCurrentContext->n);
+		__NL_CLEAR_ARRAY(NLfloat, context->b, context->n);
 	}
 
 	__nlVariablesToVector();
 
-	__nlRowColumnConstruct(&__nlCurrentContext->af);
-	__nlCurrentContext->alloc_af = NL_TRUE;
-	__nlRowColumnConstruct(&__nlCurrentContext->al);
-	__nlCurrentContext->alloc_al = NL_TRUE;
+	__nlRowColumnConstruct(&context->af);
+	context->alloc_af = NL_TRUE;
+	__nlRowColumnConstruct(&context->al);
+	context->alloc_al = NL_TRUE;
 
-	__nlCurrentContext->current_row = 0;
+	context->current_row = 0;
 }
 
 static void __nlEndMatrix() {
+	__NLContext *context = __nlCurrentContext;
+	__NLVariable *variable;
+	__NLRowColumn *a;
+	NLfloat *b;
+	NLuint i, j;
+
 	__nlTransition(__NL_STATE_MATRIX, __NL_STATE_MATRIX_CONSTRUCTED);	
 	
-	__nlRowColumnDestroy(&__nlCurrentContext->af);
-	__nlCurrentContext->alloc_af = NL_FALSE;
-	__nlRowColumnDestroy(&__nlCurrentContext->al);
-	__nlCurrentContext->alloc_al = NL_FALSE;
+	__nlRowColumnDestroy(&context->af);
+	context->alloc_af = NL_FALSE;
+	__nlRowColumnDestroy(&context->al);
+	context->alloc_al = NL_FALSE;
 	
+	b = context->b;
+
+	for(i=0; i<__nlCurrentContext->nb_variables; i++) {
+		variable = &(context->variable[i]);
+
+		if(variable->locked) {
+			a = variable->a;
+
+			for(j=0; j<a->size; j++) {
+				b[a->coeff[j].index] -= a->coeff[j].value*variable->value;
+			}
+		}
+	}
+
 #if 0
-	if(!__nlCurrentContext->least_squares) {
+	if(!context->least_squares) {
 		__nl_assert(
-			__nlCurrentContext->current_row == 
-			__nlCurrentContext->n
+			context->current_row == 
+			context->n
 		);
 	}
 #endif
@@ -895,26 +931,61 @@
 
 void nlMatrixAdd(NLuint row, NLuint col, NLfloat value)
 {
-	__NLSparseMatrix* M  = &__nlCurrentContext->M;
+	__NLContext *context = __nlCurrentContext;
+
 	__nlCheckState(__NL_STATE_MATRIX);
-	__nl_range_assert(row, 0, __nlCurrentContext->n - 1);
-	__nl_range_assert(col, 0, __nlCurrentContext->nb_variables - 1);
-	__nl_assert(!__nlCurrentContext->least_squares);
+	__nl_assert(!context->least_squares);
 
-	__nlSparseMatrixAdd(M, row, col, value);
+	if (context->variable[row].locked);
+	else if (context->variable[col].locked) {
+		row = context->variable[row].index;
+		__nlRowColumnAppend(context->variable[col].a, row, value);
+	}
+	else {
+		__NLSparseMatrix* M  = &context->M;
+
+		row = context->variable[row].index;
+		col = context->variable[col].index;
+		
+		__nl_range_assert(row, 0, context->n - 1);
+		__nl_range_assert(col, 0, context->n - 1);
+
+		__nlSparseMatrixAdd(M, row, col, value);
+	}
 }
 
 void nlRightHandSideAdd(NLuint index, NLfloat value)
 {
-	NLfloat* b = __nlCurrentContext->b;
+	__NLContext *context = __nlCurrentContext;
+	NLfloat* b = context->b;
 
 	__nlCheckState(__NL_STATE_MATRIX);
-	__nl_range_assert(index, 0, __nlCurrentContext->n - 1);
-	__nl_assert(!__nlCurrentContext->least_squares);
+	__nl_assert(!context->least_squares);
 
-	b[index] += value;
+	if(!context->variable[index].locked) {
+		index = context->variable[index].index;
+		__nl_range_assert(index, 0, context->n - 1);
+
+		b[index] += value;
+	}
 }
 
+void nlRightHandSideSet(NLuint index, NLfloat value)
+{
+	__NLContext *context = __nlCurrentContext;
+	NLfloat* b = context->b;
+
+	__nlCheckState(__NL_STATE_MATRIX);
+	__nl_assert(!context->least_squares);
+
+	if(!context->variable[index].locked) {
+		index = context->variable[index].index;
+		__nl_range_assert(index, 0, context->n - 1);
+
+		b[index] = value;
+	}
+}
+
 void nlCoefficient(NLuint index, NLfloat value) {
 	__NLVariable* v;
 	unsigned int zero= 0;
@@ -1049,7 +1120,7 @@
 	/* Cleanup */
 
 	Destroy_SuperMatrix_Store(&At);
-	Destroy_SuperMatrix_Store(&AtP);
+	Destroy_CompCol_Permuted(&AtP);
 
 	__NL_DELETE_ARRAY(etree);
 	__NL_DELETE_ARRAY(xa);

Modified: branches/soc-2007-red_fox/release/scripts/3ds_import.py
===================================================================
--- branches/soc-2007-red_fox/release/scripts/3ds_import.py	2007-08-08 18:24:02 UTC (rev 11519)
+++ branches/soc-2007-red_fox/release/scripts/3ds_import.py	2007-08-08 20:30:20 UTC (rev 11520)
@@ -1,7 +1,7 @@
 #!BPY
 """ 
 Name: '3D Studio (.3ds)...'
-Blender: 241
+Blender: 244
 Group: 'Import'
 Tooltip: 'Import from 3DS file format (.3ds)'
 """
@@ -945,6 +945,7 @@

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list