[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13149] branches/cloth/blender: svn merge -r 13095:13148 https://svn.blender.org/svnroot/bf-blender/trunk/ blender

Daniel Genrich daniel.genrich at gmx.net
Mon Jan 7 04:25:12 CET 2008


Revision: 13149
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13149
Author:   genscher
Date:     2008-01-07 04:25:11 +0100 (Mon, 07 Jan 2008)

Log Message:
-----------
svn merge -r 13095:13148 https://svn.blender.org/svnroot/bf-blender/trunk/blender

Modified Paths:
--------------
    branches/cloth/blender/intern/guardedalloc/MEM_guardedalloc.h
    branches/cloth/blender/intern/guardedalloc/intern/mallocn.c
    branches/cloth/blender/source/blender/blenkernel/BKE_anim.h
    branches/cloth/blender/source/blender/blenkernel/BKE_constraint.h
    branches/cloth/blender/source/blender/blenkernel/intern/anim.c
    branches/cloth/blender/source/blender/blenkernel/intern/armature.c
    branches/cloth/blender/source/blender/blenkernel/intern/constraint.c
    branches/cloth/blender/source/blender/blenkernel/intern/curve.c
    branches/cloth/blender/source/blender/blenkernel/intern/image.c
    branches/cloth/blender/source/blender/blenkernel/intern/object.c
    branches/cloth/blender/source/blender/blenkernel/intern/particle.c
    branches/cloth/blender/source/blender/blenkernel/intern/particle_system.c
    branches/cloth/blender/source/blender/blenlib/intern/BLI_kdtree.c
    branches/cloth/blender/source/blender/blenloader/intern/readfile.c
    branches/cloth/blender/source/blender/include/BIF_editconstraint.h
    branches/cloth/blender/source/blender/include/BIF_gl.h
    branches/cloth/blender/source/blender/makesdna/DNA_constraint_types.h
    branches/cloth/blender/source/blender/python/api2_2x/Blender.c
    branches/cloth/blender/source/blender/python/api2_2x/NLA.c
    branches/cloth/blender/source/blender/python/api2_2x/doc/NLA.py
    branches/cloth/blender/source/blender/render/intern/include/strand.h
    branches/cloth/blender/source/blender/render/intern/source/convertblender.c
    branches/cloth/blender/source/blender/render/intern/source/renderdatabase.c
    branches/cloth/blender/source/blender/render/intern/source/strand.c
    branches/cloth/blender/source/blender/src/buttons_editing.c
    branches/cloth/blender/source/blender/src/buttons_object.c
    branches/cloth/blender/source/blender/src/drawview.c
    branches/cloth/blender/source/blender/src/editaction.c
    branches/cloth/blender/source/blender/src/editconstraint.c
    branches/cloth/blender/source/blender/src/editparticle.c
    branches/cloth/blender/source/blender/src/editscreen.c
    branches/cloth/blender/source/blender/src/editseq.c
    branches/cloth/blender/source/blender/src/editview.c
    branches/cloth/blender/source/blender/src/header_action.c
    branches/cloth/blender/source/blender/src/header_nla.c
    branches/cloth/blender/source/blender/src/header_view3d.c
    branches/cloth/blender/source/blender/src/outliner.c
    branches/cloth/blender/source/blender/src/poselib.c
    branches/cloth/blender/source/blender/src/poseobject.c
    branches/cloth/blender/source/blender/src/seqeffects.c
    branches/cloth/blender/source/blender/src/sequence.c
    branches/cloth/blender/source/blender/src/transform.c
    branches/cloth/blender/source/blender/src/transform_conversions.c
    branches/cloth/blender/source/creator/creator.c
    branches/cloth/blender/source/nan_compile.mk
    branches/cloth/blender/source/nan_definitions.mk
    branches/cloth/blender/source/nan_link.mk

Modified: branches/cloth/blender/intern/guardedalloc/MEM_guardedalloc.h
===================================================================
--- branches/cloth/blender/intern/guardedalloc/MEM_guardedalloc.h	2008-01-07 03:20:43 UTC (rev 13148)
+++ branches/cloth/blender/intern/guardedalloc/MEM_guardedalloc.h	2008-01-07 03:25:11 UTC (rev 13149)
@@ -100,9 +100,13 @@
 	void *MEM_mapallocN(unsigned int len, const char * str);
 
 	/** Print a list of the names and sizes of all allocated memory
+	 * blocks. as a python dict for easy investigation */ 
+	void MEM_printmemlist_pydict(void);
+
+	/** Print a list of the names and sizes of all allocated memory
 	 * blocks. */ 
 	void MEM_printmemlist(void);
-
+	
 	/** Set the callback function for error output. */
 	void MEM_set_error_callback(void (*func)(char *));
 

Modified: branches/cloth/blender/intern/guardedalloc/intern/mallocn.c
===================================================================
--- branches/cloth/blender/intern/guardedalloc/intern/mallocn.c	2008-01-07 03:20:43 UTC (rev 13148)
+++ branches/cloth/blender/intern/guardedalloc/intern/mallocn.c	2008-01-07 03:25:11 UTC (rev 13149)
@@ -334,7 +334,7 @@
 
 
 /* Prints in python syntax for easy */
-void MEM_printmemlist()
+static void MEM_printmemlist_internal( int pydict )
 {
 	MemHead *membl;
 
@@ -343,16 +343,23 @@
 	membl = membase->first;
 	if (membl) membl = MEMNEXT(membl);
 	
-	print_error("# membase_debug.py\n");
-	print_error("membase = [\\\n");
+	if (pydict) {
+		print_error("# membase_debug.py\n");
+		print_error("membase = [\\\n");
+	}
 	while(membl) {
-		fprintf(stderr, "{'len':%i, 'name':'''%s''', 'pointer':'%p'},\\\n", membl->len, membl->name, membl+1);
+		if (pydict) {
+			fprintf(stderr, "{'len':%i, 'name':'''%s''', 'pointer':'%p'},\\\n", membl->len, membl->name, membl+1);
+		} else {
+			print_error("%s len: %d %p\n",membl->name,membl->len, membl+1);
+		}
 		if(membl->next)
 			membl= MEMNEXT(membl->next);
 		else break;
 	}
-	fprintf(stderr, "]\n\n");
-	fprintf(stderr,
+	if (pydict) {
+		fprintf(stderr, "]\n\n");
+		fprintf(stderr,
 "mb_userinfo = {}\n"
 "totmem = 0\n"
 "for mb_item in membase:\n"
@@ -367,11 +374,19 @@
 "\tmb_userinfo_sort.sort(key = sort_func)\n"
 "\tfor item in mb_userinfo_sort:\n"
 "\t\tprint 'name:%%s, users:%%i, len:%%i' %% (item[0], item[1][0], item[1][1])\n"
-	);
+		);
+	}
 	
 	mem_unlock_thread();
 }
 
+void MEM_printmemlist( void ) {
+	MEM_printmemlist_internal(0);
+}
+void MEM_printmemlist_pydict( void ) {
+	MEM_printmemlist_internal(1);
+}
+
 short MEM_freeN(void *vmemh)		/* anders compileertie niet meer */
 {
 	short error = 0;

Modified: branches/cloth/blender/source/blender/blenkernel/BKE_anim.h
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/BKE_anim.h	2008-01-07 03:20:43 UTC (rev 13148)
+++ branches/cloth/blender/source/blender/blenkernel/BKE_anim.h	2008-01-07 03:25:11 UTC (rev 13149)
@@ -44,7 +44,7 @@
 	struct DupliObject *next, *prev;
 	struct Object *ob;
 	unsigned int origlay;
-	int index, no_draw;
+	int index, no_draw, type;
 	float mat[4][4], omat[4][4];
 } DupliObject;
 

Modified: branches/cloth/blender/source/blender/blenkernel/BKE_constraint.h
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/BKE_constraint.h	2008-01-07 03:20:43 UTC (rev 13148)
+++ branches/cloth/blender/source/blender/blenkernel/BKE_constraint.h	2008-01-07 03:25:11 UTC (rev 13149)
@@ -117,6 +117,9 @@
 void relink_constraints(struct ListBase *list);
 void free_constraint_data(struct bConstraint *con);
 
+/* Constraints + Proxies function prototypes */
+void extract_proxylocal_constraints(struct ListBase *dst, struct ListBase *src);
+short proxylocked_constraints_owner(struct Object *ob, struct bPoseChannel *pchan);
 
 /* Constraint Channel function prototypes */
 struct bConstraintChannel *get_constraint_channel(struct ListBase *list, const char *name);
@@ -126,6 +129,7 @@
 void clone_constraint_channels(struct ListBase *dst, struct ListBase *src);
 void free_constraint_channels(struct ListBase *chanbase);
 
+
 /* Constraint Evaluation function prototypes */
 struct bConstraintOb *constraints_make_evalob(struct Object *ob, void *subdata, short datatype);
 void constraints_clear_evalob(struct bConstraintOb *cob);

Modified: branches/cloth/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/anim.c	2008-01-07 03:20:43 UTC (rev 13148)
+++ branches/cloth/blender/source/blender/blenkernel/intern/anim.c	2008-01-07 03:25:11 UTC (rev 13149)
@@ -284,7 +284,7 @@
 
 /* ****************** DUPLICATOR ************** */
 
-static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], int lay, int index)
+static DupliObject *new_dupli_object(ListBase *lb, Object *ob, float mat[][4], int lay, int index, int type)
 {
 	DupliObject *dob= MEM_callocN(sizeof(DupliObject), "dupliobject");
 	
@@ -294,6 +294,7 @@
 	Mat4CpyMat4(dob->omat, ob->obmat);
 	dob->origlay= ob->lay;
 	dob->index= index;
+	dob->type= type;
 	ob->lay= lay;
 	
 	return dob;
@@ -321,7 +322,7 @@
 		if(go->ob!=ob) {
 			
 			Mat4MulMat4(mat, go->ob->obmat, ob->obmat);
-			dob= new_dupli_object(lb, go->ob, mat, ob->lay, 0);
+			dob= new_dupli_object(lb, go->ob, mat, ob->lay, 0, OB_DUPLIGROUP);
 			dob->no_draw= (dob->origlay & group->layer)==0;
 			
 			if(go->ob->transflag & OB_DUPLI) {
@@ -360,7 +361,7 @@
 		if(ok) {
 			do_ob_ipo(ob);
 			where_is_object_time(ob, (float)G.scene->r.cfra);
-			new_dupli_object(lb, ob, ob->obmat, ob->lay, G.scene->r.cfra);
+			new_dupli_object(lb, ob, ob->obmat, ob->lay, G.scene->r.cfra, OB_DUPLIFRAMES);
 		}
 	}
 
@@ -405,7 +406,7 @@
 		Mat4CpyMat4(tmat, obmat);
 		Mat4MulMat43(obmat, tmat, mat);
 	}
-	new_dupli_object(vdd->lb, vdd->ob, obmat, vdd->par->lay, index);
+	new_dupli_object(vdd->lb, vdd->ob, obmat, vdd->par->lay, index, OB_DUPLIVERTS);
 	
 	if(vdd->ob->transflag & OB_DUPLI) {
 		float tmpmat[4][4];
@@ -631,7 +632,7 @@
 						Mat4CpyMat4(tmat, obmat);
 						Mat4MulMat43(obmat, tmat, mat);
 						
-						new_dupli_object(lb, ob, obmat, lay, a);
+						new_dupli_object(lb, ob, obmat, lay, a, OB_DUPLIFACES);
 						
 						if(ob->transflag & OB_DUPLI) {
 							float tmpmat[4][4];
@@ -772,7 +773,7 @@
 
 						VECADD(tmat[3], go->ob->obmat[3], state.co);
 
-						new_dupli_object(lb, go->ob, tmat, par->lay, counter);
+						new_dupli_object(lb, go->ob, tmat, par->lay, counter, OB_DUPLIPARTS);
 					}
 				}
 				else {
@@ -789,7 +790,7 @@
 
 					VECCOPY(tmat[3], state.co);
 
-					new_dupli_object(lb, ob, tmat, par->lay, counter);
+					new_dupli_object(lb, ob, tmat, par->lay, counter, OB_DUPLIPARTS);
 				}
 			}
 		}
@@ -867,7 +868,7 @@
 			Mat4CpyMat4(obmat, par->obmat);
 			VECCOPY(obmat[3], vec);
 			
-			new_dupli_object(lb, ob, obmat, par->lay, a);
+			new_dupli_object(lb, ob, obmat, par->lay, a, OB_DUPLIVERTS);
 		}
 		
 	}
@@ -881,7 +882,7 @@
 	if((ob->transflag & OB_DUPLI)==0)
 		return;
 	
-	/* Should the dupli's be greated for this object? - Respect restrict flags */
+	/* Should the dupli's be generated for this object? - Respect restrict flags */
 	if (G.rendering) {
 		if (ob->restrictflag & OB_RESTRICT_RENDER) {
 			return;
@@ -922,7 +923,8 @@
 
 		if (level==0) {
 			for(dob= duplilist->first; dob; dob= dob->next)
-				Mat4CpyMat4(dob->ob->obmat, dob->mat);
+				if(dob->type == OB_DUPLIGROUP)
+					Mat4CpyMat4(dob->ob->obmat, dob->mat);
 		}
 	}
 }

Modified: branches/cloth/blender/source/blender/blenkernel/intern/armature.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/armature.c	2008-01-07 03:20:43 UTC (rev 13148)
+++ branches/cloth/blender/source/blender/blenkernel/intern/armature.c	2008-01-07 03:25:11 UTC (rev 13149)
@@ -1317,6 +1317,7 @@
 	pchan= pose->chanbase.first;
 	for(; pchan; pchan= pchan->next) {
 		if(pchan->bone->layer & layer_protected) {
+			ListBase proxylocal_constraints = {NULL, NULL};
 			pchanp= get_pose_channel(frompose, pchan->name);
 			
 			/* copy posechannel to temp, but restore important pointers */
@@ -1327,9 +1328,16 @@
 			pchanw.child= pchan->child;
 			pchanw.path= NULL;
 			
-			/* constraints, set target ob pointer to own object */
+			/* constraints - proxy constraints are flushed... local ones are added after 
+			 *	1. extract constraints not from proxy (CONSTRAINT_PROXY_LOCAL) from pchan's constraints
+			 *	2. copy proxy-pchan's constraints on-to new
+			 *	3. add extracted local constraints back on top 
+			 */
+			extract_proxylocal_constraints(&proxylocal_constraints, &pchan->constraints);
 			copy_constraints(&pchanw.constraints, &pchanp->constraints);
+			addlisttolist(&pchanw.constraints, &proxylocal_constraints);
 			
+			/* constraints - set target ob pointer to own object */
 			for (con= pchanw.constraints.first; con; con= con->next) {
 				bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
 				ListBase targets = {NULL, NULL};

Modified: branches/cloth/blender/source/blender/blenkernel/intern/constraint.c
===================================================================
--- branches/cloth/blender/source/blender/blenkernel/intern/constraint.c	2008-01-07 03:20:43 UTC (rev 13148)
+++ branches/cloth/blender/source/blender/blenkernel/intern/constraint.c	2008-01-07 03:25:11 UTC (rev 13149)
@@ -3246,6 +3246,46 @@
 	}
 }
 
+/* -------- Constraints and Proxies ------- */
+
+/* Rescue all constraints tagged as being CONSTRAINT_PROXY_LOCAL (i.e. added to bone that's proxy-synced in this file) */
+void extract_proxylocal_constraints (ListBase *dst, ListBase *src)
+{
+	bConstraint *con, *next;
+	
+	/* for each tagged constraint, remove from src and move to dst */
+	for (con= src->first; con; con= next) {
+		next= con->next;
+		
+		/* check if tagged */
+		if (con->flag & CONSTRAINT_PROXY_LOCAL) {
+			BLI_remlink(src, con);
+			BLI_addtail(dst, con);
+		}
+	}
+}
+
+/* Returns if the owner of the constraint is proxy-protected */
+short proxylocked_constraints_owner (Object *ob, bPoseChannel *pchan)
+{
+	/* Currently, constraints can only be on object or bone level */
+	if (ob && ob->proxy) {
+		if (ob->pose && pchan) {
+			bArmature *arm= ob->data;
+			
+			/* On bone-level, check if bone is on proxy-protected layer */
+			if ((pchan->bone) && (pchan->bone->layer & arm->layer_protected))

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list