From 864af51d6a88e1408367ab7083825b3b40b75e24 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Fri, 11 Nov 2022 12:31:50 -0600 Subject: Fix: Failing instance visibility test after recent commit The "visibility_instances.blend" cycles test was failing.. The stack of dupli generator types added in e508de041712cc31588 wasn't "popped" correctly after recursive duplis were generated. --- source/blender/blenkernel/intern/object_dupli.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc index 54a26a897d8..cca609a2e0d 100644 --- a/source/blender/blenkernel/intern/object_dupli.cc +++ b/source/blender/blenkernel/intern/object_dupli.cc @@ -344,6 +344,9 @@ static void make_recursive_duplis(const DupliContext *ctx, ctx->instance_stack->append(ob); rctx.gen->make_duplis(&rctx); ctx->instance_stack->remove_last(); + if (!ctx->dupli_gen_type_stack->is_empty()) { + ctx->dupli_gen_type_stack->remove_last(); + } } } } @@ -388,6 +391,9 @@ static void make_child_duplis(const DupliContext *ctx, ob->flag |= OB_DONE; /* Doesn't render. */ } make_child_duplis_cb(&pctx, userdata, ob); + if (!ctx->dupli_gen_type_stack->is_empty()) { + ctx->dupli_gen_type_stack->remove_last(); + } } } } @@ -413,6 +419,9 @@ static void make_child_duplis(const DupliContext *ctx, } make_child_duplis_cb(&pctx, userdata, ob); + if (!ctx->dupli_gen_type_stack->is_empty()) { + ctx->dupli_gen_type_stack->remove_last(); + } } } persistent_dupli_id++; -- cgit v1.2.3