[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [13074] trunk/blender/source/blender/ blenkernel/intern/anim.c: made dupli' s respect render and view restrict flags (from the outliner)

Campbell Barton ideasman42 at gmail.com
Mon Dec 31 13:47:10 CET 2007


Revision: 13074
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=13074
Author:   campbellbarton
Date:     2007-12-31 13:47:10 +0100 (Mon, 31 Dec 2007)

Log Message:
-----------
made dupli's respect render and view restrict flags (from the outliner)
This means one group can contain proxy objects to display in the 3d view as well as hi quality models that are only rendered. - again for peach tree's.

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/anim.c

Modified: trunk/blender/source/blender/blenkernel/intern/anim.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/anim.c	2007-12-31 12:13:30 UTC (rev 13073)
+++ trunk/blender/source/blender/blenkernel/intern/anim.c	2007-12-31 12:47:10 UTC (rev 13074)
@@ -878,39 +878,51 @@
 /* ***************************** */
 static void object_duplilist_recursive(ID *id, Object *ob, ListBase *duplilist, float (*par_space_mat)[][4], int level)
 {	
-	if(ob->transflag & OB_DUPLI) {
-		if(ob->transflag & OB_DUPLIPARTS) {
-			ParticleSystem *psys = ob->particlesystem.first;
-			for(; psys; psys=psys->next)
-				new_particle_duplilist(duplilist, id, ob, psys, level+1);
+	if((ob->transflag & OB_DUPLI)==0)
+		return;
+	
+	/* Should the dupli's be greated for this object? - Respect restrict flags */
+	if (G.rendering) {
+		if (ob->restrictflag & OB_RESTRICT_RENDER) {
+			return;
 		}
-		else if(ob->transflag & OB_DUPLIVERTS) {
-			if(ob->type==OB_MESH) {
-				vertex_duplilist(duplilist, id, ob, par_space_mat, level+1);
-			}
-			else if(ob->type==OB_FONT) {
-				if (GS(id->name)==ID_SCE) { /* TODO - support dupligroups */
-					font_duplilist(duplilist, ob, level+1);
-				}
-			}
+	} else {
+		if (ob->restrictflag & OB_RESTRICT_VIEW) {
+			return;
 		}
-		else if(ob->transflag & OB_DUPLIFACES) {
-			if(ob->type==OB_MESH)
-				face_duplilist(duplilist, id, ob, par_space_mat, level+1);
+	}
+
+	if(ob->transflag & OB_DUPLIPARTS) {
+		ParticleSystem *psys = ob->particlesystem.first;
+		for(; psys; psys=psys->next)
+			new_particle_duplilist(duplilist, id, ob, psys, level+1);
+	}
+	else if(ob->transflag & OB_DUPLIVERTS) {
+		if(ob->type==OB_MESH) {
+			vertex_duplilist(duplilist, id, ob, par_space_mat, level+1);
 		}
-		else if(ob->transflag & OB_DUPLIFRAMES) {
+		else if(ob->type==OB_FONT) {
 			if (GS(id->name)==ID_SCE) { /* TODO - support dupligroups */
-				frames_duplilist(duplilist, ob, level+1);
+				font_duplilist(duplilist, ob, level+1);
 			}
-		} else if(ob->transflag & OB_DUPLIGROUP) {
-			DupliObject *dob;
-			
-			group_duplilist(duplilist, ob, level+1); /* now recursive */
+		}
+	}
+	else if(ob->transflag & OB_DUPLIFACES) {
+		if(ob->type==OB_MESH)
+			face_duplilist(duplilist, id, ob, par_space_mat, level+1);
+	}
+	else if(ob->transflag & OB_DUPLIFRAMES) {
+		if (GS(id->name)==ID_SCE) { /* TODO - support dupligroups */
+			frames_duplilist(duplilist, ob, level+1);
+		}
+	} else if(ob->transflag & OB_DUPLIGROUP) {
+		DupliObject *dob;
+		
+		group_duplilist(duplilist, ob, level+1); /* now recursive */
 
-			if (level==0) {
-				for(dob= duplilist->first; dob; dob= dob->next)
-					Mat4CpyMat4(dob->ob->obmat, dob->mat);
-			}
+		if (level==0) {
+			for(dob= duplilist->first; dob; dob= dob->next)
+				Mat4CpyMat4(dob->ob->obmat, dob->mat);
 		}
 	}
 }





More information about the Bf-blender-cvs mailing list