Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-11-08 15:34:25 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-11-08 15:49:39 +0300
commit3750dfaa0a23130f1fc5200b67443ce68fa4d930 (patch)
treee49d032c13694ac10245f31deaa7a876fba275d0 /source
parentda4bfb87703e49806aff5ce4ed75deaf8c7310e1 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c10
-rw-r--r--source/blender/depsgraph/intern/depsgraph_query.cc3
2 files changed, 7 insertions, 6 deletions
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;