From 8ca497b9117c1a094ba34246c813a35508bc2ee8 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Mon, 12 Jun 2017 16:06:24 +0200 Subject: Depsgraph: Traversing should be consistent for nodes and relationship We need to traverse the same exact objects for both nodes and relationship builder. We were using FOREACH_SCENE_OBJECT for relationships, which would lead to plenty of warnings in multiple situations. In the future we will need to change this to build the depsgraph relations and nodes to one single render_layer. Fix T51780: If an object is in two collections and I do a full copy of scene things go bad --- .../depsgraph/intern/builder/deg_builder_relations_scene.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc index 08a897df2aa..f157a4b58d0 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc @@ -78,11 +78,11 @@ void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene) m_graph->scene = scene; /* scene objects */ - FOREACH_SCENE_OBJECT(scene, ob) - { - build_object(bmain, scene, ob); + for (SceneLayer *sl = (SceneLayer *)scene->render_layers.first; sl; sl = sl->next) { + for (Base *base = (Base *)sl->object_bases.first; base; base = base->next) { + build_object(bmain, scene, base->object); + } } - FOREACH_SCENE_OBJECT_END /* rigidbody */ if (scene->rigidbody_world) { -- cgit v1.2.3