Blender V4.3
deg_builder_nodes_scene.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "DNA_scene_types.h"
12
13namespace blender::deg {
14
16{
17 scene_ = scene;
18 view_layer_ = view_layer;
19 const bool build_compositor = (scene->r.scemode & R_DOCOMP);
20 const bool build_sequencer = (scene->r.scemode & R_DOSEQ);
21 IDNode *id_node = add_id_node(&scene->id);
22 id_node->linked_state = DEG_ID_LINKED_DIRECTLY;
24 build_animdata(&scene->id);
26 build_scene_audio(scene);
27 if (build_compositor) {
29 }
30 if (build_sequencer) {
32 build_scene_speakers(scene, view_layer);
33 }
34 build_scene_camera(scene);
35}
36
38{
39 if (scene->camera != nullptr) {
40 build_object(-1, scene->camera, DEG_ID_LINKED_INDIRECTLY, true);
41 }
42 LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
43 if (!ELEM(marker->camera, nullptr, scene->camera)) {
44 build_object(-1, marker->camera, DEG_ID_LINKED_INDIRECTLY, true);
45 }
46 }
47}
48
50{
52 return;
53 }
54 build_parameters(&scene->id);
55 build_idproperties(scene->id.properties);
56
58
59 /* NOTE: This is a bit overkill and can potentially pull a bit too much into the graph, but:
60 *
61 * - We definitely need an ID node for the scene's compositor, otherwise re-mapping will no
62 * happen correct and we will risk remapping pointers in the main database.
63 * - Alternatively, we should discard compositor tree, but this might cause other headache like
64 * drivers which are coming from the tree.
65 *
66 * Would be nice to find some reliable way of ignoring compositor here, but it's already pulled
67 * in when building scene from view layer, so this particular case does not make things
68 * marginally worse. */
70
71 LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
72 build_idproperties(marker->prop);
73 }
74}
75
77{
79 return;
80 }
81 if (scene->nodetree == nullptr) {
82 return;
83 }
84 build_nodetree(scene->nodetree);
85}
86
87} // namespace blender::deg
#define LISTBASE_FOREACH(type, var, list)
#define ELEM(...)
@ R_DOSEQ
@ R_DOCOMP
bool checkIsBuiltAndTag(ID *id, int tag=TAG_COMPLETE)
virtual void build_scene_parameters(Scene *scene)
virtual void build_scene_sequencer(Scene *scene)
virtual void build_object(int base_index, Object *object, eDepsNode_LinkedState_Type linked_state, bool is_visible)
virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer)
OperationNode * add_operation_node(ComponentNode *comp_node, OperationCode opcode, const DepsEvalOperationCb &op=nullptr, const char *name="", int name_tag=-1)
virtual void build_scene_camera(Scene *scene)
virtual void build_scene_audio(Scene *scene)
virtual void build_scene_render(Scene *scene, ViewLayer *view_layer)
virtual void build_nodetree(bNodeTree *ntree)
virtual void build_idproperties(IDProperty *id_property)
virtual void build_scene_compositor(Scene *scene)
const IDNode * id_node
@ DEG_ID_LINKED_INDIRECTLY