[Bf-blender-cvs] [57bd991] gooseberry: Replace usage of the procedural duplilist generation by cached duplilist.

Lukas Tönne noreply at git.blender.org
Mon Mar 23 13:03:24 CET 2015


Commit: 57bd99124d373c29eba1b66a383484bdc63ee577
Author: Lukas Tönne
Date:   Thu Mar 12 17:05:00 2015 +0100
Branches: gooseberry
https://developer.blender.org/rB57bd99124d373c29eba1b66a383484bdc63ee577

Replace usage of the procedural duplilist generation by cached duplilist.

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

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

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

diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index ebe9b83..fe661b2 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -1184,8 +1184,9 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx)
 /* ---- ListBase dupli container implementation ---- */
 
 /* Returns a list of DupliObject */
-ListBase *object_duplilist_ex(EvaluationContext *eval_ctx, Scene *scene, Object *ob, bool update)
+ListBase *object_duplilist_ex(EvaluationContext *UNUSED(eval_ctx), Scene *UNUSED(scene), Object *ob, bool UNUSED(update))
 {
+#if 0
 	ListBase *duplilist = MEM_callocN(sizeof(ListBase), "duplilist");
 	DupliContext ctx;
 	init_context(&ctx, eval_ctx, scene, ob, NULL, update);
@@ -1193,8 +1194,16 @@ ListBase *object_duplilist_ex(EvaluationContext *eval_ctx, Scene *scene, Object
 		ctx.duplilist = duplilist;
 		ctx.gen->make_duplis(&ctx);
 	}
-
 	return duplilist;
+#else
+	if (ob->dup_cache) {
+		return &ob->dup_cache->duplilist;
+	}
+	else {
+		static ListBase list_null = {NULL, NULL};
+		return &list_null;
+	}
+#endif
 }
 
 /* note: previously updating was always done, this is why it defaults to be on
@@ -1204,10 +1213,12 @@ ListBase *object_duplilist(EvaluationContext *eval_ctx, Scene *sce, Object *ob)
 	return object_duplilist_ex(eval_ctx, sce, ob, true);
 }
 
-void free_object_duplilist(ListBase *lb)
+void free_object_duplilist(ListBase *UNUSED(lb))
 {
+#if 0
 	BLI_freelistN(lb);
 	MEM_freeN(lb);
+#endif
 }
 
 int count_duplilist(Object *ob)




More information about the Bf-blender-cvs mailing list