Blender  V3.3
rna_collection.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #include <stdlib.h>
8 
9 #include "DNA_collection_types.h"
10 
11 #include "DNA_lineart_types.h"
12 
13 #include "BLI_utildefines.h"
14 
15 #include "RNA_define.h"
16 #include "RNA_enum_types.h"
17 
18 #include "rna_internal.h"
19 
20 #include "WM_types.h"
21 
23  {COLLECTION_COLOR_NONE, "NONE", ICON_X, "None", "Assign no color tag to the collection"},
24  {COLLECTION_COLOR_01, "COLOR_01", ICON_COLLECTION_COLOR_01, "Color 01", ""},
25  {COLLECTION_COLOR_02, "COLOR_02", ICON_COLLECTION_COLOR_02, "Color 02", ""},
26  {COLLECTION_COLOR_03, "COLOR_03", ICON_COLLECTION_COLOR_03, "Color 03", ""},
27  {COLLECTION_COLOR_04, "COLOR_04", ICON_COLLECTION_COLOR_04, "Color 04", ""},
28  {COLLECTION_COLOR_05, "COLOR_05", ICON_COLLECTION_COLOR_05, "Color 05", ""},
29  {COLLECTION_COLOR_06, "COLOR_06", ICON_COLLECTION_COLOR_06, "Color 06", ""},
30  {COLLECTION_COLOR_07, "COLOR_07", ICON_COLLECTION_COLOR_07, "Color 07", ""},
31  {COLLECTION_COLOR_08, "COLOR_08", ICON_COLLECTION_COLOR_08, "Color 08", ""},
32  {0, NULL, 0, NULL, NULL},
33 };
34 
35 #ifdef RNA_RUNTIME
36 
37 # include "DNA_object_types.h"
38 # include "DNA_scene_types.h"
39 
40 # include "DEG_depsgraph.h"
41 # include "DEG_depsgraph_build.h"
42 # include "DEG_depsgraph_query.h"
43 
44 # include "BKE_collection.h"
45 # include "BKE_global.h"
46 # include "BKE_layer.h"
47 
48 # include "WM_api.h"
49 
50 # include "RNA_access.h"
51 
52 static void rna_Collection_all_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
53 {
54  Collection *collection = (Collection *)ptr->data;
55  ListBase collection_objects = BKE_collection_object_cache_get(collection);
56  rna_iterator_listbase_begin(iter, &collection_objects, NULL);
57 }
58 
59 static PointerRNA rna_Collection_all_objects_get(CollectionPropertyIterator *iter)
60 {
61  ListBaseIterator *internal = &iter->internal.listbase;
62 
63  /* we are actually iterating a ObjectBase list, so override get */
64  Base *base = (Base *)internal->link;
65  return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object);
66 }
67 
68 static void rna_Collection_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
69 {
70  Collection *collection = (Collection *)ptr->data;
71  rna_iterator_listbase_begin(iter, &collection->gobject, NULL);
72 }
73 
74 static PointerRNA rna_Collection_objects_get(CollectionPropertyIterator *iter)
75 {
76  ListBaseIterator *internal = &iter->internal.listbase;
77 
78  /* we are actually iterating a ObjectBase list, so override get */
79  CollectionObject *cob = (CollectionObject *)internal->link;
80  return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, cob->ob);
81 }
82 
83 static bool rna_collection_objects_edit_check(Collection *collection,
84  ReportList *reports,
85  Object *object)
86 {
87  if (!DEG_is_original_id(&collection->id)) {
89  reports, RPT_ERROR, "Collection '%s' is not an original ID", collection->id.name + 2);
90  return false;
91  }
92  if (!DEG_is_original_id(&object->id)) {
93  BKE_reportf(reports, RPT_ERROR, "Collection '%s' is not an original ID", object->id.name + 2);
94  return false;
95  }
96  /* Currently this should not be allowed (might be supported in the future though...). */
97  if (ID_IS_OVERRIDE_LIBRARY(&collection->id)) {
98  BKE_reportf(reports,
99  RPT_ERROR,
100  "Could not (un)link the object '%s' because the collection '%s' is overridden",
101  object->id.name + 2,
102  collection->id.name + 2);
103  return false;
104  }
105  if (ID_IS_LINKED(&collection->id)) {
106  BKE_reportf(reports,
107  RPT_ERROR,
108  "Could not (un)link the object '%s' because the collection '%s' is linked",
109  object->id.name + 2,
110  collection->id.name + 2);
111  return false;
112  }
113  return true;
114 }
115 
116 static void rna_Collection_objects_link(Collection *collection,
117  Main *bmain,
118  ReportList *reports,
119  Object *object)
120 {
121  if (!rna_collection_objects_edit_check(collection, reports, object)) {
122  return;
123  }
124  if (!BKE_collection_object_add(bmain, collection, object)) {
125  BKE_reportf(reports,
126  RPT_ERROR,
127  "Object '%s' already in collection '%s'",
128  object->id.name + 2,
129  collection->id.name + 2);
130  return;
131  }
132 
136 }
137 
138 static void rna_Collection_objects_unlink(Collection *collection,
139  Main *bmain,
140  ReportList *reports,
141  Object *object)
142 {
143  if (!rna_collection_objects_edit_check(collection, reports, object)) {
144  return;
145  }
146  if (!BKE_collection_object_remove(bmain, collection, object, false)) {
147  BKE_reportf(reports,
148  RPT_ERROR,
149  "Object '%s' not in collection '%s'",
150  object->id.name + 2,
151  collection->id.name + 2);
152  return;
153  }
154 
158 }
159 
160 static bool rna_Collection_objects_override_apply(Main *bmain,
161  PointerRNA *ptr_dst,
162  PointerRNA *UNUSED(ptr_src),
163  PointerRNA *UNUSED(ptr_storage),
164  PropertyRNA *prop_dst,
165  PropertyRNA *UNUSED(prop_src),
166  PropertyRNA *UNUSED(prop_storage),
167  const int UNUSED(len_dst),
168  const int UNUSED(len_src),
169  const int UNUSED(len_storage),
170  PointerRNA *ptr_item_dst,
171  PointerRNA *ptr_item_src,
172  PointerRNA *UNUSED(ptr_item_storage),
174 {
176  "Unsupported RNA override operation on collections' objects");
177  UNUSED_VARS_NDEBUG(opop);
178 
179  Collection *coll_dst = (Collection *)ptr_dst->owner_id;
180 
181  if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) {
182  // BLI_assert_msg(0, "invalid source or destination object.");
183  return false;
184  }
185 
186  Object *ob_dst = ptr_item_dst->data;
187  Object *ob_src = ptr_item_src->data;
188 
189  if (ob_src == ob_dst) {
190  return true;
191  }
192 
193  CollectionObject *cob_dst = BLI_findptr(
194  &coll_dst->gobject, ob_dst, offsetof(CollectionObject, ob));
195 
196  if (cob_dst == NULL) {
197  BLI_assert_msg(0, "Could not find destination object in destination collection!");
198  return false;
199  }
200 
201  /* XXX TODO: We most certainly rather want to have a 'swap object pointer in collection'
202  * util in BKE_collection. This is only temp quick dirty test! */
203  id_us_min(&cob_dst->ob->id);
204  cob_dst->ob = ob_src;
205  id_us_plus(&cob_dst->ob->id);
206 
207  if (BKE_collection_is_in_scene(coll_dst)) {
209  }
210 
211  RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
212  return true;
213 }
214 
215 static void rna_Collection_children_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
216 {
217  Collection *collection = (Collection *)ptr->data;
218  rna_iterator_listbase_begin(iter, &collection->children, NULL);
219 }
220 
221 static PointerRNA rna_Collection_children_get(CollectionPropertyIterator *iter)
222 {
223  ListBaseIterator *internal = &iter->internal.listbase;
224 
225  /* we are actually iterating a CollectionChild list, so override get */
226  CollectionChild *child = (CollectionChild *)internal->link;
227  return rna_pointer_inherit_refine(&iter->parent, &RNA_Collection, child->collection);
228 }
229 
230 static bool rna_collection_children_edit_check(Collection *collection,
231  ReportList *reports,
232  Collection *child)
233 {
234  if (!DEG_is_original_id(&collection->id)) {
235  BKE_reportf(
236  reports, RPT_ERROR, "Collection '%s' is not an original ID", collection->id.name + 2);
237  return false;
238  }
239  if (!DEG_is_original_id(&child->id)) {
240  BKE_reportf(reports, RPT_ERROR, "Collection '%s' is not an original ID", child->id.name + 2);
241  return false;
242  }
243  /* Currently this should not be allowed (might be supported in the future though...). */
244  if (ID_IS_OVERRIDE_LIBRARY(&collection->id)) {
245  BKE_reportf(reports,
246  RPT_ERROR,
247  "Could not (un)link the collection '%s' because the collection '%s' is overridden",
248  child->id.name + 2,
249  collection->id.name + 2);
250  return false;
251  }
252  if (ID_IS_LINKED(&collection->id)) {
253  BKE_reportf(reports,
254  RPT_ERROR,
255  "Could not (un)link the collection '%s' because the collection '%s' is linked",
256  child->id.name + 2,
257  collection->id.name + 2);
258  return false;
259  }
260  return true;
261 }
262 
263 static void rna_Collection_children_link(Collection *collection,
264  Main *bmain,
265  ReportList *reports,
266  Collection *child)
267 {
268  if (!rna_collection_children_edit_check(collection, reports, child)) {
269  return;
270  }
271  if (!BKE_collection_child_add(bmain, collection, child)) {
272  BKE_reportf(reports,
273  RPT_ERROR,
274  "Collection '%s' already in collection '%s'",
275  child->id.name + 2,
276  collection->id.name + 2);
277  return;
278  }
279 
283 }
284 
285 static void rna_Collection_children_unlink(Collection *collection,
286  Main *bmain,
287  ReportList *reports,
288  Collection *child)
289 {
290  if (!rna_collection_children_edit_check(collection, reports, child)) {
291  return;
292  }
293  if (!BKE_collection_child_remove(bmain, collection, child)) {
294  BKE_reportf(reports,
295  RPT_ERROR,
296  "Collection '%s' not in collection '%s'",
297  child->id.name + 2,
298  collection->id.name + 2);
299  return;
300  }
301 
305 }
306 
307 static bool rna_Collection_children_override_apply(Main *bmain,
308  PointerRNA *ptr_dst,
309  PointerRNA *UNUSED(ptr_src),
310  PointerRNA *UNUSED(ptr_storage),
311  PropertyRNA *prop_dst,
312  PropertyRNA *UNUSED(prop_src),
313  PropertyRNA *UNUSED(prop_storage),
314  const int UNUSED(len_dst),
315  const int UNUSED(len_src),
316  const int UNUSED(len_storage),
317  PointerRNA *ptr_item_dst,
318  PointerRNA *ptr_item_src,
319  PointerRNA *UNUSED(ptr_item_storage),
321 {
323  "Unsupported RNA override operation on collections' children");
324  UNUSED_VARS_NDEBUG(opop);
325 
326  Collection *coll_dst = (Collection *)ptr_dst->owner_id;
327 
328  if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) {
329  /* This can happen when reference and overrides differ, just ignore then. */
330  return false;
331  }
332 
333  Collection *subcoll_dst = ptr_item_dst->data;
334  Collection *subcoll_src = ptr_item_src->data;
335 
336  CollectionChild *collchild_dst = BLI_findptr(
337  &coll_dst->children, subcoll_dst, offsetof(CollectionChild, collection));
338 
339  if (collchild_dst == NULL) {
340  BLI_assert_msg(0, "Could not find destination sub-collection in destination collection!");
341  return false;
342  }
343 
344  /* XXX TODO: We most certainly rather want to have a 'swap object pointer in collection'
345  * util in BKE_collection. This is only temp quick dirty test! */
346  id_us_min(&collchild_dst->collection->id);
347  collchild_dst->collection = subcoll_src;
348  id_us_plus(&collchild_dst->collection->id);
349 
352 
353  RNA_property_update_main(bmain, NULL, ptr_dst, prop_dst);
354  return true;
355 }
356 
357 static void rna_Collection_flag_set(PointerRNA *ptr, const bool value, const int flag)
358 {
359  Collection *collection = (Collection *)ptr->data;
360 
361  if (collection->flag & COLLECTION_IS_MASTER) {
362  return;
363  }
364 
365  if (value) {
366  collection->flag |= flag;
367  }
368  else {
369  collection->flag &= ~flag;
370  }
371 }
372 
373 static void rna_Collection_hide_select_set(PointerRNA *ptr, bool value)
374 {
375  rna_Collection_flag_set(ptr, value, COLLECTION_HIDE_SELECT);
376 }
377 
378 static void rna_Collection_hide_viewport_set(PointerRNA *ptr, bool value)
379 {
380  rna_Collection_flag_set(ptr, value, COLLECTION_HIDE_VIEWPORT);
381 }
382 
383 static void rna_Collection_hide_render_set(PointerRNA *ptr, bool value)
384 {
385  rna_Collection_flag_set(ptr, value, COLLECTION_HIDE_RENDER);
386 }
387 
388 static void rna_Collection_flag_update(Main *bmain, Scene *scene, PointerRNA *ptr)
389 {
390  Collection *collection = (Collection *)ptr->data;
393 
397 }
398 
399 static int rna_Collection_color_tag_get(struct PointerRNA *ptr)
400 {
401  Collection *collection = (Collection *)ptr->data;
402 
403  return collection->color_tag;
404 }
405 
406 static void rna_Collection_color_tag_set(struct PointerRNA *ptr, int value)
407 {
408  Collection *collection = (Collection *)ptr->data;
409 
410  if (collection->flag & COLLECTION_IS_MASTER) {
411  return;
412  }
413 
414  collection->color_tag = value;
415 }
416 
417 static void rna_Collection_color_tag_update(Main *UNUSED(bmain),
418  Scene *scene,
420 {
422 }
423 
424 static void rna_Collection_instance_offset_update(Main *UNUSED(bmain),
425  Scene *UNUSED(scene),
426  PointerRNA *ptr)
427 {
428  Collection *collection = (Collection *)ptr->data;
429  DEG_id_tag_update(&collection->id, ID_RECALC_GEOMETRY);
430 }
431 
432 #else
433 
434 /* collection.objects */
436 {
437  StructRNA *srna;
438  FunctionRNA *func;
439  PropertyRNA *parm;
440 
441  RNA_def_property_srna(cprop, "CollectionObjects");
442  srna = RNA_def_struct(brna, "CollectionObjects", NULL);
443  RNA_def_struct_sdna(srna, "Collection");
444  RNA_def_struct_ui_text(srna, "Collection Objects", "Collection of collection objects");
445 
446  /* add object */
447  func = RNA_def_function(srna, "link", "rna_Collection_objects_link");
449  RNA_def_function_ui_description(func, "Add this object to a collection");
450  parm = RNA_def_pointer(func, "object", "Object", "", "Object to add");
452 
453  /* remove object */
454  func = RNA_def_function(srna, "unlink", "rna_Collection_objects_unlink");
455  RNA_def_function_ui_description(func, "Remove this object from a collection");
457  parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
459 }
460 
461 /* collection.children */
463 {
464  StructRNA *srna;
465  FunctionRNA *func;
466  PropertyRNA *parm;
467 
468  RNA_def_property_srna(cprop, "CollectionChildren");
469  srna = RNA_def_struct(brna, "CollectionChildren", NULL);
470  RNA_def_struct_sdna(srna, "Collection");
471  RNA_def_struct_ui_text(srna, "Collection Children", "Collection of child collections");
472 
473  /* add child */
474  func = RNA_def_function(srna, "link", "rna_Collection_children_link");
476  RNA_def_function_ui_description(func, "Add this collection as child of this collection");
477  parm = RNA_def_pointer(func, "child", "Collection", "", "Collection to add");
479 
480  /* remove child */
481  func = RNA_def_function(srna, "unlink", "rna_Collection_children_unlink");
482  RNA_def_function_ui_description(func, "Remove this child collection from a collection");
484  parm = RNA_def_pointer(func, "child", "Collection", "", "Collection to remove");
486 }
487 
489 {
490  StructRNA *srna;
491  PropertyRNA *prop;
492 
493  srna = RNA_def_struct(brna, "Collection", "ID");
494  RNA_def_struct_ui_text(srna, "Collection", "Collection of Object data-blocks");
495  RNA_def_struct_ui_icon(srna, ICON_OUTLINER_COLLECTION);
496  /* This is done on save/load in readfile.c,
497  * removed if no objects are in the collection and not in a scene. */
499 
501 
502  prop = RNA_def_property(srna, "instance_offset", PROP_FLOAT, PROP_TRANSLATION);
504  prop, "Instance Offset", "Offset from the origin to use when instancing");
505  RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
506  RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Collection_instance_offset_update");
507 
508  prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
509  RNA_def_property_struct_type(prop, "Object");
510  RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Collection_objects_override_apply");
511  RNA_def_property_ui_text(prop, "Objects", "Objects that are directly in this collection");
513  "rna_Collection_objects_begin",
514  "rna_iterator_listbase_next",
515  "rna_iterator_listbase_end",
516  "rna_Collection_objects_get",
517  NULL,
518  NULL,
519  NULL,
520  NULL);
521  rna_def_collection_objects(brna, prop);
522 
523  prop = RNA_def_property(srna, "all_objects", PROP_COLLECTION, PROP_NONE);
524  RNA_def_property_struct_type(prop, "Object");
526  prop, "All Objects", "Objects that are in this collection and its child collections");
530  "rna_Collection_all_objects_begin",
531  "rna_iterator_listbase_next",
532  "rna_iterator_listbase_end",
533  "rna_Collection_all_objects_get",
534  NULL,
535  NULL,
536  NULL,
537  NULL);
538 
539  prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
540  RNA_def_property_struct_type(prop, "Collection");
541  RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Collection_children_override_apply");
543  prop, "Children", "Collections that are immediate children of this collection");
545  "rna_Collection_children_begin",
546  "rna_iterator_listbase_next",
547  "rna_iterator_listbase_end",
548  "rna_Collection_children_get",
549  NULL,
550  NULL,
551  NULL,
552  NULL);
553  rna_def_collection_children(brna, prop);
554 
555  /* Flags */
556  prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
558  RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_select_set");
560  RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, -1);
561  RNA_def_property_ui_text(prop, "Disable Selection", "Disable selection in viewport");
562  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
563 
564  prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
566  RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_viewport_set");
568  RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
569  RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
570  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
571 
572  prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
574  RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_render_set");
576  RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, -1);
577  RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
578  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
579 
580  static const EnumPropertyItem rna_collection_lineart_usage[] = {
582  "INCLUDE",
583  0,
584  "Include",
585  "Generate feature lines for this collection"},
587  "OCCLUSION_ONLY",
588  0,
589  "Occlusion Only",
590  "Only use the collection to produce occlusion"},
591  {COLLECTION_LRT_EXCLUDE, "EXCLUDE", 0, "Exclude", "Don't use this collection in line art"},
593  "INTERSECTION_ONLY",
594  0,
595  "Intersection Only",
596  "Only generate intersection lines for this collection"},
598  "NO_INTERSECTION",
599  0,
600  "No Intersection",
601  "Include this collection but do not generate intersection lines"},
603  "FORCE_INTERSECTION",
604  0,
605  "Force Intersection",
606  "Generate intersection lines even with objects that disabled intersection"},
607  {0, NULL, 0, NULL, NULL}};
608 
609  prop = RNA_def_property(srna, "lineart_usage", PROP_ENUM, PROP_NONE);
610  RNA_def_property_enum_items(prop, rna_collection_lineart_usage);
611  RNA_def_property_ui_text(prop, "Usage", "How to use this collection in line art");
613 
614  prop = RNA_def_property(srna, "lineart_use_intersection_mask", PROP_BOOLEAN, PROP_NONE);
615  RNA_def_property_boolean_sdna(prop, NULL, "lineart_flags", 1);
617  prop, "Use Intersection Masks", "Use custom intersection mask for faces in this collection");
619 
620  prop = RNA_def_property(srna, "lineart_intersection_mask", PROP_BOOLEAN, PROP_NONE);
621  RNA_def_property_boolean_sdna(prop, NULL, "lineart_intersection_mask", 1);
622  RNA_def_property_array(prop, 8);
624  prop, "Masks", "Intersection generated by this collection will have this mask value");
626 
627  prop = RNA_def_property(srna, "lineart_intersection_priority", PROP_INT, PROP_NONE);
628  RNA_def_property_range(prop, 0, 255);
630  "Intersection Priority",
631  "The intersection line will be included into the object with the "
632  "higher intersection priority value");
634 
635  prop = RNA_def_property(srna, "use_lineart_intersection_priority", PROP_BOOLEAN, PROP_NONE);
638  prop, NULL, "lineart_flags", COLLECTION_LRT_USE_INTERSECTION_PRIORITY);
640  prop, "Use Intersection Priority", "Assign intersection priority value for this collection");
642 
643  prop = RNA_def_property(srna, "color_tag", PROP_ENUM, PROP_NONE);
644  RNA_def_property_enum_sdna(prop, NULL, "color_tag");
646  prop, "rna_Collection_color_tag_get", "rna_Collection_color_tag_set", NULL);
648  RNA_def_property_ui_text(prop, "Collection Color", "Color tag for a collection");
649  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_color_tag_update");
650 
652 }
653 
654 #endif
struct ListBase BKE_collection_object_cache_get(struct Collection *collection)
Definition: collection.c:787
bool BKE_collection_child_add(struct Main *bmain, struct Collection *parent, struct Collection *child)
Definition: collection.c:1585
void BKE_collection_object_cache_free(struct Collection *collection)
Definition: collection.c:832
bool BKE_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *ob)
Definition: collection.c:1125
bool BKE_collection_child_remove(struct Main *bmain, struct Collection *parent, struct Collection *child)
Definition: collection.c:1600
bool BKE_collection_object_remove(struct Main *bmain, struct Collection *collection, struct Object *object, bool free_us)
Definition: collection.c:1170
bool BKE_collection_is_in_scene(struct Collection *collection)
Definition: collection.c:1385
void BKE_main_collection_sync(const struct Main *bmain)
void id_us_min(struct ID *id)
Definition: lib_id.c:313
void id_us_plus(struct ID *id)
Definition: lib_id.c:305
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert(a)
Definition: BLI_assert.h:46
#define BLI_assert_msg(a, msg)
Definition: BLI_assert.h:53
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define UNUSED_VARS_NDEBUG(...)
#define UNUSED(x)
void DEG_id_tag_update(struct ID *id, int flag)
void DEG_relations_tag_update(struct Main *bmain)
bool DEG_is_original_id(const struct ID *id)
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:834
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:791
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:566
@ IDOVERRIDE_LIBRARY_OP_REPLACE
Definition: DNA_ID.h:220
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition: DNA_ID.h:588
Object groups, one object can be in many groups at once.
@ COLLECTION_LRT_EXCLUDE
@ COLLECTION_LRT_INCLUDE
@ COLLECTION_LRT_INTERSECTION_ONLY
@ COLLECTION_LRT_FORCE_INTERSECTION
@ COLLECTION_LRT_OCCLUSION_ONLY
@ COLLECTION_LRT_NO_INTERSECTION
@ COLLECTION_HIDE_RENDER
@ COLLECTION_HIDE_SELECT
@ COLLECTION_IS_MASTER
@ COLLECTION_HIDE_VIEWPORT
@ COLLECTION_LRT_USE_INTERSECTION_PRIORITY
@ COLLECTION_COLOR_NONE
@ COLLECTION_COLOR_02
@ COLLECTION_COLOR_05
@ COLLECTION_COLOR_07
@ COLLECTION_COLOR_06
@ COLLECTION_COLOR_04
@ COLLECTION_COLOR_01
@ COLLECTION_COLOR_08
@ COLLECTION_COLOR_03
Object is a sort of wrapper for general info.
@ PARM_REQUIRED
Definition: RNA_types.h:352
@ FUNC_USE_REPORTS
Definition: RNA_types.h:663
@ FUNC_USE_MAIN
Definition: RNA_types.h:661
@ STRUCT_ID_REFCOUNT
Definition: RNA_types.h:706
@ PROP_FLOAT
Definition: RNA_types.h:61
@ PROP_BOOLEAN
Definition: RNA_types.h:59
@ PROP_ENUM
Definition: RNA_types.h:63
@ PROP_INT
Definition: RNA_types.h:60
@ PROP_COLLECTION
Definition: RNA_types.h:65
#define RNA_TRANSLATION_PREC_DEFAULT
Definition: RNA_types.h:117
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:312
@ PROPOVERRIDE_NO_COMPARISON
Definition: RNA_types.h:320
@ PROP_ANIMATABLE
Definition: RNA_types.h:202
@ PROP_NEVER_NULL
Definition: RNA_types.h:239
@ PROP_NONE
Definition: RNA_types.h:126
@ PROP_TRANSLATION
Definition: RNA_types.h:154
#define ND_DRAW
Definition: WM_types.h:410
#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_OBJECT
Definition: WM_types.h:329
Scene scene
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
Definition: rna_access.c:4729
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
Definition: rna_access.c:2143
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
Definition: rna_access.c:186
static void rna_def_collection_objects(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_collection_children(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_collections(BlenderRNA *brna)
const EnumPropertyItem rna_enum_collection_color_items[]
void RNA_define_lib_overridable(const bool make_overridable)
Definition: rna_define.c:742
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_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1645
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_default(PropertyRNA *prop, bool value)
Definition: rna_define.c:1937
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
Definition: rna_define.c:2944
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1872
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1048
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
Definition: rna_define.c:1138
void RNA_def_property_array(PropertyRNA *prop, int length)
Definition: rna_define.c:1539
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
Definition: rna_define.c:1737
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1772
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
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3224
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1257
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
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1028
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2601
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1245
void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
Definition: rna_define.c:2879
void RNA_def_property_override_clear_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1508
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1664
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
struct Object * object
struct Collection * collection
struct Object * ob
ListBaseIterator listbase
Definition: RNA_types.h:409
union CollectionPropertyIterator::@1147 internal
char name[66]
Definition: DNA_ID.h:378
Definition: BKE_main.h:121
struct StructRNA * type
Definition: RNA_types.h:37
void * data
Definition: RNA_types.h:38
struct ID * owner_id
Definition: RNA_types.h:36
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3480