Blender  V3.3
rna_layer.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include "DNA_layer_types.h"
8 #include "DNA_scene_types.h"
9 #include "DNA_view3d_types.h"
10 
11 #include "BLT_translation.h"
12 
13 #include "ED_object.h"
14 #include "ED_render.h"
15 
16 #include "RE_engine.h"
17 
18 #include "WM_api.h"
19 #include "WM_types.h"
20 
21 #include "RNA_define.h"
22 
23 #include "rna_internal.h"
24 
25 #ifdef RNA_RUNTIME
26 
27 # ifdef WITH_PYTHON
28 # include "BPY_extern.h"
29 # endif
30 
31 # include "DNA_collection_types.h"
32 # include "DNA_object_types.h"
33 
34 # include "RNA_access.h"
35 
36 # include "BKE_idprop.h"
37 # include "BKE_layer.h"
38 # include "BKE_mesh.h"
39 # include "BKE_node.h"
40 # include "BKE_scene.h"
41 
42 # include "NOD_composite.h"
43 
44 # include "BLI_listbase.h"
45 
46 # include "DEG_depsgraph_build.h"
47 # include "DEG_depsgraph_query.h"
48 
49 /***********************************/
50 
51 static PointerRNA rna_ViewLayer_active_layer_collection_get(PointerRNA *ptr)
52 {
53  ViewLayer *view_layer = (ViewLayer *)ptr->data;
54  LayerCollection *lc = view_layer->active_collection;
55  return rna_pointer_inherit_refine(ptr, &RNA_LayerCollection, lc);
56 }
57 
58 static void rna_ViewLayer_active_layer_collection_set(PointerRNA *ptr,
59  PointerRNA value,
60  struct ReportList *UNUSED(reports))
61 {
62  ViewLayer *view_layer = (ViewLayer *)ptr->data;
63  LayerCollection *lc = (LayerCollection *)value.data;
64  const int index = BKE_layer_collection_findindex(view_layer, lc);
65  if (index != -1) {
66  BKE_layer_collection_activate(view_layer, lc);
67  }
68 }
69 
70 static PointerRNA rna_LayerObjects_active_object_get(PointerRNA *ptr)
71 {
72  ViewLayer *view_layer = (ViewLayer *)ptr->data;
74  ptr, &RNA_Object, view_layer->basact ? view_layer->basact->object : NULL);
75 }
76 
77 static void rna_LayerObjects_active_object_set(PointerRNA *ptr,
78  PointerRNA value,
79  struct ReportList *reports)
80 {
81  ViewLayer *view_layer = (ViewLayer *)ptr->data;
82  if (value.data) {
83  Object *ob = value.data;
84  Base *basact_test = BKE_view_layer_base_find(view_layer, ob);
85  if (basact_test != NULL) {
86  view_layer->basact = basact_test;
87  }
88  else {
89  BKE_reportf(reports,
90  RPT_ERROR,
91  "ViewLayer '%s' does not contain object '%s'",
92  view_layer->name,
93  ob->id.name + 2);
94  }
95  }
96  else {
97  view_layer->basact = NULL;
98  }
99 }
100 
101 size_t rna_ViewLayer_path_buffer_get(const ViewLayer *view_layer,
102  char *r_rna_path,
103  const size_t rna_path_buffer_size)
104 {
105  char name_esc[sizeof(view_layer->name) * 2];
106  BLI_str_escape(name_esc, view_layer->name, sizeof(name_esc));
107 
108  return BLI_snprintf_rlen(r_rna_path, rna_path_buffer_size, "view_layers[\"%s\"]", name_esc);
109 }
110 
111 static char *rna_ViewLayer_path(const PointerRNA *ptr)
112 {
113  const ViewLayer *view_layer = (ViewLayer *)ptr->data;
114  char rna_path[sizeof(view_layer->name) * 3];
115 
116  rna_ViewLayer_path_buffer_get(view_layer, rna_path, sizeof(rna_path));
117 
118  return BLI_strdup(rna_path);
119 }
120 
121 static IDProperty **rna_ViewLayer_idprops(PointerRNA *ptr)
122 {
123  ViewLayer *view_layer = (ViewLayer *)ptr->data;
124  return &view_layer->id_properties;
125 }
126 
127 static bool rna_LayerCollection_visible_get(LayerCollection *layer_collection, bContext *C)
128 {
129  View3D *v3d = CTX_wm_view3d(C);
130 
131  if ((v3d == NULL) || ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0)) {
132  return (layer_collection->runtime_flag & LAYER_COLLECTION_VISIBLE_VIEW_LAYER) != 0;
133  }
134 
135  if (v3d->local_collections_uuid & layer_collection->local_collections_bits) {
136  return (layer_collection->runtime_flag & LAYER_COLLECTION_HIDE_VIEWPORT) == 0;
137  }
138 
139  return false;
140 }
141 
142 static void rna_ViewLayer_update_render_passes(ID *id)
143 {
144  Scene *scene = (Scene *)id;
145  if (scene->nodetree) {
147  }
148 
149  RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
150  if (engine_type->update_render_passes) {
151  RenderEngine *engine = RE_engine_create(engine_type);
152  if (engine) {
153  LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
154  BKE_view_layer_verify_aov(engine, scene, view_layer);
155  }
156  }
157  RE_engine_free(engine);
158  engine = NULL;
159  }
160 }
161 
162 static PointerRNA rna_ViewLayer_objects_get(CollectionPropertyIterator *iter)
163 {
164  ListBaseIterator *internal = &iter->internal.listbase;
165 
166  /* we are actually iterating a ObjectBase list */
167  Base *base = (Base *)internal->link;
168  return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object);
169 }
170 
171 static int rna_ViewLayer_objects_selected_skip(CollectionPropertyIterator *iter,
172  void *UNUSED(data))
173 {
174  ListBaseIterator *internal = &iter->internal.listbase;
175  Base *base = (Base *)internal->link;
176 
177  if ((base->flag & BASE_SELECTED) != 0) {
178  return 0;
179  }
180 
181  return 1;
182 };
183 
184 static PointerRNA rna_ViewLayer_depsgraph_get(PointerRNA *ptr)
185 {
186  ID *id = ptr->owner_id;
187  if (GS(id->name) == ID_SCE) {
188  Scene *scene = (Scene *)id;
189  ViewLayer *view_layer = (ViewLayer *)ptr->data;
191  return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph);
192  }
193  return PointerRNA_NULL;
194 }
195 
196 static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
197 {
198  ViewLayer *view_layer = (ViewLayer *)ptr->data;
200  iter, &view_layer->object_bases, rna_ViewLayer_objects_selected_skip);
201 }
202 
203 static void rna_ViewLayer_update_tagged(ID *id_ptr,
204  ViewLayer *view_layer,
205  Main *bmain,
206  ReportList *reports)
207 {
208  Scene *scene = (Scene *)id_ptr;
209  Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer);
210 
212  BKE_report(reports, RPT_ERROR, "Dependency graph update requested during evaluation");
213  return;
214  }
215 
216 # ifdef WITH_PYTHON
217  /* Allow drivers to be evaluated */
219 # endif
220 
221  /* NOTE: This is similar to CTX_data_depsgraph_pointer(). Ideally such access would be
222  * de-duplicated across all possible cases, but for now this is safest and easiest way to go.
223  *
224  * The reason for this is that it's possible to have Python operator which asks view layer to
225  * be updated. After re-do of such operator view layer's dependency graph will not be marked
226  * as active. */
229 
230 # ifdef WITH_PYTHON
232 # endif
233 }
234 
235 static void rna_ObjectBase_select_update(Main *UNUSED(bmain),
236  Scene *UNUSED(scene),
237  PointerRNA *ptr)
238 {
239  Base *base = (Base *)ptr->data;
240  short mode = (base->flag & BASE_SELECTED) ? BA_SELECT : BA_DESELECT;
241  ED_object_base_select(base, mode);
242 }
243 
244 static void rna_ObjectBase_hide_viewport_update(bContext *C, PointerRNA *UNUSED(ptr))
245 {
247  ViewLayer *view_layer = CTX_data_view_layer(C);
248  BKE_layer_collection_sync(scene, view_layer);
251 }
252 
253 static void rna_LayerCollection_name_get(struct PointerRNA *ptr, char *value)
254 {
255  ID *id = (ID *)((LayerCollection *)ptr->data)->collection;
256  BLI_strncpy(value, id->name + 2, sizeof(id->name) - 2);
257 }
258 
259 int rna_LayerCollection_name_length(PointerRNA *ptr)
260 {
261  ID *id = (ID *)((LayerCollection *)ptr->data)->collection;
262  return strlen(id->name + 2);
263 }
264 
265 static void rna_LayerCollection_flag_set(PointerRNA *ptr, const bool value, const int flag)
266 {
267  LayerCollection *layer_collection = (LayerCollection *)ptr->data;
268  Collection *collection = layer_collection->collection;
269 
270  if (collection->flag & COLLECTION_IS_MASTER) {
271  return;
272  }
273 
274  if (value) {
275  layer_collection->flag |= flag;
276  }
277  else {
278  layer_collection->flag &= ~flag;
279  }
280 }
281 
282 static void rna_LayerCollection_exclude_set(PointerRNA *ptr, bool value)
283 {
284  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_EXCLUDE);
285 }
286 
287 static void rna_LayerCollection_holdout_set(PointerRNA *ptr, bool value)
288 {
289  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_HOLDOUT);
290 }
291 
292 static void rna_LayerCollection_indirect_only_set(PointerRNA *ptr, bool value)
293 {
294  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_INDIRECT_ONLY);
295 }
296 
297 static void rna_LayerCollection_hide_viewport_set(PointerRNA *ptr, bool value)
298 {
299  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_HIDE);
300 }
301 
302 static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
303 {
304  Scene *scene = (Scene *)ptr->owner_id;
307 
308  /* Set/Unset it recursively to match the behavior of excluding via the menu or shortcuts. */
309  const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0;
311 
312  BKE_layer_collection_sync(scene, view_layer);
313 
315  if (!exclude) {
316  /* We need to update animation of objects added back to the scene through enabling this view
317  * layer. */
318  FOREACH_OBJECT_BEGIN (view_layer, ob) {
320  }
322  }
323 
326  if (exclude) {
327  ED_object_base_active_refresh(bmain, scene, view_layer);
328  }
329 }
330 
331 static void rna_LayerCollection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
332 {
333  Scene *scene = (Scene *)ptr->owner_id;
336 
337  BKE_layer_collection_sync(scene, view_layer);
338 
340 
343 }
344 
345 static bool rna_LayerCollection_has_objects(LayerCollection *lc)
346 {
347  return (lc->runtime_flag & LAYER_COLLECTION_HAS_OBJECTS) != 0;
348 }
349 
350 static bool rna_LayerCollection_has_selected_objects(LayerCollection *lc, ViewLayer *view_layer)
351 {
352  return BKE_layer_collection_has_selected_objects(view_layer, lc);
353 }
354 
355 #else
356 
358 {
359  StructRNA *srna;
360  FunctionRNA *func;
361  PropertyRNA *prop;
362 
363  srna = RNA_def_struct(brna, "LayerCollection", NULL);
364  RNA_def_struct_ui_text(srna, "Layer Collection", "Layer collection");
365  RNA_def_struct_ui_icon(srna, ICON_OUTLINER_COLLECTION);
366 
367  prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
370  RNA_def_property_struct_type(prop, "Collection");
371  RNA_def_property_ui_text(prop, "Collection", "Collection this layer collection is wrapping");
372 
373  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
374  RNA_def_property_string_sdna(prop, NULL, "collection->id.name");
376  RNA_def_property_ui_text(prop, "Name", "Name of this view layer (same as its collection one)");
378  prop, "rna_LayerCollection_name_get", "rna_LayerCollection_name_length", NULL);
379  RNA_def_struct_name_property(srna, prop);
380 
381  prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
382  RNA_def_property_collection_sdna(prop, NULL, "layer_collections", NULL);
383  RNA_def_property_struct_type(prop, "LayerCollection");
384  RNA_def_property_ui_text(prop, "Children", "Child layer collections");
385 
386  /* Restriction flags. */
387  prop = RNA_def_property(srna, "exclude", PROP_BOOLEAN, PROP_NONE);
389  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_exclude_set");
391  RNA_def_property_ui_text(prop, "Exclude from View Layer", "Exclude from view layer");
392  RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, -1);
393  RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_exclude_update");
394 
395  prop = RNA_def_property(srna, "holdout", PROP_BOOLEAN, PROP_NONE);
397  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_holdout_set");
399  RNA_def_property_ui_icon(prop, ICON_HOLDOUT_OFF, 1);
400  RNA_def_property_ui_text(prop, "Holdout", "Mask out objects in collection from view layer");
401  RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update");
402 
403  prop = RNA_def_property(srna, "indirect_only", PROP_BOOLEAN, PROP_NONE);
405  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_indirect_only_set");
407  RNA_def_property_ui_icon(prop, ICON_INDIRECT_ONLY_OFF, 1);
409  prop,
410  "Indirect Only",
411  "Objects in collection only contribute indirectly (through shadows and reflections) "
412  "in the view layer");
413  RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update");
414 
415  prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
417  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_hide_viewport_set");
419  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
420  RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
421  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_update");
422 
423  func = RNA_def_function(srna, "visible_get", "rna_LayerCollection_visible_get");
425  "Whether this collection is visible, take into account the "
426  "collection parent and the viewport");
428  RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", ""));
429 
430  /* Run-time flags. */
431  prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
435  "Visible",
436  "Whether this collection is visible for the view layer, take into "
437  "account the collection parent");
438 
439  func = RNA_def_function(srna, "has_objects", "rna_LayerCollection_has_objects");
441  RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", ""));
442 
443  func = RNA_def_function(
444  srna, "has_selected_objects", "rna_LayerCollection_has_selected_objects");
446  prop = RNA_def_pointer(
447  func, "view_layer", "ViewLayer", "", "View layer the layer collection belongs to");
449  RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", ""));
450 }
451 
452 static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop)
453 {
454  StructRNA *srna;
455  PropertyRNA *prop;
456 
457  RNA_def_property_srna(cprop, "LayerObjects");
458  srna = RNA_def_struct(brna, "LayerObjects", NULL);
459  RNA_def_struct_sdna(srna, "ViewLayer");
460  RNA_def_struct_ui_text(srna, "Layer Objects", "Collections of objects");
461 
462  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
463  RNA_def_property_struct_type(prop, "Object");
465  "rna_LayerObjects_active_object_get",
466  "rna_LayerObjects_active_object_set",
467  NULL,
468  NULL);
470  RNA_def_property_ui_text(prop, "Active Object", "Active object for this layer");
471  /* Could call: `ED_object_base_activate(C, view_layer->basact);`
472  * but would be a bad level call and it seems the notifier is enough */
474 
475  prop = RNA_def_property(srna, "selected", PROP_COLLECTION, PROP_NONE);
476  RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL);
477  RNA_def_property_struct_type(prop, "Object");
479  "rna_LayerObjects_selected_begin",
480  "rna_iterator_listbase_next",
481  "rna_iterator_listbase_end",
482  "rna_ViewLayer_objects_get",
483  NULL,
484  NULL,
485  NULL,
486  NULL);
487  RNA_def_property_ui_text(prop, "Selected Objects", "All the selected objects of this layer");
488 }
489 
490 static void rna_def_object_base(BlenderRNA *brna)
491 {
492  StructRNA *srna;
493  PropertyRNA *prop;
494 
495  srna = RNA_def_struct(brna, "ObjectBase", NULL);
496  RNA_def_struct_sdna(srna, "Base");
497  RNA_def_struct_ui_text(srna, "Object Base", "An object instance in a render layer");
498  RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA);
499 
500  prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
501  RNA_def_property_pointer_sdna(prop, NULL, "object");
502  RNA_def_property_ui_text(prop, "Object", "Object this base links to");
503 
504  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
506  RNA_def_property_ui_text(prop, "Select", "Object base selection state");
507  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ObjectBase_select_update");
508 
509  prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
513  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
514  RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
516  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ObjectBase_hide_viewport_update");
517 }
518 
520 {
521  FunctionRNA *func;
522  StructRNA *srna;
523  PropertyRNA *prop;
524 
525  srna = RNA_def_struct(brna, "ViewLayer", NULL);
526  RNA_def_struct_ui_text(srna, "View Layer", "View layer");
527  RNA_def_struct_ui_icon(srna, ICON_RENDER_RESULT);
528  RNA_def_struct_path_func(srna, "rna_ViewLayer_path");
529  RNA_def_struct_idprops_func(srna, "rna_ViewLayer_idprops");
530 
531  rna_def_view_layer_common(brna, srna, true);
532 
533  func = RNA_def_function(srna, "update_render_passes", "rna_ViewLayer_update_render_passes");
535  "Requery the enabled render passes from the render engine");
537 
538  prop = RNA_def_property(srna, "layer_collection", PROP_POINTER, PROP_NONE);
539  RNA_def_property_struct_type(prop, "LayerCollection");
540  RNA_def_property_pointer_sdna(prop, NULL, "layer_collections.first");
543  prop,
544  "Layer Collection",
545  "Root of collections hierarchy of this view layer,"
546  "its 'collection' pointer property is the same as the scene's master collection");
547 
548  prop = RNA_def_property(srna, "active_layer_collection", PROP_POINTER, PROP_NONE);
549  RNA_def_property_struct_type(prop, "LayerCollection");
551  "rna_ViewLayer_active_layer_collection_get",
552  "rna_ViewLayer_active_layer_collection_set",
553  NULL,
554  NULL);
557  prop, "Active Layer Collection", "Active layer collection in this view layer's hierarchy");
559 
560  prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
561  RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL);
562  RNA_def_property_struct_type(prop, "Object");
564  prop, NULL, NULL, NULL, "rna_ViewLayer_objects_get", NULL, NULL, NULL, NULL);
565  RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer");
566  rna_def_layer_objects(brna, prop);
567 
568  /* layer options */
569  prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
571  RNA_def_property_ui_text(prop, "Enabled", "Enable or disable rendering of this View Layer");
573 
574  prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
576  RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer");
578 
579  /* Freestyle */
581 
582  prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
584  RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config");
585  RNA_def_property_struct_type(prop, "FreestyleSettings");
586  RNA_def_property_ui_text(prop, "Freestyle Settings", "");
587 
588  /* debug update routine */
589  func = RNA_def_function(srna, "update", "rna_ViewLayer_update_tagged");
592  func, "Update data tagged to be updated from previous access to data or operators");
593 
594  /* Dependency Graph */
595  prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE);
596  RNA_def_property_struct_type(prop, "Depsgraph");
598  RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data");
599  RNA_def_property_pointer_funcs(prop, "rna_ViewLayer_depsgraph_get", NULL, NULL, NULL);
600 
601  /* Nested Data. */
602  /* *** Non-Animated *** */
605  rna_def_object_base(brna);
607  /* *** Animated *** */
608 }
609 
610 #endif
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1100
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:784
struct ViewLayer * BKE_view_layer_find_from_collection(const struct Scene *scene, struct LayerCollection *lc)
void BKE_layer_collection_set_flag(struct LayerCollection *lc, int flag, bool value)
Definition: layer.c:1854
bool BKE_layer_collection_activate(struct ViewLayer *view_layer, struct LayerCollection *lc)
Definition: layer.c:641
#define FOREACH_OBJECT_END
Definition: BKE_layer.h:430
bool BKE_layer_collection_has_selected_objects(struct ViewLayer *view_layer, struct LayerCollection *lc)
Definition: layer.c:1445
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
Definition: layer.c:379
#define FOREACH_OBJECT_BEGIN(view_layer, _instance)
Definition: BKE_layer.h:423
void BKE_view_layer_verify_aov(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition: layer.c:2476
int BKE_layer_collection_findindex(struct ViewLayer *view_layer, const struct LayerCollection *lc)
void BKE_layer_collection_sync(const struct Scene *scene, struct ViewLayer *view_layer)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition: report.c:83
struct Depsgraph * BKE_scene_get_depsgraph(const struct Scene *scene, const struct ViewLayer *view_layer)
void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain)
Definition: scene.cc:2648
struct Depsgraph * BKE_scene_ensure_depsgraph(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
Definition: scene.cc:3456
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:250
#define UNUSED(x)
#define BPy_BEGIN_ALLOW_THREADS
Definition: BPY_extern.h:54
#define BPy_END_ALLOW_THREADS
Definition: BPY_extern.h:58
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:35
void DEG_make_active(struct Depsgraph *depsgraph)
Definition: depsgraph.cc:325
void DEG_id_tag_update(struct ID *id, int flag)
bool DEG_is_evaluating(const struct Depsgraph *depsgraph)
Definition: depsgraph.cc:306
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_ANIMATION
Definition: DNA_ID.h:794
@ ID_RECALC_BASE_FLAGS
Definition: DNA_ID.h:821
@ ID_SCE
Definition: DNA_ID_enums.h:45
Object groups, one object can be in many groups at once.
@ COLLECTION_IS_MASTER
@ LAYER_COLLECTION_HIDE
@ LAYER_COLLECTION_EXCLUDE
@ LAYER_COLLECTION_INDIRECT_ONLY
@ LAYER_COLLECTION_HOLDOUT
@ BASE_HIDDEN
@ BASE_SELECTED
@ VIEW_LAYER_FREESTYLE
@ VIEW_LAYER_RENDER
@ LAYER_COLLECTION_VISIBLE_VIEW_LAYER
@ LAYER_COLLECTION_HIDE_VIEWPORT
@ LAYER_COLLECTION_HAS_OBJECTS
Object is a sort of wrapper for general info.
#define V3D_LOCAL_COLLECTIONS
void ED_object_base_select(struct Base *base, eObjectSelect_Mode mode)
Definition: object_select.c:76
void ED_object_base_active_refresh(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
@ BA_DESELECT
Definition: ED_object.h:154
@ BA_SELECT
Definition: ED_object.h:155
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_NO_SELF
Definition: RNA_types.h:656
@ FUNC_USE_MAIN
Definition: RNA_types.h:661
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:662
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:650
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_STRING
Definition: RNA_types.h:62
@ PROP_POINTER
Definition: RNA_types.h:64
@ PROP_COLLECTION
Definition: RNA_types.h:65
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROPOVERRIDE_NO_COMPARISON
Definition: RNA_types.h:320
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:269
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_NEVER_UNLINK
Definition: RNA_types.h:246
@ PROP_EDITABLE
Definition: RNA_types.h:189
@ PROP_LIB_EXCEPTION
Definition: RNA_types.h:195
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_NONE
Definition: RNA_types.h:126
#define C
Definition: RandGen.cpp:25
#define ND_DRAW
Definition: WM_types.h:410
#define ND_OB_ACTIVE
Definition: WM_types.h:388
#define ND_OB_SELECT
Definition: WM_types.h:390
#define NC_SCENE
Definition: WM_types.h:328
#define ND_LAYER_CONTENT
Definition: WM_types.h:402
#define NC_IMAGE
Definition: WM_types.h:334
#define ND_LAYER
Definition: WM_types.h:398
#define NC_OBJECT
Definition: WM_types.h:329
Scene scene
const Depsgraph * depsgraph
RenderEngine * RE_engine_create(RenderEngineType *type)
Definition: engine.c:136
RenderEngineType * RE_engines_find(const char *idname)
Definition: engine.c:98
void RE_engine_free(RenderEngine *engine)
Definition: engine.c:164
#define GS(x)
Definition: iris.c:225
void ntreeCompositUpdateRLayers(bNodeTree *ntree)
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:61
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
Definition: rna_access.c:4729
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2740
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1193
void RNA_define_animate_sdna(bool animate)
Definition: rna_define.c:748
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3493
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4170
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2236
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3285
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4312
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2695
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1653
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4273
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3474
void RNA_def_property_collection_funcs(PropertyRNA *prop, const char *begin, const char *next, const char *end, const char *get, const char *length, const char *lookupint, const char *lookupstring, const char *assignint)
Definition: rna_define.c:3420
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2769
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4347
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2900
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1103
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4342
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1495
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
Definition: rna_define.c:3385
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
Definition: rna_define.c:1160
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1490
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1503
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1518
size_t rna_ViewLayer_path_buffer_get(const struct ViewLayer *view_layer, char *r_rna_path, const size_t rna_path_buffer_size)
void rna_def_freestyle_settings(struct BlenderRNA *brna)
Definition: rna_scene.c:4839
void rna_def_view_layer_common(struct BlenderRNA *brna, struct StructRNA *srna, bool scene)
Definition: rna_scene.c:4323
static void rna_def_object_base(BlenderRNA *brna)
Definition: rna_layer.c:490
static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_layer.c:452
static void rna_def_layer_collection(BlenderRNA *brna)
Definition: rna_layer.c:357
void RNA_def_view_layer(BlenderRNA *brna)
Definition: rna_layer.c:519
short flag
struct Object * object
ListBaseIterator listbase
Definition: RNA_types.h:409
union CollectionPropertyIterator::@1147 internal
Definition: DNA_ID.h:368
char name[66]
Definition: DNA_ID.h:378
unsigned short local_collections_bits
struct Collection * collection
Definition: BKE_main.h:121
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
char engine[32]
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition: RE_engine.h:109
struct bNodeTree * nodetree
struct RenderData r
ListBase view_layers
unsigned short local_collections_uuid
struct IDProperty * id_properties
LayerCollection * active_collection
struct Base * basact
ListBase object_bases
char name[64]
void WM_main_add_notifier(unsigned int type, void *reference)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480