Commit: 3750dfaa0a23130f1fc5200b67443ce68fa4d930
Author: Dalai Felinto
Date:   Wed Nov 8 10:34:25 2017 -0200
Branches: blender2.8
https://developer.blender.org/rB3750dfaa0a23130f1fc5200b67443ce68fa4d930

Partial Fix T53269: Dupli-verts/dupli-faces not working

This fixes the issue for the Draw Manager, but for Cycles this is still not
working. The iterator bpy.context.depsgraph.duplis seems to be correct though.

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

M       source/blender/blenkernel/intern/object_dupli.c
M       source/blender/depsgraph/intern/depsgraph_query.cc

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

diff --git a/source/blender/blenkernel/intern/object_dupli.c 
b/source/blender/blenkernel/intern/object_dupli.c
index c25207d81bf..bfc99e1f238 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -75,6 +75,7 @@ typedef struct DupliContext {
        Group *group; /* XXX child objects are selected from this group if set, 
could be nicer */
 
        Scene *scene;
+       SceneLayer *scene_layer;
        Object *object;
        float space_mat[4][4];
 
@@ -99,6 +100,7 @@ static void init_context(DupliContext *r_ctx, const 
EvaluationContext *eval_ctx,
 {
        r_ctx->eval_ctx = eval_ctx;
        r_ctx->scene = scene;
+       r_ctx->scene_layer = eval_ctx->scene_layer;
        /* don't allow BKE_object_handle_update for viewport during render, can 
crash */
        r_ctx->do_update = update && !(G.is_rendering && eval_ctx->mode != 
DAG_EVAL_RENDER);
        r_ctx->animated = false;
@@ -255,13 +257,11 @@ static void make_child_duplis(const DupliContext *ctx, 
void *userdata, MakeChild
                }
        }
        else {
-               unsigned int lay = ctx->scene->lay;
                int baseid = 0;
-               BaseLegacy *base;
-               for (base = ctx->scene->base.first; base; base = base->next, 
baseid++) {
+               SceneLayer *scene_layer = ctx->scene_layer;
+               for (Base *base = scene_layer->object_bases.first; base; base = 
base->next, baseid++) {
                        Object *ob = base->object;
-
-                       if ((base->lay & lay) && ob != obedit && is_child(ob, 
parent)) {
+                       if ((base->flag & BASE_VISIBLED) && ob != obedit && 
is_child(ob, parent)) {
                                DupliContext pctx;
                                copy_dupli_context(&pctx, ctx, ctx->object, 
NULL, baseid, false);
 
diff --git a/source/blender/depsgraph/intern/depsgraph_query.cc 
b/source/blender/depsgraph/intern/depsgraph_query.cc
index e950aa58112..4431df80b69 100644
--- a/source/blender/depsgraph/intern/depsgraph_query.cc
+++ b/source/blender/depsgraph/intern/depsgraph_query.cc
@@ -134,7 +134,7 @@ static bool deg_flush_base_flags_and_settings(
 {
        Base *base;
        Depsgraph *graph = data->graph;
-       SceneLayer *scene_layer = DEG_get_evaluated_scene_layer(graph);
+       SceneLayer *scene_layer = data->eval_ctx.scene_layer;
        int flag = is_dupli ? BASE_FROMDUPLI : 0;
 
        /* First attempt, see if object is in the current SceneLayer. */
@@ -261,6 +261,7 @@ void DEG_objects_iterator_begin(BLI_Iterator *iter, 
DEGObjectsIteratorData *data
        iter->data = data;
 
        DEG_evaluation_context_init(&data->eval_ctx, DAG_EVAL_RENDER);
+       data->eval_ctx.scene_layer = DEG_get_evaluated_scene_layer(graph);
 
        data->dupli_parent = NULL;
        data->dupli_list = NULL;

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to