Blender  V2.93
DNA_layer_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "DNA_freestyle_types.h"
24 #include "DNA_listBase.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
36  EEVEE_RENDER_PASS_Z = (1 << 1),
48  EEVEE_RENDER_PASS_AO = (1 << 13),
50  EEVEE_RENDER_PASS_AOV = (1 << 15),
53 #define EEVEE_RENDER_PASS_MAX_BIT 17
54 
55 /* #ViewLayerAOV.type */
56 typedef enum eViewLayerAOVType {
60 
61 /* #ViewLayerAOV.flag */
62 typedef enum eViewLayerAOVFlag {
63  AOV_CONFLICT = (1 << 0),
65 
66 /* #ViewLayer.cryptomatte_flag */
73 #define VIEW_LAYER_CRYPTOMATTE_ALL \
74  (VIEW_LAYER_CRYPTOMATTE_OBJECT | VIEW_LAYER_CRYPTOMATTE_MATERIAL | VIEW_LAYER_CRYPTOMATTE_ASSET)
75 
76 typedef struct Base {
77  struct Base *next, *prev;
78 
79  /* Flags which are based on the collections flags evaluation, does not
80  * include flags from object's restrictions. */
82 
83  /* Final flags, including both accumulated collection flags and object's
84  * restriction flags. */
85  short flag;
86 
87  unsigned short local_view_bits;
88  short sx, sy;
89  char _pad1[6];
90  struct Object *object;
91  unsigned int lay DNA_DEPRECATED;
93  unsigned short local_collections_bits;
94  short _pad2[3];
95 
96  /* Pointer to an original base. Is initialized for evaluated view layer.
97  * NOTE: Only allowed to be accessed from within active dependency graph. */
98  struct Base *base_orig;
99  void *_pad;
101 
102 typedef struct ViewLayerEngineData {
105  void *storage;
106  void (*free)(void *storage);
108 
109 typedef struct LayerCollection {
112  struct SceneCollection *scene_collection DNA_DEPRECATED;
113  short flag;
115  char _pad[4];
116 
119 
120  unsigned short local_collections_bits;
121  short _pad2[3];
123 
124 /* Type containing EEVEE settings per view-layer */
125 typedef struct ViewLayerEEVEE {
127  int _pad[1];
129 
130 /* AOV Renderpass definition. */
131 typedef struct ViewLayerAOV {
132  struct ViewLayerAOV *next, *prev;
133 
134  /* Name of the AOV */
135  char name[64];
136  int flag;
137  /* Type of AOV (color/value)
138  * matches `eViewLayerAOVType` */
139  int type;
141 typedef struct ViewLayer {
142  struct ViewLayer *next, *prev;
144  char name[64];
145  short flag;
146  char _pad[6];
150  struct SceneStats *stats;
151  struct Base *basact;
152 
158 
159  /* Old SceneRenderLayer data. */
160  int layflag;
162  int passflag;
166  char _pad1[4];
167 
168  int samples;
169 
173 
175  struct ViewLayerEEVEE eevee;
176 
177  /* List containing the `ViewLayerAOV`s */
180 
181  /* Runtime data */
187 
188 /* Base->flag */
189 enum {
190  /* User controlled flags. */
191  BASE_SELECTED = (1 << 0), /* Object is selected. */
192  BASE_HIDDEN = (1 << 8), /* Object is hidden for editing. */
193 
194  /* Runtime evaluated flags. */
195  BASE_VISIBLE_DEPSGRAPH = (1 << 1), /* Object is enabled and visible for the depsgraph. */
196  BASE_SELECTABLE = (1 << 2), /* Object can be selected. */
197  BASE_FROM_DUPLI = (1 << 3), /* Object comes from duplicator. */
198  BASE_VISIBLE_VIEWLAYER = (1 << 4), /* Object is enabled and visible for the viewlayer. */
199  BASE_FROM_SET = (1 << 5), /* Object comes from set. */
200  BASE_ENABLED_VIEWPORT = (1 << 6), /* Object is enabled in viewport. */
201  BASE_ENABLED_RENDER = (1 << 7), /* Object is enabled in final render */
202  /* BASE_DEPRECATED = (1 << 9), */
203  BASE_HOLDOUT = (1 << 10), /* Object masked out from render */
204  BASE_INDIRECT_ONLY = (1 << 11), /* Object only contributes indirectly to render */
205 };
206 
207 /* LayerCollection->flag */
208 enum {
209  /* LAYER_COLLECTION_DEPRECATED0 = (1 << 0), */
210  /* LAYER_COLLECTION_DEPRECATED1 = (1 << 1), */
211  /* LAYER_COLLECTION_DEPRECATED2 = (1 << 2), */
212  /* LAYER_COLLECTION_DEPRECATED3 = (1 << 3), */
218 };
219 
220 /* Layer Collection->runtime_flag
221  * Keep it synced with base->flag based on g_base_collection_flags. */
222 enum {
224  /* LAYER_COLLECTION_VISIBLE_DEPSGRAPH = (1 << 1), */ /* UNUSED */
227 };
228 
229 /* ViewLayer->flag */
230 enum {
231  VIEW_LAYER_RENDER = (1 << 0),
232  /* VIEW_LAYER_DEPRECATED = (1 << 1), */
234 };
235 
236 /****************************** Deprecated ******************************/
237 
238 /* Compatibility with collections saved in early 2.8 versions,
239  * used in file reading and versioning code. */
240 #define USE_COLLECTION_COMPAT_28
241 
242 typedef struct SceneCollection {
245  char name[64];
248  short flag;
249  char type;
250  char _pad;
256 
257 #ifdef __cplusplus
258 }
259 #endif
eViewLayerCryptomatteFlags
@ VIEW_LAYER_CRYPTOMATTE_MATERIAL
@ VIEW_LAYER_CRYPTOMATTE_ASSET
@ VIEW_LAYER_CRYPTOMATTE_ACCURATE
@ VIEW_LAYER_CRYPTOMATTE_OBJECT
@ LAYER_COLLECTION_HIDE
@ LAYER_COLLECTION_EXCLUDE
@ LAYER_COLLECTION_INDIRECT_ONLY
@ LAYER_COLLECTION_PREVIOUSLY_EXCLUDED
@ LAYER_COLLECTION_HOLDOUT
struct Base Base
struct ViewLayerEngineData ViewLayerEngineData
eViewLayerEEVEEPassType
@ EEVEE_RENDER_PASS_UNUSED_8
@ EEVEE_RENDER_PASS_AO
@ EEVEE_RENDER_PASS_NORMAL
@ EEVEE_RENDER_PASS_DIFFUSE_LIGHT
@ EEVEE_RENDER_PASS_VOLUME_LIGHT
@ EEVEE_RENDER_PASS_AOV
@ EEVEE_RENDER_PASS_BLOOM
@ EEVEE_RENDER_PASS_DIFFUSE_COLOR
@ EEVEE_RENDER_PASS_CRYPTOMATTE
@ EEVEE_RENDER_PASS_Z
@ EEVEE_RENDER_PASS_ENVIRONMENT
@ EEVEE_RENDER_PASS_COMBINED
@ EEVEE_RENDER_PASS_SPECULAR_LIGHT
@ EEVEE_RENDER_PASS_SPECULAR_COLOR
@ EEVEE_RENDER_PASS_EMIT
@ EEVEE_RENDER_PASS_MIST
@ EEVEE_RENDER_PASS_SHADOW
@ BASE_HIDDEN
@ BASE_INDIRECT_ONLY
@ BASE_FROM_DUPLI
@ BASE_FROM_SET
@ BASE_SELECTABLE
@ BASE_ENABLED_RENDER
@ BASE_HOLDOUT
@ BASE_VISIBLE_VIEWLAYER
@ BASE_VISIBLE_DEPSGRAPH
@ BASE_ENABLED_VIEWPORT
@ BASE_SELECTED
@ LAYER_COLLECTION_RESTRICT_VIEWPORT
@ LAYER_COLLECTION_VISIBLE_VIEW_LAYER
@ LAYER_COLLECTION_HAS_OBJECTS
@ VIEW_LAYER_FREESTYLE
@ VIEW_LAYER_RENDER
eViewLayerAOVType
@ AOV_TYPE_COLOR
@ AOV_TYPE_VALUE
struct ViewLayerEEVEE ViewLayerEEVEE
struct SceneCollection SceneCollection
struct ViewLayer ViewLayer
eViewLayerAOVFlag
@ AOV_CONFLICT
struct LayerCollection LayerCollection
struct ViewLayerAOV ViewLayerAOV
These structs are the foundation for all linked lists in the library system.
short flag_from_collection
short _pad2[3]
struct Base * next
char _pad1[6]
struct Base * prev
short flag
int flag_legacy
short sy
struct Object * object
unsigned short local_view_bits
void * _pad
unsigned int lay DNA_DEPRECATED
short sx
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 SceneCollection *scene_collection DNA_DEPRECATED
struct SceneCollection * prev
ListBase scene_collections
struct SceneCollection * next
struct ViewLayerAOV * prev
struct ViewLayerAOV * next
struct DrawEngineType * engine_type
struct ViewLayerEngineData * next
void(* free)(void *storage)
struct ViewLayerEngineData * prev
struct ViewLayerEEVEE eevee
ListBase drawdata
char _pad1[4]
struct FreestyleConfig freestyle_config
short cryptomatte_flag
struct IDProperty * id_properties
short cryptomatte_levels
ViewLayerAOV * active_aov
struct ViewLayer * prev
ListBase layer_collections
LayerCollection * active_collection
char _pad[6]
struct GHash * object_bases_hash
struct Base ** object_bases_array
struct ViewLayer * next
struct Base * basact
struct SceneStats * stats
ListBase object_bases
float pass_alpha_threshold
ListBase aovs
struct Material * mat_override
char name[64]