diff options
Diffstat (limited to 'source/blender/blenkernel/intern/object_dupli.c')
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index f9f6b0aab40..2d655913b3e 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -74,6 +74,7 @@ typedef struct DupliContext { bool do_update; bool animated; Group *group; /* XXX child objects are selected from this group if set, could be nicer */ + Object *obedit; /* Only to check if the object is in edit-mode. */ Scene *scene; ViewLayer *view_layer; @@ -107,6 +108,7 @@ static void init_context(DupliContext *r_ctx, const EvaluationContext *eval_ctx, r_ctx->animated = false; r_ctx->group = NULL; + r_ctx->obedit = OBEDIT_FROM_EVAL_CTX(eval_ctx); r_ctx->object = ob; if (space_mat) copy_m4_m4(r_ctx->space_mat, space_mat); @@ -241,14 +243,13 @@ static bool is_child(const Object *ob, const Object *parent) static void make_child_duplis(const DupliContext *ctx, void *userdata, MakeChildDuplisFunc make_child_duplis_cb) { Object *parent = ctx->object; - Object *obedit = ctx->scene->obedit; if (ctx->group) { int groupid = 0; FOREACH_GROUP_BASE(ctx->group, base) { Object *ob = base->object; - if ((base->flag & BASE_VISIBLED) && ob != obedit && is_child(ob, parent)) { + if ((base->flag & BASE_VISIBLED) && ob != ctx->obedit && is_child(ob, parent)) { DupliContext pctx; copy_dupli_context(&pctx, ctx, ctx->object, NULL, groupid, false); @@ -267,7 +268,7 @@ static void make_child_duplis(const DupliContext *ctx, void *userdata, MakeChild ViewLayer *view_layer = ctx->view_layer; for (Base *base = view_layer->object_bases.first; base; base = base->next, baseid++) { Object *ob = base->object; - if (ob != obedit && is_child(ob, parent)) { + if ((ob != ctx->obedit) && is_child(ob, parent)) { DupliContext pctx; copy_dupli_context(&pctx, ctx, ctx->object, NULL, baseid, false); |