Blender V5.0
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
8
10
11#include "DNA_scene_types.h"
12
13#include "BLI_listbase.h"
14
15namespace blender::deg {
16
18{
19 scene_ = scene;
20 view_layer_ = view_layer;
21 const bool build_compositor = (scene->r.scemode & R_DOCOMP);
22 const bool build_sequencer = (scene->r.scemode & R_DOSEQ);
23 IDNode *id_node = add_id_node(&scene->id);
26 build_animdata(&scene->id);
28 build_scene_audio(scene);
29 if (build_compositor) {
31 }
32 if (build_sequencer) {
34 build_scene_speakers(scene, view_layer);
35 }
36 build_scene_camera(scene);
37}
38
40{
41 if (scene->camera != nullptr) {
43 }
44 LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
45 if (!ELEM(marker->camera, nullptr, scene->camera)) {
46 build_object(-1, marker->camera, DEG_ID_LINKED_INDIRECTLY, true);
47 }
48 }
49}
50
52{
53 if (built_map_.check_is_built_and_tag(scene, BuilderMap::TAG_PARAMETERS)) {
54 return;
55 }
56 build_parameters(&scene->id);
59
61
62 /* NOTE: This is a bit overkill and can potentially pull a bit too much into the graph, but:
63 *
64 * - We definitely need an ID node for the scene's compositor, otherwise re-mapping will no
65 * happen correct and we will risk remapping pointers in the main database.
66 * - Alternatively, we should discard compositor tree, but this might cause other headache like
67 * drivers which are coming from the tree.
68 *
69 * Would be nice to find some reliable way of ignoring compositor here, but it's already pulled
70 * in when building scene from view layer, so this particular case does not make things
71 * marginally worse. */
73
74 LISTBASE_FOREACH (TimeMarker *, marker, &scene->markers) {
75 build_idproperties(marker->prop);
76 }
77}
78
80{
81 if (built_map_.check_is_built_and_tag(scene, BuilderMap::TAG_SCENE_COMPOSITOR)) {
82 return;
83 }
84 if (scene->compositing_node_group == nullptr) {
85 return;
86 }
88}
89
90} // namespace blender::deg
#define LISTBASE_FOREACH(type, var, list)
#define ELEM(...)
@ R_DOSEQ
@ R_DOCOMP
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)
@ DEG_ID_LINKED_INDIRECTLY
IDProperty * system_properties
Definition DNA_ID.h:489
IDProperty * properties
Definition DNA_ID.h:480
struct bNodeTree * compositing_node_group
struct RenderData r
struct Object * camera
ListBase markers
eDepsNode_LinkedState_Type linked_state