Blender V4.5
DNA_layer_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_freestyle_types.h"
12#include "DNA_listBase.h"
13
14#include "BLI_utildefines.h"
15
35 EEVEE_RENDER_PASS_UNUSED_14 = (1 << 14), /* EEVEE_RENDER_PASS_BLOOM */
37 /*
38 * TODO(@jbakker): Clean up conflicting bits after EEVEE has been removed.
39 * #EEVEE_RENDER_PASS_CRYPTOMATTE is for EEVEE, `EEVEE_RENDER_PASS_CRYTPOMATTE_*` are for
40 * EEVEE-Next.
41 */
50#define EEVEE_RENDER_PASS_MAX_BIT 21
52
53/* #ViewLayer::grease_pencil_flags */
57
58/* #ViewLayerAOV.type */
63
64/* #ViewLayerAOV.flag */
68
69/* #ViewLayer.cryptomatte_flag */
77#define VIEW_LAYER_CRYPTOMATTE_ALL \
78 (VIEW_LAYER_CRYPTOMATTE_OBJECT | VIEW_LAYER_CRYPTOMATTE_MATERIAL | VIEW_LAYER_CRYPTOMATTE_ASSET)
79
80typedef struct Base {
81 struct Base *next, *prev;
82
83 struct Object *object;
84
85 /* Pointer to an original base. Is initialized for evaluated view layer.
86 * NOTE: Only allowed to be accessed from within active dependency graph. */
87 struct Base *base_orig;
88
89 unsigned int lay DNA_DEPRECATED;
90 /* Final flags, including both accumulated collection flags and object's
91 * restriction flags. */
92 short flag;
93 /* Flags which are based on the collections flags evaluation, does not
94 * include flags from object's restrictions. */
97 unsigned short local_view_bits;
98 unsigned short local_collections_bits;
99 char _pad1[2];
101
116
117/* Type containing EEVEE settings per view-layer */
122
124typedef struct ViewLayerAOV {
126
127 /* Name of the AOV */
128 char name[64];
129 int flag;
130 /* Type of AOV (color/value)
131 * matches `eViewLayerAOVType` */
132 int type;
134
136typedef struct ViewLayerLightgroup {
138
139 /* Name of the Light-group. */
140 char name[64];
142
143/* Light-group membership information. */
144typedef struct LightgroupMembership {
145 /* Name of the Light-group. */
146 char name[64];
148
149typedef struct ViewLayer {
150 struct ViewLayer *next, *prev;
151 char name[/*MAX_NAME*/ 64];
152 short flag;
153 char _pad[6];
158 struct Base *basact;
159
165
166 /* Old SceneRenderLayer data. */
174
176
188
191
192 /* List containing the `ViewLayerAOV`s */
195
196 /* List containing the 'ViewLayerLightgroup`s */
199
200 /* Runtime data */
204
205/* Base->flag */
206enum {
207 /* User controlled flags. */
208 BASE_SELECTED = (1 << 0), /* Object is selected. */
209 BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */
210
211 /* Runtime evaluated flags. */
212
213 /* Object is enabled and potentially visible in a viewport. Layer collection
214 * visibility, local collection visibility, and local view are not part of this
215 * and may cause the object to be hidden depending on the 3D viewport settings.
216 *
217 * Objects with this flag will be considered visible by the viewport depsgraph
218 * and be evaluated as a result.
219 *
220 * This implies BASE_ENABLED_VIEWPORT. */
222
223 /* Object can be selected. */
224 BASE_SELECTABLE = (1 << 2),
225
226 /* Object comes from a duplicator. */
227 BASE_FROM_DUPLI = (1 << 3),
228
229 /* Object is enabled and visible in a viewport with default viewport settings,
230 * (so without any local view or local collection visibility overrides). Used
231 * when editors other than the 3D viewport need to know if an object is visible. */
233
234 /* Object comes from a scene set. */
235 BASE_FROM_SET = (1 << 5),
236
237 /* Object is enabled for viewport or final render respectively. Only enabled
238 * objects can be pulled into the depsgraph for evaluation, either through being
239 * directly visible, as a dependency of another object, or as part of colliders
240 * and effectors for physics. */
243
244 /* BASE_DEPRECATED = (1 << 9), */
245
246 /* Object masked out from render */
247 BASE_HOLDOUT = (1 << 10),
248 /* Object only contributes indirectly to render */
250};
251
252/* LayerCollection->flag */
253enum {
254 /* LAYER_COLLECTION_DEPRECATED0 = (1 << 0), */
255 /* LAYER_COLLECTION_DEPRECATED1 = (1 << 1), */
256 /* LAYER_COLLECTION_DEPRECATED2 = (1 << 2), */
257 /* LAYER_COLLECTION_DEPRECATED3 = (1 << 3), */
263};
264
265/* Layer Collection->runtime_flag
266 * Keep it synced with base->flag based on g_base_collection_flags. */
267enum {
269 /* LAYER_COLLECTION_VISIBLE_DEPSGRAPH = (1 << 1), */ /* UNUSED */
272};
273
274/* ViewLayer->flag */
275enum {
277 /* VIEW_LAYER_DEPRECATED = (1 << 1), */
281};
#define ENUM_OPERATORS(_type, _max)
eViewLayerCryptomatteFlags
@ VIEW_LAYER_CRYPTOMATTE_MATERIAL
@ VIEW_LAYER_CRYPTOMATTE_ASSET
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ VIEW_LAYER_CRYPTOMATTE_OBJECT
@ BASE_HIDDEN
@ BASE_INDIRECT_ONLY
@ BASE_FROM_DUPLI
@ BASE_FROM_SET
@ BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT
@ BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT
@ BASE_ENABLED_RENDER
@ BASE_HOLDOUT
@ BASE_ENABLED_VIEWPORT
@ LAYER_COLLECTION_HIDE
@ LAYER_COLLECTION_EXCLUDE
@ LAYER_COLLECTION_INDIRECT_ONLY
@ LAYER_COLLECTION_PREVIOUSLY_EXCLUDED
@ LAYER_COLLECTION_HOLDOUT
eViewLayerGreasePencilFlags
@ GREASE_PENCIL_AS_SEPARATE_PASS
#define EEVEE_RENDER_PASS_MAX_BIT
eViewLayerEEVEEPassType
@ EEVEE_RENDER_PASS_UNUSED_8
@ EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL
@ EEVEE_RENDER_PASS_AO
@ EEVEE_RENDER_PASS_NORMAL
@ EEVEE_RENDER_PASS_UNUSED_14
@ EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT
@ EEVEE_RENDER_PASS_DIFFUSE_LIGHT
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_AOV
@ EEVEE_RENDER_PASS_DIFFUSE_COLOR
@ EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET
@ EEVEE_RENDER_PASS_CRYPTOMATTE
@ EEVEE_RENDER_PASS_Z
@ EEVEE_RENDER_PASS_ENVIRONMENT
@ EEVEE_RENDER_PASS_COMBINED
@ EEVEE_RENDER_PASS_SPECULAR_LIGHT
@ EEVEE_RENDER_PASS_VECTOR
@ EEVEE_RENDER_PASS_SPECULAR_COLOR
@ EEVEE_RENDER_PASS_EMIT
@ EEVEE_RENDER_PASS_MIST
@ EEVEE_RENDER_PASS_TRANSPARENT
@ EEVEE_RENDER_PASS_SHADOW
@ EEVEE_RENDER_PASS_POSITION
@ VIEW_LAYER_HAS_EXPORT_COLLECTIONS
@ VIEW_LAYER_FREESTYLE
@ VIEW_LAYER_RENDER
@ VIEW_LAYER_OUT_OF_SYNC
eViewLayerAOVType
@ AOV_TYPE_COLOR
@ AOV_TYPE_VALUE
eViewLayerAOVFlag
@ AOV_CONFLICT
@ LAYER_COLLECTION_VISIBLE_VIEW_LAYER
@ LAYER_COLLECTION_HIDE_VIEWPORT
@ LAYER_COLLECTION_HAS_OBJECTS
These structs are the foundation for all linked lists in the library system.
#define BASE_SELECTED(v3d, base)
#define BASE_SELECTABLE(v3d, base)
#define typedef
short flag_from_collection
struct Base * next
struct Base * prev
short flag
struct Object * object
unsigned short local_view_bits
char _pad1[2]
unsigned int lay DNA_DEPRECATED
short flag_legacy
unsigned short local_collections_bits
struct Base * base_orig
struct LayerCollection * prev
struct LayerCollection * next
ListBase layer_collections
unsigned short local_collections_bits
struct Collection * collection
struct ViewLayerAOV * prev
struct ViewLayerAOV * next
struct ViewLayerLightgroup * prev
struct ViewLayerLightgroup * next
struct ViewLayerEEVEE eevee
struct FreestyleConfig freestyle_config
short cryptomatte_flag
ListBase lightgroups
struct IDProperty * id_properties
short cryptomatte_levels
ViewLayerLightgroup * active_lightgroup
ViewLayerAOV * active_aov
struct ViewLayer * prev
int grease_pencil_flags
ListBase layer_collections
struct World * world_override
LayerCollection * active_collection
struct GHash * object_bases_hash
struct Base ** object_bases_array
struct ViewLayer * next
struct Base * basact
struct SceneStats * stats
struct IDProperty * system_properties
ListBase object_bases
float pass_alpha_threshold
ListBase aovs
struct Material * mat_override
char name[64]