[Bf-blender-cvs] [c0161a1] master: Fix T48913: cycles viewport render stuck in loop due to non-unique dupli ID.

Brecht Van Lommel noreply at git.blender.org
Thu Aug 18 00:00:02 CEST 2016


Commit: c0161a1bab71331f518bd5c8c1b091df7ee12074
Author: Brecht Van Lommel
Date:   Sun Aug 14 15:33:21 2016 +0200
Branches: master
https://developer.blender.org/rBc0161a1bab71331f518bd5c8c1b091df7ee12074

Fix T48913: cycles viewport render stuck in loop due to non-unique dupli ID.

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

M	intern/cycles/blender/blender_util.h
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/makesdna/DNA_object_types.h

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

diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index d5dbaba..e79f2bb 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -698,7 +698,7 @@ protected:
 
 /* Object Key */
 
-enum { OBJECT_PERSISTENT_ID_SIZE = 8 };
+enum { OBJECT_PERSISTENT_ID_SIZE = 16 };
 
 struct ObjectKey {
 	void *parent;
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 21a0246..3a0222b 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -221,31 +221,39 @@ static void make_child_duplis(const DupliContext *ctx, void *userdata, MakeChild
 
 	if (ctx->group) {
 		unsigned int lay = ctx->group->layer;
+		unsigned int groupid = 0;
 		GroupObject *go;
-		for (go = ctx->group->gobject.first; go; go = go->next) {
+		for (go = ctx->group->gobject.first; go; go = go->next, groupid++) {
 			Object *ob = go->ob;
 
 			if ((ob->lay & lay) && ob != obedit && is_child(ob, parent)) {
+				DupliContext pctx;
+				copy_dupli_context(&pctx, ctx, ctx->object, NULL, groupid, false);
+
 				/* mballs have a different dupli handling */
 				if (ob->type != OB_MBALL)
 					ob->flag |= OB_DONE;  /* doesnt render */
 
-				make_child_duplis_cb(ctx, userdata, ob);
+				make_child_duplis_cb(&pctx, userdata, ob);
 			}
 		}
 	}
 	else {
 		unsigned int lay = ctx->scene->lay;
+		unsigned int baseid = 0;
 		Base *base;
-		for (base = ctx->scene->base.first; base; base = base->next) {
+		for (base = ctx->scene->base.first; base; base = base->next, baseid++) {
 			Object *ob = base->object;
 
 			if ((base->lay & lay) && ob != obedit && is_child(ob, parent)) {
+				DupliContext pctx;
+				copy_dupli_context(&pctx, ctx, ctx->object, NULL, baseid, false);
+
 				/* mballs have a different dupli handling */
 				if (ob->type != OB_MBALL)
 					ob->flag |= OB_DONE;  /* doesnt render */
 
-				make_child_duplis_cb(ctx, userdata, ob);
+				make_child_duplis_cb(&pctx, userdata, ob);
 			}
 		}
 	}
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h
index d53c836..d24c7fa 100644
--- a/source/blender/makesdna/DNA_object_types.h
+++ b/source/blender/makesdna/DNA_object_types.h
@@ -331,7 +331,7 @@ typedef struct DupliObject {
 
 	/* persistent identifier for a dupli object, for inter-frame matching of
 	 * objects with motion blur, or inter-update matching for syncing */
-	int persistent_id[8]; /* MAX_DUPLI_RECUR */
+	int persistent_id[16]; /* 2*MAX_DUPLI_RECUR */
 
 	/* particle this dupli was generated from */
 	struct ParticleSystem *particle_system;




More information about the Bf-blender-cvs mailing list