[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13618] branches/pynodes: * merge from trunk:

Nathan Letwory jesterking at letwory.net
Sat Feb 9 22:45:18 CET 2008


Revision: 13618
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13618
Author:   jesterking
Date:     2008-02-09 22:45:16 +0100 (Sat, 09 Feb 2008)

Log Message:
-----------
* merge from trunk:
  svn merge r13580:13617 https://svn.blender.org/svnroot/bf-blender/trunk/blender .

  Sync with trunk in preparation for merge of pynodes to trunk.

 

Modified Paths:
--------------
    branches/pynodes/config/win32-mingw-config.py
    branches/pynodes/intern/iksolver/intern/TNT/svd.h
    branches/pynodes/source/blender/blenkernel/BKE_cloth.h
    branches/pynodes/source/blender/blenkernel/intern/DerivedMesh.c
    branches/pynodes/source/blender/blenkernel/intern/cloth.c
    branches/pynodes/source/blender/blenkernel/intern/implicit.c
    branches/pynodes/source/blender/blenkernel/intern/softbody.c
    branches/pynodes/source/blender/blenkernel/intern/writeffmpeg.c
    branches/pynodes/source/blender/imbuf/intern/openexr/openexr_api.cpp
    branches/pynodes/source/blender/imbuf/intern/openexr/openexr_multi.h
    branches/pynodes/source/blender/imbuf/intern/scaling.c
    branches/pynodes/source/blender/makesdna/DNA_armature_types.h
    branches/pynodes/source/blender/makesdna/DNA_meshdata_types.h
    branches/pynodes/source/blender/makesdna/intern/SConscript
    branches/pynodes/source/blender/python/api2_2x/doc/Render.py
    branches/pynodes/source/blender/render/intern/include/pixelblending.h
    branches/pynodes/source/blender/render/intern/include/render_types.h
    branches/pynodes/source/blender/render/intern/source/convertblender.c
    branches/pynodes/source/blender/render/intern/source/initrender.c
    branches/pynodes/source/blender/render/intern/source/occlusion.c
    branches/pynodes/source/blender/render/intern/source/pipeline.c
    branches/pynodes/source/blender/render/intern/source/pixelblending.c
    branches/pynodes/source/blender/render/intern/source/renderdatabase.c
    branches/pynodes/source/blender/render/intern/source/shadeinput.c
    branches/pynodes/source/blender/render/intern/source/shadeoutput.c
    branches/pynodes/source/blender/render/intern/source/sss.c
    branches/pynodes/source/blender/src/buttons_object.c
    branches/pynodes/source/blender/src/drawaction.c
    branches/pynodes/source/blender/src/drawarmature.c
    branches/pynodes/source/blender/src/editaction.c
    branches/pynodes/source/blender/src/editnla.c
    branches/pynodes/source/blender/src/editobject.c
    branches/pynodes/source/blender/src/editsound.c
    branches/pynodes/source/blender/src/edittime.c
    branches/pynodes/source/blender/src/header_info.c
    branches/pynodes/source/blender/src/seqeffects.c
    branches/pynodes/source/blender/src/sequence.c
    branches/pynodes/source/blender/src/space.c
    branches/pynodes/source/blender/src/transform.c
    branches/pynodes/source/blender/src/transform_conversions.c
    branches/pynodes/source/gameengine/GameLogic/SCA_ISensor.cpp
    branches/pynodes/source/gameengine/GameLogic/SCA_ISensor.h

Modified: branches/pynodes/config/win32-mingw-config.py
===================================================================
--- branches/pynodes/config/win32-mingw-config.py	2008-02-09 20:50:25 UTC (rev 13617)
+++ branches/pynodes/config/win32-mingw-config.py	2008-02-09 21:45:16 UTC (rev 13618)
@@ -156,5 +156,8 @@
 BF_DEBUG = 'false'
 BF_DEBUG_FLAGS= '-g'
 
+BF_PROFILE_FLAGS = ['-pg','-g']
+BF_PROFILE = 'false'
+
 BF_BUILDDIR = '..\\build\\win32-mingw'
 BF_INSTALLDIR='..\\install\\win32-mingw'

Modified: branches/pynodes/intern/iksolver/intern/TNT/svd.h
===================================================================
--- branches/pynodes/intern/iksolver/intern/TNT/svd.h	2008-02-09 20:50:25 UTC (rev 13617)
+++ branches/pynodes/intern/iksolver/intern/TNT/svd.h	2008-02-09 21:45:16 UTC (rev 13618)
@@ -18,11 +18,13 @@
 
 #include "tntmath.h"
 
+#define SVD_MAX_ITER 200
+
 namespace TNT
 {
 
 template <class MaTRiX, class VecToR >
-void SVD(MaTRiX &A, MaTRiX &U, VecToR &s, MaTRiX &V, VecToR &work1, VecToR &work2) {
+void SVD(MaTRiX &A, MaTRiX &U, VecToR &s, MaTRiX &V, VecToR &work1, VecToR &work2, int maxiter=SVD_MAX_ITER) {
 
 	int m = A.num_rows();
 	int n = A.num_cols();
@@ -216,7 +218,10 @@
 		int kase=0;
 		k=0;
 
-		// Here is where a test for too many iterations would go.
+		// Test for maximum iterations to avoid infinite loop
+		if(maxiter == 0)
+			break;
+		maxiter--;
 
 		// This section of the program inspects for
 		// negligible elements in the s and e arrays.  On

Modified: branches/pynodes/source/blender/blenkernel/BKE_cloth.h
===================================================================
--- branches/pynodes/source/blender/blenkernel/BKE_cloth.h	2008-02-09 20:50:25 UTC (rev 13617)
+++ branches/pynodes/source/blender/blenkernel/BKE_cloth.h	2008-02-09 21:45:16 UTC (rev 13618)
@@ -65,6 +65,18 @@
 
 #define CLOTH_MAX_THREAD 2
 
+/* goal defines */
+#define SOFTGOALSNAP  0.999f
+
+/* This is approximately the smallest number that can be
+* represented by a float, given its precision. */
+#define ALMOST_ZERO		FLT_EPSILON
+
+/* Bits to or into the ClothVertex.flags. */
+#define CLOTH_VERT_FLAG_PINNED 1
+#define CLOTH_VERT_FLAG_COLLISION 2
+#define CLOTH_VERT_FLAG_PINNED_EM 3
+
 /**
  * The definition of a cloth vertex.
  */
@@ -108,13 +120,6 @@
 }
 ClothSpring;
 
-/* goal defines */
-#define SOFTGOALSNAP  0.999f
-
-/* This is approximately the smallest number that can be
-* represented by a float, given its precision. */
-#define ALMOST_ZERO		FLT_EPSILON
-
 // some macro enhancements for vector treatment
 #define VECADDADD(v1,v2,v3) 	{*(v1)+= *(v2) + *(v3); *(v1+1)+= *(v2+1) + *(v3+1); *(v1+2)+= *(v2+2) + *(v3+2);}
 #define VECSUBADD(v1,v2,v3) 	{*(v1)-= *(v2) + *(v3); *(v1+1)-= *(v2+1) + *(v3+1); *(v1+2)-= *(v2+2) + *(v3+2);}
@@ -139,24 +144,25 @@
 	CLOTH_SIMSETTINGS_FLAG_TEARING = ( 1 << 4 ),// true if tearing is enabled
 	CLOTH_SIMSETTINGS_FLAG_CCACHE_PROTECT = ( 1 << 5 ), // true if tearing is enabled
 	CLOTH_SIMSETTINGS_FLAG_EDITMODE = ( 1 << 6 ), // are we in editmode? -several things disabled
-	CLOTH_SIMSETTINGS_FLAG_CCACHE_FFREE = (1 << 7), /* force cache freeing */
-	CLOTH_SIMSETTINGS_FLAG_SCALING = (1 << 8), /* is advanced scaling active? */
-	CLOTH_SIMSETTINGS_FLAG_LOADED = (1 << 9), /* did we just got load? */
+	CLOTH_SIMSETTINGS_FLAG_CCACHE_FFREE = ( 1 << 7 ), /* force cache freeing */
+	CLOTH_SIMSETTINGS_FLAG_SCALING = ( 1 << 8 ), /* is advanced scaling active? */
+	CLOTH_SIMSETTINGS_FLAG_LOADED = ( 1 << 9 ), /* did we just got load? */
 } CLOTH_SIMSETTINGS_FLAGS;
 
 /* COLLISION FLAGS */
 typedef enum
 {
 	CLOTH_COLLSETTINGS_FLAG_ENABLED = ( 1 << 1 ), /* enables cloth - object collisions */
-					    CLOTH_COLLSETTINGS_FLAG_SELF = ( 1 << 2 ), /* unused */
+	CLOTH_COLLSETTINGS_FLAG_SELF = ( 1 << 2 ), /* unused */
 } CLOTH_COLLISIONSETTINGS_FLAGS;
 
 /* Spring types as defined in the paper.*/
 typedef enum
 {
-	CLOTH_SPRING_TYPE_STRUCTURAL = 0,
- CLOTH_SPRING_TYPE_SHEAR,
- CLOTH_SPRING_TYPE_BENDING,
+	CLOTH_SPRING_TYPE_STRUCTURAL  = ( 1 << 1 ),
+	CLOTH_SPRING_TYPE_SHEAR  = ( 1 << 2 ) ,
+	CLOTH_SPRING_TYPE_BENDING  = ( 1 << 3 ),
+	CLOTH_SPRING_TYPE_GOAL  = ( 1 << 4 ),
 } CLOTH_SPRING_TYPES;
 
 /* SPRING FLAGS */
@@ -166,11 +172,6 @@
 	CLOTH_SPRING_FLAG_NEEDED = ( 1 << 2 ), // springs has values to be applied
 } CLOTH_SPRINGS_FLAGS;
 
-/* Bits to or into the ClothVertex.flags. */
-#define CLOTH_VERT_FLAG_PINNED 1
-#define CLOTH_VERT_FLAG_COLLISION 2
-#define CLOTH_VERT_FLAG_PINNED_EM 3
-
 typedef void ( *CM_COLLISION_RESPONSE ) ( ClothModifierData *clmd, CollisionModifierData *collmd, CollisionTree *tree1, CollisionTree *tree2 );
 
 
@@ -189,7 +190,7 @@
 ////////////////////////////////////////////////
 // implicit.c
 ////////////////////////////////////////////////
-		
+
 // needed for cloth.c
 int implicit_init ( Object *ob, ClothModifierData *clmd );
 int implicit_free ( ClothModifierData *clmd );
@@ -197,7 +198,7 @@
 void implicit_set_positions ( ClothModifierData *clmd );
 
 // globally needed
-void clmdSetInterruptCallBack(int (*f)(void));
+void clmdSetInterruptCallBack ( int ( *f ) ( void ) );
 ////////////////////////////////////////////////
 
 
@@ -206,23 +207,26 @@
 ////////////////////////////////////////////////
 
 // needed for modifier.c
-void cloth_free_modifier_extern (ClothModifierData *clmd);
-void cloth_free_modifier (Object *ob, ClothModifierData *clmd);
-void cloth_init (ClothModifierData *clmd);
-DerivedMesh *clothModifier_do(ClothModifierData *clmd,Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc);
+void cloth_free_modifier_extern ( ClothModifierData *clmd );
+void cloth_free_modifier ( Object *ob, ClothModifierData *clmd );
+void cloth_init ( ClothModifierData *clmd );
+DerivedMesh *clothModifier_do ( ClothModifierData *clmd,Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc );
 
-void cloth_update_normals (ClothVertex *verts, int nVerts, MFace *face, int totface);
+void cloth_update_normals ( ClothVertex *verts, int nVerts, MFace *face, int totface );
 
 // needed for collision.c
-void bvh_update_from_cloth(ClothModifierData *clmd, int moving);
+void bvh_update_from_cloth ( ClothModifierData *clmd, int moving );
 
 // needed for editmesh.c
-void cloth_write_cache(Object *ob, ClothModifierData *clmd, float framenr);
-int cloth_read_cache(Object *ob, ClothModifierData *clmd, float framenr);
+void cloth_write_cache ( Object *ob, ClothModifierData *clmd, float framenr );
+int cloth_read_cache ( Object *ob, ClothModifierData *clmd, float framenr );
 
 // needed for button_object.c
-void cloth_clear_cache(Object *ob, ClothModifierData *clmd, float framenr);
+void cloth_clear_cache ( Object *ob, ClothModifierData *clmd, float framenr );
 
+// needed for cloth.c
+int cloth_add_spring ( ClothModifierData *clmd, unsigned int indexA, unsigned int indexB, float restlength, int spring_type);
+
 ////////////////////////////////////////////////
 
 
@@ -233,7 +237,8 @@
 
 /* This enum provides the IDs for our solvers. */
 // only one available in the moment
-typedef enum {
+typedef enum
+{
 	CM_IMPLICIT = 0,
 } CM_SOLVER_ID;
 

Modified: branches/pynodes/source/blender/blenkernel/intern/DerivedMesh.c
===================================================================
--- branches/pynodes/source/blender/blenkernel/intern/DerivedMesh.c	2008-02-09 20:50:25 UTC (rev 13617)
+++ branches/pynodes/source/blender/blenkernel/intern/DerivedMesh.c	2008-02-09 21:45:16 UTC (rev 13618)
@@ -2578,7 +2578,7 @@
 {
 	float *vert_copy= NULL;
 
-	if(me->mr) {
+	if(me->mr && !(me->mr->flag & MULTIRES_NO_RENDER)) {
 		MultiresLevel *lvl= NULL;
 		int i;
 		
@@ -2604,16 +2604,21 @@
 void multires_render_final(Object *ob, Mesh *me, DerivedMesh **dm, float *vert_copy,
 			   const int orig_lvl, CustomDataMask dataMask)
 {
-	if(me->mr) {
+	if(me->mr && !(me->mr->flag & MULTIRES_NO_RENDER)) {
 		if((*dm)->getNumVerts(*dm) == me->totvert &&
 		   (*dm)->getNumFaces(*dm) == me->totface) {
 			MultiresLevel *lvl= multires_level_n(me->mr, BLI_countlist(&me->mr->levels));
 			DerivedMesh *old= NULL;
+			MVert *vertdup= NULL;
 			int i;
 
-			(*dm)->copyVertArray(*dm, me->mvert);
+			/* Copy the verts into the mesh */
+			vertdup= (*dm)->dupVertArray(*dm);
 			(*dm)->release(*dm);
+			for(i=0; i<me->totvert; ++i)
+				me->mvert[i]= vertdup[i];
 
+			/* Go to the render level */
 			me->mr->newlvl= me->mr->renderlvl;
 			multires_set_level(ob, me, 1);
 			(*dm)= getMeshDerivedMesh(me, ob, NULL);

Modified: branches/pynodes/source/blender/blenkernel/intern/cloth.c
===================================================================
--- branches/pynodes/source/blender/blenkernel/intern/cloth.c	2008-02-09 20:50:25 UTC (rev 13617)
+++ branches/pynodes/source/blender/blenkernel/intern/cloth.c	2008-02-09 21:45:16 UTC (rev 13618)
@@ -182,8 +182,8 @@
 	clmd->sim_parms->maxgoal = 1.0f;
 	clmd->sim_parms->mingoal = 0.0f;
 	clmd->sim_parms->defgoal = 0.0f;
-	clmd->sim_parms->goalspring = 100.0f;
-	clmd->sim_parms->goalfrict = 0.0f;
+	clmd->sim_parms->goalspring = 10.0f;
+	clmd->sim_parms->goalfrict = 5.0f;
 }
 
 
@@ -761,8 +761,8 @@
 		return result;
 	}
 	
-	// check for autoprotection
-	if(framenr >= clmd->sim_parms->autoprotect)
+	// check for autoprotection, but only if cache active
+	if((framenr >= clmd->sim_parms->autoprotect) && (G.relbase_valid))
 	{
 		if(G.rt > 0)
 			printf("fr#: %f, auto: %d\n", framenr, clmd->sim_parms->autoprotect);
@@ -1035,7 +1035,6 @@
 	unsigned int numverts = dm->getNumVerts ( dm );
 	float goalfac = 0;
 	ClothVertex *verts = NULL;
-	// clmd->sim_parms->vgroup_mass
 
 	clothObj = clmd->clothObject;
 
@@ -1073,7 +1072,9 @@
 						
 						verts->goal  = ( float ) pow ( verts->goal , 4.0f );
 						if ( verts->goal >=SOFTGOALSNAP )
-							verts->flags |= CLOTH_VERT_FLAG_PINNED;
+						{
+ 							verts->flags |= CLOTH_VERT_FLAG_PINNED;
+						}
 					}
 					
 					if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SCALING )
@@ -1089,11 +1090,13 @@
 							verts->bend_stiff = dvert->dw [j].weight;
 						}
 					}
-					
-					if( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_mass-1))
+					/*
+					// for later
+					if( dvert->dw[j].def_nr == (clmd->sim_parms->vgroup_weight-1))
 					{
 						verts->mass = dvert->dw [j].weight;
 					}
+					*/
 				}
 			}
 		}
@@ -1107,6 +1110,7 @@
 	ClothVertex *verts = NULL;
 	float tnull[3] = {0,0,0};
 	int cache_there = 0;
+	Cloth *cloth = NULL;
 
 	// If we have a clothObject, free it. 
 	if ( clmd->clothObject != NULL )
@@ -1122,6 +1126,7 @@
 	{

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list