Blender  V2.93
rna_layer.c
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 #include "DNA_layer_types.h"
22 #include "DNA_scene_types.h"
23 #include "DNA_view3d_types.h"
24 
25 #include "BLT_translation.h"
26 
27 #include "ED_object.h"
28 #include "ED_render.h"
29 
30 #include "RE_engine.h"
31 
32 #include "WM_api.h"
33 #include "WM_types.h"
34 
35 #include "RNA_define.h"
36 
37 #include "rna_internal.h"
38 
39 #ifdef RNA_RUNTIME
40 
41 # ifdef WITH_PYTHON
42 # include "BPY_extern.h"
43 # endif
44 
45 # include "DNA_collection_types.h"
46 # include "DNA_object_types.h"
47 
48 # include "RNA_access.h"
49 
50 # include "BKE_idprop.h"
51 # include "BKE_layer.h"
52 # include "BKE_mesh.h"
53 # include "BKE_node.h"
54 # include "BKE_scene.h"
55 
56 # include "BLI_listbase.h"
57 
58 # include "DEG_depsgraph_build.h"
59 # include "DEG_depsgraph_query.h"
60 
61 /***********************************/
62 
63 static PointerRNA rna_ViewLayer_active_layer_collection_get(PointerRNA *ptr)
64 {
65  ViewLayer *view_layer = (ViewLayer *)ptr->data;
66  LayerCollection *lc = view_layer->active_collection;
68 }
69 
70 static void rna_ViewLayer_active_layer_collection_set(PointerRNA *ptr,
71  PointerRNA value,
72  struct ReportList *UNUSED(reports))
73 {
74  ViewLayer *view_layer = (ViewLayer *)ptr->data;
75  LayerCollection *lc = (LayerCollection *)value.data;
76  const int index = BKE_layer_collection_findindex(view_layer, lc);
77  if (index != -1) {
78  BKE_layer_collection_activate(view_layer, lc);
79  }
80 }
81 
82 static PointerRNA rna_LayerObjects_active_object_get(PointerRNA *ptr)
83 {
84  ViewLayer *view_layer = (ViewLayer *)ptr->data;
86  ptr, &RNA_Object, view_layer->basact ? view_layer->basact->object : NULL);
87 }
88 
89 static void rna_LayerObjects_active_object_set(PointerRNA *ptr,
90  PointerRNA value,
91  struct ReportList *reports)
92 {
93  ViewLayer *view_layer = (ViewLayer *)ptr->data;
94  if (value.data) {
95  Object *ob = value.data;
96  Base *basact_test = BKE_view_layer_base_find(view_layer, ob);
97  if (basact_test != NULL) {
98  view_layer->basact = basact_test;
99  }
100  else {
101  BKE_reportf(reports,
102  RPT_ERROR,
103  "ViewLayer '%s' does not contain object '%s'",
104  view_layer->name,
105  ob->id.name + 2);
106  }
107  }
108  else {
109  view_layer->basact = NULL;
110  }
111 }
112 
113 static char *rna_ViewLayer_path(PointerRNA *ptr)
114 {
115  ViewLayer *srl = (ViewLayer *)ptr->data;
116  char name_esc[sizeof(srl->name) * 2];
117 
118  BLI_str_escape(name_esc, srl->name, sizeof(name_esc));
119  return BLI_sprintfN("view_layers[\"%s\"]", name_esc);
120 }
121 
122 static IDProperty *rna_ViewLayer_idprops(PointerRNA *ptr, bool create)
123 {
124  ViewLayer *view_layer = (ViewLayer *)ptr->data;
125 
126  if (create && !view_layer->id_properties) {
127  IDPropertyTemplate val = {0};
128  view_layer->id_properties = IDP_New(IDP_GROUP, &val, "ViewLayer ID properties");
129  }
130 
131  return view_layer->id_properties;
132 }
133 
134 static bool rna_LayerCollection_visible_get(LayerCollection *layer_collection, bContext *C)
135 {
136  View3D *v3d = CTX_wm_view3d(C);
137 
138  if ((v3d == NULL) || ((v3d->flag & V3D_LOCAL_COLLECTIONS) == 0)) {
139  return (layer_collection->runtime_flag & LAYER_COLLECTION_VISIBLE_VIEW_LAYER) != 0;
140  }
141 
142  if (v3d->local_collections_uuid & layer_collection->local_collections_bits) {
143  return (layer_collection->runtime_flag & LAYER_COLLECTION_RESTRICT_VIEWPORT) == 0;
144  }
145 
146  return false;
147 }
148 
149 static void rna_ViewLayer_update_render_passes(ID *id)
150 {
151  Scene *scene = (Scene *)id;
152  if (scene->nodetree) {
154  }
155 
156  RenderEngineType *engine_type = RE_engines_find(scene->r.engine);
157  if (engine_type->update_render_passes) {
158  RenderEngine *engine = RE_engine_create(engine_type);
159  if (engine) {
160  LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) {
161  BKE_view_layer_verify_aov(engine, scene, view_layer);
162  }
163  }
164  RE_engine_free(engine);
165  engine = NULL;
166  }
167 }
168 
169 static PointerRNA rna_ViewLayer_objects_get(CollectionPropertyIterator *iter)
170 {
171  ListBaseIterator *internal = &iter->internal.listbase;
172 
173  /* we are actually iterating a ObjectBase list */
174  Base *base = (Base *)internal->link;
175  return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object);
176 }
177 
178 static int rna_ViewLayer_objects_selected_skip(CollectionPropertyIterator *iter,
179  void *UNUSED(data))
180 {
181  ListBaseIterator *internal = &iter->internal.listbase;
182  Base *base = (Base *)internal->link;
183 
184  if ((base->flag & BASE_SELECTED) != 0) {
185  return 0;
186  }
187 
188  return 1;
189 };
190 
191 static PointerRNA rna_ViewLayer_depsgraph_get(PointerRNA *ptr)
192 {
193  ID *id = ptr->owner_id;
194  if (GS(id->name) == ID_SCE) {
195  Scene *scene = (Scene *)id;
196  ViewLayer *view_layer = (ViewLayer *)ptr->data;
199  }
200  return PointerRNA_NULL;
201 }
202 
203 static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
204 {
205  ViewLayer *view_layer = (ViewLayer *)ptr->data;
207  iter, &view_layer->object_bases, rna_ViewLayer_objects_selected_skip);
208 }
209 
210 static void rna_ViewLayer_update_tagged(ID *id_ptr,
211  ViewLayer *view_layer,
212  Main *bmain,
213  ReportList *reports)
214 {
215  Scene *scene = (Scene *)id_ptr;
216  Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer);
217 
219  BKE_report(reports, RPT_ERROR, "Dependency graph update requested during evaluation");
220  return;
221  }
222 
223 # ifdef WITH_PYTHON
224  /* Allow drivers to be evaluated */
226 # endif
227 
228  /* NOTE: This is similar to CTX_data_depsgraph_pointer(). Ideally such access would be
229  * de-duplicated across all possible cases, but for now this is safest and easiest way to go.
230  *
231  * The reason for this is that it's possible to have Python operator which asks view layer to
232  * be updated. After re-do of such operator view layer's dependency graph will not be marked
233  * as active. */
236 
237 # ifdef WITH_PYTHON
239 # endif
240 }
241 
242 static void rna_ObjectBase_select_update(Main *UNUSED(bmain),
243  Scene *UNUSED(scene),
244  PointerRNA *ptr)
245 {
246  Base *base = (Base *)ptr->data;
247  short mode = (base->flag & BASE_SELECTED) ? BA_SELECT : BA_DESELECT;
248  ED_object_base_select(base, mode);
249 }
250 
251 static void rna_ObjectBase_hide_viewport_update(bContext *C, PointerRNA *UNUSED(ptr))
252 {
254  ViewLayer *view_layer = CTX_data_view_layer(C);
255  BKE_layer_collection_sync(scene, view_layer);
258 }
259 
260 static void rna_LayerCollection_name_get(struct PointerRNA *ptr, char *value)
261 {
262  ID *id = (ID *)((LayerCollection *)ptr->data)->collection;
263  BLI_strncpy(value, id->name + 2, sizeof(id->name) - 2);
264 }
265 
266 int rna_LayerCollection_name_length(PointerRNA *ptr)
267 {
268  ID *id = (ID *)((LayerCollection *)ptr->data)->collection;
269  return strlen(id->name + 2);
270 }
271 
272 static void rna_LayerCollection_flag_set(PointerRNA *ptr, const bool value, const int flag)
273 {
274  LayerCollection *layer_collection = (LayerCollection *)ptr->data;
275  Collection *collection = layer_collection->collection;
276 
277  if (collection->flag & COLLECTION_IS_MASTER) {
278  return;
279  }
280 
281  if (value) {
282  layer_collection->flag |= flag;
283  }
284  else {
285  layer_collection->flag &= ~flag;
286  }
287 }
288 
289 static void rna_LayerCollection_exclude_set(PointerRNA *ptr, bool value)
290 {
291  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_EXCLUDE);
292 }
293 
294 static void rna_LayerCollection_holdout_set(PointerRNA *ptr, bool value)
295 {
296  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_HOLDOUT);
297 }
298 
299 static void rna_LayerCollection_indirect_only_set(PointerRNA *ptr, bool value)
300 {
301  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_INDIRECT_ONLY);
302 }
303 
304 static void rna_LayerCollection_hide_viewport_set(PointerRNA *ptr, bool value)
305 {
306  rna_LayerCollection_flag_set(ptr, value, LAYER_COLLECTION_HIDE);
307 }
308 
309 static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
310 {
311  Scene *scene = (Scene *)ptr->owner_id;
314 
315  /* Set/Unset it recursively to match the behavior of excluding via the menu or shortcuts. */
316  const bool exclude = (lc->flag & LAYER_COLLECTION_EXCLUDE) != 0;
318 
319  BKE_layer_collection_sync(scene, view_layer);
320 
322  if (!exclude) {
323  /* We need to update animation of objects added back to the scene through enabling this view
324  * layer. */
325  FOREACH_OBJECT_BEGIN (view_layer, ob) {
327  }
329  }
330 
333  if (exclude) {
334  ED_object_base_active_refresh(bmain, scene, view_layer);
335  }
336 }
337 
338 static void rna_LayerCollection_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
339 {
340  Scene *scene = (Scene *)ptr->owner_id;
343 
344  BKE_layer_collection_sync(scene, view_layer);
345 
347 
349 }
350 
351 static bool rna_LayerCollection_has_objects(LayerCollection *lc)
352 {
353  return (lc->runtime_flag & LAYER_COLLECTION_HAS_OBJECTS) != 0;
354 }
355 
356 static bool rna_LayerCollection_has_selected_objects(LayerCollection *lc, ViewLayer *view_layer)
357 {
358  return BKE_layer_collection_has_selected_objects(view_layer, lc);
359 }
360 
361 #else
362 
364 {
365  StructRNA *srna;
366  FunctionRNA *func;
367  PropertyRNA *prop;
368 
369  srna = RNA_def_struct(brna, "LayerCollection", NULL);
370  RNA_def_struct_ui_text(srna, "Layer Collection", "Layer collection");
371  RNA_def_struct_ui_icon(srna, ICON_OUTLINER_COLLECTION);
372 
373  prop = RNA_def_property(srna, "collection", PROP_POINTER, PROP_NONE);
376  RNA_def_property_struct_type(prop, "Collection");
377  RNA_def_property_ui_text(prop, "Collection", "Collection this layer collection is wrapping");
378 
379  prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
380  RNA_def_property_string_sdna(prop, NULL, "collection->id.name");
382  RNA_def_property_ui_text(prop, "Name", "Name of this view layer (same as its collection one)");
384  prop, "rna_LayerCollection_name_get", "rna_LayerCollection_name_length", NULL);
385  RNA_def_struct_name_property(srna, prop);
386 
387  prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
388  RNA_def_property_collection_sdna(prop, NULL, "layer_collections", NULL);
389  RNA_def_property_struct_type(prop, "LayerCollection");
390  RNA_def_property_ui_text(prop, "Children", "Child layer collections");
391 
392  /* Restriction flags. */
393  prop = RNA_def_property(srna, "exclude", PROP_BOOLEAN, PROP_NONE);
395  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_exclude_set");
397  RNA_def_property_ui_text(prop, "Exclude from View Layer", "Exclude from view layer");
398  RNA_def_property_ui_icon(prop, ICON_CHECKBOX_HLT, -1);
399  RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_exclude_update");
400 
401  prop = RNA_def_property(srna, "holdout", PROP_BOOLEAN, PROP_NONE);
403  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_holdout_set");
405  RNA_def_property_ui_icon(prop, ICON_HOLDOUT_OFF, 1);
406  RNA_def_property_ui_text(prop, "Holdout", "Mask out objects in collection from view layer");
407  RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update");
408 
409  prop = RNA_def_property(srna, "indirect_only", PROP_BOOLEAN, PROP_NONE);
411  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_indirect_only_set");
413  RNA_def_property_ui_icon(prop, ICON_INDIRECT_ONLY_OFF, 1);
415  prop,
416  "Indirect Only",
417  "Objects in collection only contribute indirectly (through shadows and reflections) "
418  "in the view layer");
419  RNA_def_property_update(prop, NC_SCENE | ND_LAYER, "rna_LayerCollection_update");
420 
421  prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
423  RNA_def_property_boolean_funcs(prop, NULL, "rna_LayerCollection_hide_viewport_set");
425  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
426  RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
427  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_LayerCollection_update");
428 
429  func = RNA_def_function(srna, "visible_get", "rna_LayerCollection_visible_get");
431  "Whether this collection is visible, take into account the "
432  "collection parent and the viewport");
434  RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", ""));
435 
436  /* Run-time flags. */
437  prop = RNA_def_property(srna, "is_visible", PROP_BOOLEAN, PROP_NONE);
441  "Visible",
442  "Whether this collection is visible for the view layer, take into "
443  "account the collection parent");
444 
445  func = RNA_def_function(srna, "has_objects", "rna_LayerCollection_has_objects");
447  RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", ""));
448 
449  func = RNA_def_function(
450  srna, "has_selected_objects", "rna_LayerCollection_has_selected_objects");
452  prop = RNA_def_pointer(
453  func, "view_layer", "ViewLayer", "", "View layer the layer collection belongs to");
455  RNA_def_function_return(func, RNA_def_boolean(func, "result", 0, "", ""));
456 }
457 
458 static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop)
459 {
460  StructRNA *srna;
461  PropertyRNA *prop;
462 
463  RNA_def_property_srna(cprop, "LayerObjects");
464  srna = RNA_def_struct(brna, "LayerObjects", NULL);
465  RNA_def_struct_sdna(srna, "ViewLayer");
466  RNA_def_struct_ui_text(srna, "Layer Objects", "Collections of objects");
467 
468  prop = RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE);
469  RNA_def_property_struct_type(prop, "Object");
471  "rna_LayerObjects_active_object_get",
472  "rna_LayerObjects_active_object_set",
473  NULL,
474  NULL);
476  RNA_def_property_ui_text(prop, "Active Object", "Active object for this layer");
477  /* Could call: `ED_object_base_activate(C, view_layer->basact);`
478  * but would be a bad level call and it seems the notifier is enough */
480 
481  prop = RNA_def_property(srna, "selected", PROP_COLLECTION, PROP_NONE);
482  RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL);
483  RNA_def_property_struct_type(prop, "Object");
485  "rna_LayerObjects_selected_begin",
486  "rna_iterator_listbase_next",
487  "rna_iterator_listbase_end",
488  "rna_ViewLayer_objects_get",
489  NULL,
490  NULL,
491  NULL,
492  NULL);
493  RNA_def_property_ui_text(prop, "Selected Objects", "All the selected objects of this layer");
494 }
495 
496 static void rna_def_object_base(BlenderRNA *brna)
497 {
498  StructRNA *srna;
499  PropertyRNA *prop;
500 
501  srna = RNA_def_struct(brna, "ObjectBase", NULL);
502  RNA_def_struct_sdna(srna, "Base");
503  RNA_def_struct_ui_text(srna, "Object Base", "An object instance in a render layer");
504  RNA_def_struct_ui_icon(srna, ICON_OBJECT_DATA);
505 
506  prop = RNA_def_property(srna, "object", PROP_POINTER, PROP_NONE);
507  RNA_def_property_pointer_sdna(prop, NULL, "object");
508  RNA_def_property_ui_text(prop, "Object", "Object this base links to");
509 
510  prop = RNA_def_property(srna, "select", PROP_BOOLEAN, PROP_NONE);
512  RNA_def_property_ui_text(prop, "Select", "Object base selection state");
513  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ObjectBase_select_update");
514 
515  prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
519  RNA_def_property_ui_icon(prop, ICON_HIDE_OFF, -1);
520  RNA_def_property_ui_text(prop, "Hide in Viewport", "Temporarily hide in viewport");
522  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_ObjectBase_hide_viewport_update");
523 }
524 
526 {
527  FunctionRNA *func;
528  StructRNA *srna;
529  PropertyRNA *prop;
530 
531  srna = RNA_def_struct(brna, "ViewLayer", NULL);
532  RNA_def_struct_ui_text(srna, "View Layer", "View layer");
533  RNA_def_struct_ui_icon(srna, ICON_RENDER_RESULT);
534  RNA_def_struct_path_func(srna, "rna_ViewLayer_path");
535  RNA_def_struct_idprops_func(srna, "rna_ViewLayer_idprops");
536 
537  rna_def_view_layer_common(brna, srna, true);
538 
539  func = RNA_def_function(srna, "update_render_passes", "rna_ViewLayer_update_render_passes");
541  "Requery the enabled render passes from the render engine");
543 
544  prop = RNA_def_property(srna, "layer_collection", PROP_POINTER, PROP_NONE);
545  RNA_def_property_struct_type(prop, "LayerCollection");
546  RNA_def_property_pointer_sdna(prop, NULL, "layer_collections.first");
549  prop,
550  "Layer Collection",
551  "Root of collections hierarchy of this view layer,"
552  "its 'collection' pointer property is the same as the scene's master collection");
553 
554  prop = RNA_def_property(srna, "active_layer_collection", PROP_POINTER, PROP_NONE);
555  RNA_def_property_struct_type(prop, "LayerCollection");
557  "rna_ViewLayer_active_layer_collection_get",
558  "rna_ViewLayer_active_layer_collection_set",
559  NULL,
560  NULL);
563  prop, "Active Layer Collection", "Active layer collection in this view layer's hierarchy");
565 
566  prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
567  RNA_def_property_collection_sdna(prop, NULL, "object_bases", NULL);
568  RNA_def_property_struct_type(prop, "Object");
570  prop, NULL, NULL, NULL, "rna_ViewLayer_objects_get", NULL, NULL, NULL, NULL);
571  RNA_def_property_ui_text(prop, "Objects", "All the objects in this layer");
572  rna_def_layer_objects(brna, prop);
573 
574  /* layer options */
575  prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
577  RNA_def_property_ui_text(prop, "Enabled", "Enable or disable rendering of this View Layer");
579 
580  prop = RNA_def_property(srna, "use_freestyle", PROP_BOOLEAN, PROP_NONE);
582  RNA_def_property_ui_text(prop, "Freestyle", "Render stylized strokes in this Layer");
584 
585  /* Freestyle */
587 
588  prop = RNA_def_property(srna, "freestyle_settings", PROP_POINTER, PROP_NONE);
590  RNA_def_property_pointer_sdna(prop, NULL, "freestyle_config");
591  RNA_def_property_struct_type(prop, "FreestyleSettings");
592  RNA_def_property_ui_text(prop, "Freestyle Settings", "");
593 
594  /* debug update routine */
595  func = RNA_def_function(srna, "update", "rna_ViewLayer_update_tagged");
598  func, "Update data tagged to be updated from previous access to data or operators");
599 
600  /* Dependency Graph */
601  prop = RNA_def_property(srna, "depsgraph", PROP_POINTER, PROP_NONE);
602  RNA_def_property_struct_type(prop, "Depsgraph");
604  RNA_def_property_ui_text(prop, "Dependency Graph", "Dependencies in the scene data");
605  RNA_def_property_pointer_funcs(prop, "rna_ViewLayer_depsgraph_get", NULL, NULL, NULL);
606 
607  /* Nested Data */
608  /* *** Non-Animated *** */
611  rna_def_object_base(brna);
613  /* *** Animated *** */
614 }
615 
616 #endif
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1034
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct IDProperty * IDP_New(const char type, const IDPropertyTemplate *val, const char *name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition: idprop.c:907
void BKE_layer_collection_set_flag(struct LayerCollection *lc, const int flag, const bool value)
Definition: layer.c:1477
struct ViewLayer * BKE_view_layer_find_from_collection(const struct Scene *scene, struct LayerCollection *lc)
bool BKE_layer_collection_activate(struct ViewLayer *view_layer, struct LayerCollection *lc)
Definition: layer.c:638
#define FOREACH_OBJECT_END
Definition: BKE_layer.h:331
bool BKE_layer_collection_has_selected_objects(struct ViewLayer *view_layer, struct LayerCollection *lc)
Definition: layer.c:1067
struct Base * BKE_view_layer_base_find(struct ViewLayer *view_layer, struct Object *ob)
Definition: layer.c:394
#define FOREACH_OBJECT_BEGIN(view_layer, _instance)
Definition: BKE_layer.h:324
void BKE_view_layer_verify_aov(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition: layer.c:2095
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 ntreeCompositUpdateRLayers(struct bNodeTree *ntree)
void BKE_report(ReportList *reports, ReportType type, const char *message)
Definition: report.c:104
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
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.c:2713
struct Depsgraph * BKE_scene_ensure_depsgraph(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
Definition: scene.c:3526
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
size_t size_t char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
size_t size_t char size_t BLI_str_escape(char *__restrict dst, const char *__restrict src, const size_t dst_maxncpy) ATTR_NONNULL()
Definition: string.c:333
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
#define UNUSED(x)
#define BPy_BEGIN_ALLOW_THREADS
Definition: BPY_extern.h:62
#define BPy_END_ALLOW_THREADS
Definition: BPY_extern.h:66
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
void DEG_make_active(struct Depsgraph *depsgraph)
Definition: depsgraph.cc:344
void DEG_id_tag_update(struct ID *id, int flag)
bool DEG_is_evaluating(const struct Depsgraph *depsgraph)
Definition: depsgraph.cc:325
void DEG_relations_tag_update(struct Main *bmain)
@ ID_RECALC_ANIMATION
Definition: DNA_ID.h:614
@ ID_RECALC_BASE_FLAGS
Definition: DNA_ID.h:641
@ IDP_GROUP
Definition: DNA_ID.h:101
@ ID_SCE
Definition: DNA_ID_enums.h:57
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
@ LAYER_COLLECTION_RESTRICT_VIEWPORT
@ LAYER_COLLECTION_VISIBLE_VIEW_LAYER
@ LAYER_COLLECTION_HAS_OBJECTS
@ VIEW_LAYER_FREESTYLE
@ VIEW_LAYER_RENDER
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:98
void ED_object_base_active_refresh(struct Main *bmain, struct Scene *scene, struct ViewLayer *view_layer)
@ BA_DESELECT
Definition: ED_object.h:146
@ BA_SELECT
Definition: ED_object.h:147
StructRNA RNA_LayerCollection
StructRNA RNA_Depsgraph
StructRNA RNA_Object
@ PARM_REQUIRED
Definition: RNA_types.h:337
@ FUNC_USE_REPORTS
Definition: RNA_types.h:578
@ FUNC_NO_SELF
Definition: RNA_types.h:571
@ FUNC_USE_MAIN
Definition: RNA_types.h:576
@ FUNC_USE_CONTEXT
Definition: RNA_types.h:577
@ FUNC_USE_SELF_ID
Definition: RNA_types.h:565
@ PROP_BOOLEAN
Definition: RNA_types.h:73
@ PROP_STRING
Definition: RNA_types.h:76
@ PROP_POINTER
Definition: RNA_types.h:78
@ PROP_COLLECTION
Definition: RNA_types.h:79
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:297
@ PROPOVERRIDE_NO_COMPARISON
Definition: RNA_types.h:305
@ PROP_CONTEXT_UPDATE
Definition: RNA_types.h:254
@ PROP_ANIMATABLE
Definition: RNA_types.h:188
@ PROP_NEVER_UNLINK
Definition: RNA_types.h:232
@ PROP_EDITABLE
Definition: RNA_types.h:175
@ PROP_LIB_EXCEPTION
Definition: RNA_types.h:181
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
@ PROP_NONE
Definition: RNA_types.h:113
#define C
Definition: RandGen.cpp:39
#define ND_DRAW
Definition: WM_types.h:362
#define ND_OB_ACTIVE
Definition: WM_types.h:340
#define ND_OB_SELECT
Definition: WM_types.h:342
#define NC_SCENE
Definition: WM_types.h:279
#define ND_LAYER_CONTENT
Definition: WM_types.h:354
#define ND_LAYER
Definition: WM_types.h:350
#define NC_OBJECT
Definition: WM_types.h:280
Scene scene
const Depsgraph * depsgraph
RenderEngine * RE_engine_create(RenderEngineType *type)
Definition: engine.c:133
RenderEngineType * RE_engines_find(const char *idname)
Definition: engine.c:108
void RE_engine_free(RenderEngine *engine)
Definition: engine.c:161
#define GS(x)
Definition: iris.c:241
const PointerRNA PointerRNA_NULL
Definition: rna_access.c:71
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
Definition: rna_access.c:4823
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:196
void RNA_def_property_pointer_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2762
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
Definition: rna_define.c:1212
void RNA_define_animate_sdna(bool animate)
Definition: rna_define.c:766
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4159
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
Definition: rna_define.c:2257
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
Definition: rna_define.c:3312
void RNA_def_function_return(FunctionRNA *func, PropertyRNA *ret)
Definition: rna_define.c:4302
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
void RNA_def_property_string_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2717
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
Definition: rna_define.c:1684
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
Definition: rna_define.c:4262
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
Definition: rna_define.c:3462
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:3408
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1259
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2971
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1067
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1792
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
Definition: rna_define.c:2791
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
Definition: rna_define.c:4337
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
Definition: rna_define.c:2927
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
void RNA_def_struct_name_property(struct StructRNA *srna, struct PropertyRNA *prop)
Definition: rna_define.c:1122
void RNA_def_function_flag(FunctionRNA *func, int flag)
Definition: rna_define.c:4332
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1517
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:3373
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1047
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1267
void RNA_def_struct_idprops_func(StructRNA *srna, const char *idproperties)
Definition: rna_define.c:1179
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition: rna_define.c:1512
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1525
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
Definition: rna_define.c:1547
void rna_def_view_layer_common(struct BlenderRNA *brna, struct StructRNA *srna, const bool scene)
Definition: rna_scene.c:3980
void rna_def_freestyle_settings(struct BlenderRNA *brna)
Definition: rna_scene.c:4525
static void rna_def_object_base(BlenderRNA *brna)
Definition: rna_layer.c:496
static void rna_def_layer_objects(BlenderRNA *brna, PropertyRNA *cprop)
Definition: rna_layer.c:458
static void rna_def_layer_collection(BlenderRNA *brna)
Definition: rna_layer.c:363
void RNA_def_view_layer(BlenderRNA *brna)
Definition: rna_layer.c:525
short flag
struct Object * object
union CollectionPropertyIterator::@1099 internal
ListBaseIterator listbase
Definition: RNA_types.h:394
Definition: DNA_ID.h:273
char name[66]
Definition: DNA_ID.h:283
unsigned short local_collections_bits
struct Collection * collection
Definition: BKE_main.h:116
void * data
Definition: RNA_types.h:52
struct ID * owner_id
Definition: RNA_types.h:50
char engine[32]
void(* update_render_passes)(struct RenderEngine *engine, struct Scene *scene, struct ViewLayer *view_layer)
Definition: RE_engine.h:107
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]
__forceinline const avxi srl(const avxi &a, const int32_t b)
Definition: util_avxi.h:348
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:3157