diff options
author | Jacques Lucke <jacques@blender.org> | 2022-09-23 13:39:56 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-09-23 13:41:22 +0300 |
commit | e5d4afd5bac71e29ba71ecf091feaa0d70b70260 (patch) | |
tree | bb42b190977e6bd306e969093a093fc8d4c98bae /source/blender/blenkernel/intern/object_dupli.cc | |
parent | eb54502d9d29b18cbeda22125a601f3ce0bc423e (diff) |
Depsgraph: generalize passing parameters to depsgraph object iterator
This makes it easier to pass more parameters to the iterator in the future.
Differential Revision: https://developer.blender.org/D16047
Diffstat (limited to 'source/blender/blenkernel/intern/object_dupli.cc')
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc index 6db1c864918..dde3130a5b0 100644 --- a/source/blender/blenkernel/intern/object_dupli.cc +++ b/source/blender/blenkernel/intern/object_dupli.cc @@ -311,12 +311,13 @@ static void make_child_duplis(const DupliContext *ctx, /* FIXME: using a mere counter to generate a 'persistent' dupli id is very weak. One possible * better solution could be to use `session_uuid` of ID's instead? */ int persistent_dupli_id = 0; + DEGObjectIterSettings deg_iter_settings{}; + deg_iter_settings.depsgraph = ctx->depsgraph; /* NOTE: this set of flags ensure we only iterate over objects that have a base in either the * current scene, or the set (background) scene. */ - int deg_objects_visibility_flags = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | - DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET; - - DEG_OBJECT_ITER_BEGIN (ctx->depsgraph, ob, deg_objects_visibility_flags) { + deg_iter_settings.flags = DEG_ITER_OBJECT_FLAG_LINKED_DIRECTLY | + DEG_ITER_OBJECT_FLAG_LINKED_VIA_SET; + DEG_OBJECT_ITER_BEGIN (°_iter_settings, ob) { if ((ob != ctx->obedit) && is_child(ob, parent)) { DupliContext pctx; if (copy_dupli_context(&pctx, ctx, ctx->object, nullptr, persistent_dupli_id)) { |