Blender V5.3
deg_builder_relations_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_node_types.h"
12#include "DNA_scene_types.h"
13
14#include "BKE_compositor.hh"
15
16#include "BLI_listbase.hh"
17
18namespace blender::deg {
19
21{
22 scene_ = scene;
23 const bool build_compositor = (scene->r.scemode & R_DOCOMP);
24 const bool build_sequencer = (scene->r.scemode & R_DOSEQ);
26 build_animdata(&scene->id);
27 build_scene_audio(scene);
28 if (build_compositor) {
30 }
31 if (build_sequencer) {
33 build_scene_speakers(scene, view_layer);
34 }
35 build_scene_camera(scene);
36}
37
39{
40 if (scene->camera != nullptr) {
41 build_object(scene->camera);
42 }
43 for (TimeMarker &marker : scene->markers) {
44 if (!ELEM(marker.camera, nullptr, scene->camera)) {
45 build_object(marker.camera);
46 }
47 }
48}
49
51{
52 if (built_map_.check_is_built_and_tag(scene, BuilderMap::TAG_PARAMETERS)) {
53 return;
54 }
55
56 /* TODO(sergey): Trace as a scene parameters. */
57
60 build_parameters(&scene->id);
61 OperationKey parameters_eval_key(
63 ComponentKey scene_eval_key(&scene->id, NodeType::SCENE);
64 add_relation(parameters_eval_key, scene_eval_key, "Parameters -> Scene Eval");
65
66 for (TimeMarker &marker : scene->markers) {
68 }
69}
70
72{
73 if (built_map_.check_is_built_and_tag(scene, BuilderMap::TAG_SCENE_COMPOSITOR)) {
74 return;
75 }
76
77 ComponentKey compositor_key(&scene->id, NodeType::COMPOSITOR);
78 for (SceneCompositorEffect &effect : scene->compositor_effects) {
79 if (!effect.node_group || ID_MISSING(effect.node_group)) {
80 continue;
81 }
82
83 const OperationKey node_output_key(
85 this->add_relation(node_output_key, compositor_key, "NTree Output -> Compositor");
86
87 /* TODO(sergey): Trace as a scene compositor. */
89
90 DepsNodeHandle handle = this->create_node_handle(node_output_key);
92 *scene, effect, reinterpret_cast<blender::DepsNodeHandle *>(&handle));
93 }
94}
95
96} // namespace blender::deg
#define ID_MISSING(_id)
Definition DNA_ID.h:695
#define ELEM(...)
virtual void build_scene_speakers(Scene *scene, ViewLayer *view_layer)
virtual void build_scene_render(Scene *scene, ViewLayer *view_layer)
virtual void build_nodetree(bNodeTree *ntree)
Relation * add_relation(const KeyFrom &key_from, const KeyTo &key_to, const char *description, int flags=0)
virtual void build_idproperties(IDProperty *id_property)
DepsNodeHandle create_node_handle(const KeyType &key, const char *default_name="")
void add_depsgraph_relations(Scene &scene, const SceneCompositorEffect &effect, DepsNodeHandle *compositor_output_depsgraph_node)
IDProperty * system_properties
Definition DNA_ID.h:490
IDProperty * properties
Definition DNA_ID.h:481
struct Object * camera
ListBaseT< TimeMarker > markers
ListBaseT< SceneCompositorEffect > compositor_effects
struct RenderData r
struct Object * camera
struct IDProperty * prop