[Bf-blender-cvs] [199715eabcc] blender2.8: Point cache: stop using general object dupli system.

Brecht Van Lommel noreply at git.blender.org
Fri Apr 13 11:49:05 CEST 2018


Commit: 199715eabccce8d91cd4f9705762305e8f236b8c
Author: Brecht Van Lommel
Date:   Thu Apr 12 18:24:46 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB199715eabccce8d91cd4f9705762305e8f236b8c

Point cache: stop using general object dupli system.

We now only look into dupli groups to find point caches to edit. This
feature is a leftover from the old proxy system, and evaluating the
full dupli list and all transforms was overkill. With static overrides
we may want to get rid of using duplis entirely, and just let users
select the objects directly.

===================================================================

M	source/blender/blenkernel/intern/pointcache.c

===================================================================

diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 27588afea93..afaf68dde24 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -38,6 +38,7 @@
 
 #include "DNA_ID.h"
 #include "DNA_dynamicpaint_types.h"
+#include "DNA_group_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
 #include "DNA_object_force_types.h"
@@ -1733,22 +1734,19 @@ void BKE_ptcache_ids_from_object(ListBase *lb, Object *ob, Scene *scene, int dup
 		BLI_addtail(lb, pid);
 	}
 
-	if (scene && (duplis-- > 0) && (ob->transflag & OB_DUPLI)) {
-		ListBase *lb_dupli_ob;
-		/* don't update the dupli groups, we only want their pid's */
-		if ((lb_dupli_ob = object_duplilist_ex(G.main->eval_ctx, scene, ob, false))) {
-			DupliObject *dob;
-			for (dob= lb_dupli_ob->first; dob; dob= dob->next) {
-				if (dob->ob != ob) { /* avoids recursive loops with dupliframes: bug 22988 */
-					ListBase lb_dupli_pid;
-					BKE_ptcache_ids_from_object(&lb_dupli_pid, dob->ob, scene, duplis);
-					BLI_movelisttolist(lb, &lb_dupli_pid);
-					if (lb_dupli_pid.first)
-						printf("Adding Dupli\n");
-				}
-			}
+	/* Consider all object in dupli groups to be part of the same object,
+	 * for baking with linking dupligroups. Once we have better overrides
+	 * this can be revisited so users select the local objects directly. */
+	if (scene && (duplis-- > 0) && (ob->dup_group)) {
+		Group *group = ob->dup_group;
+		Base *base = group->view_layer->object_bases.first;
 
-			free_object_duplilist(lb_dupli_ob);	/* does restore */
+		for (; base; base = base->next) {
+			if (base->object != ob) {
+				ListBase lb_dupli_pid;
+				BKE_ptcache_ids_from_object(&lb_dupli_pid, base->object, scene, duplis);
+				BLI_movelisttolist(lb, &lb_dupli_pid);
+			}
 		}
 	}
 }



More information about the Bf-blender-cvs mailing list