Blender  V2.93
rna_collection.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 <stdlib.h>
22 
23 #include "DNA_collection_types.h"
24 
25 #include "DNA_lineart_types.h"
26 
27 #include "BLI_utildefines.h"
28 
29 #include "RNA_define.h"
30 #include "RNA_enum_types.h"
31 
32 #include "rna_internal.h"
33 
34 #include "WM_types.h"
35 
37  {COLLECTION_COLOR_NONE, "NONE", ICON_X, "None", "Assign no color tag to the collection"},
38  {COLLECTION_COLOR_01, "COLOR_01", ICON_COLLECTION_COLOR_01, "Color 01", ""},
39  {COLLECTION_COLOR_02, "COLOR_02", ICON_COLLECTION_COLOR_02, "Color 02", ""},
40  {COLLECTION_COLOR_03, "COLOR_03", ICON_COLLECTION_COLOR_03, "Color 03", ""},
41  {COLLECTION_COLOR_04, "COLOR_04", ICON_COLLECTION_COLOR_04, "Color 04", ""},
42  {COLLECTION_COLOR_05, "COLOR_05", ICON_COLLECTION_COLOR_05, "Color 05", ""},
43  {COLLECTION_COLOR_06, "COLOR_06", ICON_COLLECTION_COLOR_06, "Color 06", ""},
44  {COLLECTION_COLOR_07, "COLOR_07", ICON_COLLECTION_COLOR_07, "Color 07", ""},
45  {COLLECTION_COLOR_08, "COLOR_08", ICON_COLLECTION_COLOR_08, "Color 08", ""},
46  {0, NULL, 0, NULL, NULL},
47 };
48 
49 #ifdef RNA_RUNTIME
50 
51 # include "DNA_object_types.h"
52 # include "DNA_scene_types.h"
53 
54 # include "DEG_depsgraph.h"
55 # include "DEG_depsgraph_build.h"
56 
57 # include "BKE_collection.h"
58 # include "BKE_global.h"
59 # include "BKE_layer.h"
60 
61 # include "WM_api.h"
62 
63 # include "RNA_access.h"
64 
65 static void rna_Collection_all_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
66 {
67  Collection *collection = (Collection *)ptr->data;
68  ListBase collection_objects = BKE_collection_object_cache_get(collection);
69  rna_iterator_listbase_begin(iter, &collection_objects, NULL);
70 }
71 
72 static PointerRNA rna_Collection_all_objects_get(CollectionPropertyIterator *iter)
73 {
74  ListBaseIterator *internal = &iter->internal.listbase;
75 
76  /* we are actually iterating a ObjectBase list, so override get */
77  Base *base = (Base *)internal->link;
78  return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, base->object);
79 }
80 
81 static void rna_Collection_objects_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
82 {
83  Collection *collection = (Collection *)ptr->data;
84  rna_iterator_listbase_begin(iter, &collection->gobject, NULL);
85 }
86 
87 static PointerRNA rna_Collection_objects_get(CollectionPropertyIterator *iter)
88 {
89  ListBaseIterator *internal = &iter->internal.listbase;
90 
91  /* we are actually iterating a ObjectBase list, so override get */
92  CollectionObject *cob = (CollectionObject *)internal->link;
93  return rna_pointer_inherit_refine(&iter->parent, &RNA_Object, cob->ob);
94 }
95 
96 static void rna_Collection_objects_link(Collection *collection,
97  Main *bmain,
98  ReportList *reports,
99  Object *object)
100 {
101  /* Currently this should not be allowed (might be supported in the future though...). */
102  if (ID_IS_OVERRIDE_LIBRARY(&collection->id)) {
103  BKE_reportf(reports,
104  RPT_ERROR,
105  "Could not link the object '%s' because the collection '%s' is overridden",
106  object->id.name + 2,
107  collection->id.name + 2);
108  return;
109  }
110  if (ID_IS_LINKED(&collection->id)) {
111  BKE_reportf(reports,
112  RPT_ERROR,
113  "Could not link the object '%s' because the collection '%s' is linked",
114  object->id.name + 2,
115  collection->id.name + 2);
116  return;
117  }
118  if (!BKE_collection_object_add(bmain, collection, object)) {
119  BKE_reportf(reports,
120  RPT_ERROR,
121  "Object '%s' already in collection '%s'",
122  object->id.name + 2,
123  collection->id.name + 2);
124  return;
125  }
126 
130 }
131 
132 static void rna_Collection_objects_unlink(Collection *collection,
133  Main *bmain,
134  ReportList *reports,
135  Object *object)
136 {
137  if (!BKE_collection_object_remove(bmain, collection, object, false)) {
138  BKE_reportf(reports,
139  RPT_ERROR,
140  "Object '%s' not in collection '%s'",
141  object->id.name + 2,
142  collection->id.name + 2);
143  return;
144  }
145 
149 }
150 
151 static bool rna_Collection_objects_override_apply(Main *bmain,
152  PointerRNA *ptr_dst,
153  PointerRNA *UNUSED(ptr_src),
154  PointerRNA *UNUSED(ptr_storage),
155  PropertyRNA *UNUSED(prop_dst),
156  PropertyRNA *UNUSED(prop_src),
157  PropertyRNA *UNUSED(prop_storage),
158  const int UNUSED(len_dst),
159  const int UNUSED(len_src),
160  const int UNUSED(len_storage),
161  PointerRNA *ptr_item_dst,
162  PointerRNA *ptr_item_src,
163  PointerRNA *UNUSED(ptr_item_storage),
165 {
167  "Unsupported RNA override operation on collections' objects");
168  UNUSED_VARS_NDEBUG(opop);
169 
170  Collection *coll_dst = (Collection *)ptr_dst->owner_id;
171 
172  if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) {
173  // BLI_assert(0 && "invalid source or destination object.");
174  return false;
175  }
176 
177  Object *ob_dst = ptr_item_dst->data;
178  Object *ob_src = ptr_item_src->data;
179 
180  if (ob_src == ob_dst) {
181  return true;
182  }
183 
184  CollectionObject *cob_dst = BLI_findptr(
185  &coll_dst->gobject, ob_dst, offsetof(CollectionObject, ob));
186 
187  if (cob_dst == NULL) {
188  BLI_assert(0 && "Could not find destination object in destination collection!");
189  return false;
190  }
191 
192  /* XXX TODO We most certainly rather want to have a 'swap object pointer in collection'
193  * util in BKE_collection. This is only temp quick dirty test! */
194  id_us_min(&cob_dst->ob->id);
195  cob_dst->ob = ob_src;
196  id_us_plus(&cob_dst->ob->id);
197 
198  if (BKE_collection_is_in_scene(coll_dst)) {
200  }
201 
202  return true;
203 }
204 
205 static void rna_Collection_children_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
206 {
207  Collection *collection = (Collection *)ptr->data;
208  rna_iterator_listbase_begin(iter, &collection->children, NULL);
209 }
210 
211 static PointerRNA rna_Collection_children_get(CollectionPropertyIterator *iter)
212 {
213  ListBaseIterator *internal = &iter->internal.listbase;
214 
215  /* we are actually iterating a CollectionChild list, so override get */
216  CollectionChild *child = (CollectionChild *)internal->link;
218 }
219 
220 static void rna_Collection_children_link(Collection *collection,
221  Main *bmain,
222  ReportList *reports,
223  Collection *child)
224 {
225  if (!BKE_collection_child_add(bmain, collection, child)) {
226  BKE_reportf(reports,
227  RPT_ERROR,
228  "Collection '%s' already in collection '%s'",
229  child->id.name + 2,
230  collection->id.name + 2);
231  return;
232  }
233 
237 }
238 
239 static void rna_Collection_children_unlink(Collection *collection,
240  Main *bmain,
241  ReportList *reports,
242  Collection *child)
243 {
244  if (!BKE_collection_child_remove(bmain, collection, child)) {
245  BKE_reportf(reports,
246  RPT_ERROR,
247  "Collection '%s' not in collection '%s'",
248  child->id.name + 2,
249  collection->id.name + 2);
250  return;
251  }
252 
256 }
257 
258 static bool rna_Collection_children_override_apply(Main *bmain,
259  PointerRNA *ptr_dst,
260  PointerRNA *UNUSED(ptr_src),
261  PointerRNA *UNUSED(ptr_storage),
262  PropertyRNA *UNUSED(prop_dst),
263  PropertyRNA *UNUSED(prop_src),
264  PropertyRNA *UNUSED(prop_storage),
265  const int UNUSED(len_dst),
266  const int UNUSED(len_src),
267  const int UNUSED(len_storage),
268  PointerRNA *ptr_item_dst,
269  PointerRNA *ptr_item_src,
270  PointerRNA *UNUSED(ptr_item_storage),
272 {
274  "Unsupported RNA override operation on collections' children");
275  UNUSED_VARS_NDEBUG(opop);
276 
277  Collection *coll_dst = (Collection *)ptr_dst->owner_id;
278 
279  if (ptr_item_dst->type == NULL || ptr_item_src->type == NULL) {
280  /* This can happen when reference and overrides differ, just ignore then. */
281  return false;
282  }
283 
284  Collection *subcoll_dst = ptr_item_dst->data;
285  Collection *subcoll_src = ptr_item_src->data;
286 
287  CollectionChild *collchild_dst = BLI_findptr(
288  &coll_dst->children, subcoll_dst, offsetof(CollectionChild, collection));
289 
290  if (collchild_dst == NULL) {
291  BLI_assert(0 && "Could not find destination sub-collection in destination collection!");
292  return false;
293  }
294 
295  /* XXX TODO We most certainly rather want to have a 'swap object pointer in collection'
296  * util in BKE_collection. This is only temp quick dirty test! */
297  id_us_min(&collchild_dst->collection->id);
298  collchild_dst->collection = subcoll_src;
299  id_us_plus(&collchild_dst->collection->id);
300 
303 
304  return true;
305 }
306 
307 static void rna_Collection_flag_set(PointerRNA *ptr, const bool value, const int flag)
308 {
309  Collection *collection = (Collection *)ptr->data;
310 
311  if (collection->flag & COLLECTION_IS_MASTER) {
312  return;
313  }
314 
315  if (value) {
316  collection->flag |= flag;
317  }
318  else {
319  collection->flag &= ~flag;
320  }
321 }
322 
323 static void rna_Collection_hide_select_set(PointerRNA *ptr, bool value)
324 {
325  rna_Collection_flag_set(ptr, value, COLLECTION_RESTRICT_SELECT);
326 }
327 
328 static void rna_Collection_hide_viewport_set(PointerRNA *ptr, bool value)
329 {
330  rna_Collection_flag_set(ptr, value, COLLECTION_RESTRICT_VIEWPORT);
331 }
332 
333 static void rna_Collection_hide_render_set(PointerRNA *ptr, bool value)
334 {
335  rna_Collection_flag_set(ptr, value, COLLECTION_RESTRICT_RENDER);
336 }
337 
338 static void rna_Collection_flag_update(Main *bmain, Scene *scene, PointerRNA *ptr)
339 {
340  Collection *collection = (Collection *)ptr->data;
343 
347 }
348 
349 static int rna_Collection_color_tag_get(struct PointerRNA *ptr)
350 {
351  Collection *collection = (Collection *)ptr->data;
352 
353  return collection->color_tag;
354 }
355 
356 static void rna_Collection_color_tag_set(struct PointerRNA *ptr, int value)
357 {
358  Collection *collection = (Collection *)ptr->data;
359 
360  if (collection->flag & COLLECTION_IS_MASTER) {
361  return;
362  }
363 
364  collection->color_tag = value;
365 }
366 
367 static void rna_Collection_color_tag_update(Main *UNUSED(bmain),
368  Scene *scene,
370 {
372 }
373 
374 #else
375 
376 /* collection.objects */
378 {
379  StructRNA *srna;
380  FunctionRNA *func;
381  PropertyRNA *parm;
382 
383  RNA_def_property_srna(cprop, "CollectionObjects");
384  srna = RNA_def_struct(brna, "CollectionObjects", NULL);
385  RNA_def_struct_sdna(srna, "Collection");
386  RNA_def_struct_ui_text(srna, "Collection Objects", "Collection of collection objects");
387 
388  /* add object */
389  func = RNA_def_function(srna, "link", "rna_Collection_objects_link");
391  RNA_def_function_ui_description(func, "Add this object to a collection");
392  parm = RNA_def_pointer(func, "object", "Object", "", "Object to add");
394 
395  /* remove object */
396  func = RNA_def_function(srna, "unlink", "rna_Collection_objects_unlink");
397  RNA_def_function_ui_description(func, "Remove this object from a collection");
399  parm = RNA_def_pointer(func, "object", "Object", "", "Object to remove");
401 }
402 
403 /* collection.children */
405 {
406  StructRNA *srna;
407  FunctionRNA *func;
408  PropertyRNA *parm;
409 
410  RNA_def_property_srna(cprop, "CollectionChildren");
411  srna = RNA_def_struct(brna, "CollectionChildren", NULL);
412  RNA_def_struct_sdna(srna, "Collection");
413  RNA_def_struct_ui_text(srna, "Collection Children", "Collection of child collections");
414 
415  /* add child */
416  func = RNA_def_function(srna, "link", "rna_Collection_children_link");
418  RNA_def_function_ui_description(func, "Add this collection as child of this collection");
419  parm = RNA_def_pointer(func, "child", "Collection", "", "Collection to add");
421 
422  /* remove child */
423  func = RNA_def_function(srna, "unlink", "rna_Collection_children_unlink");
424  RNA_def_function_ui_description(func, "Remove this child collection from a collection");
426  parm = RNA_def_pointer(func, "child", "Collection", "", "Collection to remove");
428 }
429 
431 {
432  StructRNA *srna;
433  PropertyRNA *prop;
434 
435  srna = RNA_def_struct(brna, "Collection", "ID");
436  RNA_def_struct_ui_text(srna, "Collection", "Collection of Object data-blocks");
437  RNA_def_struct_ui_icon(srna, ICON_OUTLINER_COLLECTION);
438  /* This is done on save/load in readfile.c,
439  * removed if no objects are in the collection and not in a scene. */
441 
443 
444  prop = RNA_def_property(srna, "instance_offset", PROP_FLOAT, PROP_TRANSLATION);
446  prop, "Instance Offset", "Offset from the origin to use when instancing");
447  RNA_def_property_ui_range(prop, -10000.0, 10000.0, 10, RNA_TRANSLATION_PREC_DEFAULT);
449 
450  prop = RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
451  RNA_def_property_struct_type(prop, "Object");
452  RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Collection_objects_override_apply");
453  RNA_def_property_ui_text(prop, "Objects", "Objects that are directly in this collection");
455  "rna_Collection_objects_begin",
456  "rna_iterator_listbase_next",
457  "rna_iterator_listbase_end",
458  "rna_Collection_objects_get",
459  NULL,
460  NULL,
461  NULL,
462  NULL);
463  rna_def_collection_objects(brna, prop);
464 
465  prop = RNA_def_property(srna, "all_objects", PROP_COLLECTION, PROP_NONE);
466  RNA_def_property_struct_type(prop, "Object");
468  prop, "All Objects", "Objects that are in this collection and its child collections");
472  "rna_Collection_all_objects_begin",
473  "rna_iterator_listbase_next",
474  "rna_iterator_listbase_end",
475  "rna_Collection_all_objects_get",
476  NULL,
477  NULL,
478  NULL,
479  NULL);
480 
481  prop = RNA_def_property(srna, "children", PROP_COLLECTION, PROP_NONE);
482  RNA_def_property_struct_type(prop, "Collection");
483  RNA_def_property_override_funcs(prop, NULL, NULL, "rna_Collection_children_override_apply");
485  prop, "Children", "Collections that are immediate children of this collection");
487  "rna_Collection_children_begin",
488  "rna_iterator_listbase_next",
489  "rna_iterator_listbase_end",
490  "rna_Collection_children_get",
491  NULL,
492  NULL,
493  NULL,
494  NULL);
495  rna_def_collection_children(brna, prop);
496 
497  /* Flags */
498  prop = RNA_def_property(srna, "hide_select", PROP_BOOLEAN, PROP_NONE);
500  RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_select_set");
502  RNA_def_property_ui_icon(prop, ICON_RESTRICT_SELECT_OFF, -1);
503  RNA_def_property_ui_text(prop, "Disable Selection", "Disable selection in viewport");
504  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
505 
506  prop = RNA_def_property(srna, "hide_viewport", PROP_BOOLEAN, PROP_NONE);
508  RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_viewport_set");
510  RNA_def_property_ui_icon(prop, ICON_RESTRICT_VIEW_OFF, -1);
511  RNA_def_property_ui_text(prop, "Disable in Viewports", "Globally disable in viewports");
512  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
513 
514  prop = RNA_def_property(srna, "hide_render", PROP_BOOLEAN, PROP_NONE);
516  RNA_def_property_boolean_funcs(prop, NULL, "rna_Collection_hide_render_set");
518  RNA_def_property_ui_icon(prop, ICON_RESTRICT_RENDER_OFF, -1);
519  RNA_def_property_ui_text(prop, "Disable in Renders", "Globally disable in renders");
520  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_flag_update");
521 
522  static const EnumPropertyItem rna_collection_lineart_usage[] = {
524  "INCLUDE",
525  0,
526  "Include",
527  "Generate feature lines for this collection"},
529  "OCCLUSION_ONLY",
530  0,
531  "Occlusion Only",
532  "Only use the collection to produce occlusion"},
533  {COLLECTION_LRT_EXCLUDE, "EXCLUDE", 0, "Exclude", "Don't use this collection in line art"},
535  "INTERSECTION_ONLY",
536  0,
537  "Intersection Only",
538  "Only generate intersection lines for this collection"},
540  "NO_INTERSECTION",
541  0,
542  "No Intersection",
543  "Include this collection but do not generate intersection lines"},
544  {0, NULL, 0, NULL, NULL}};
545 
546  prop = RNA_def_property(srna, "lineart_usage", PROP_ENUM, PROP_NONE);
547  RNA_def_property_enum_items(prop, rna_collection_lineart_usage);
548  RNA_def_property_ui_text(prop, "Usage", "How to use this collection in line art");
550 
551  prop = RNA_def_property(srna, "color_tag", PROP_ENUM, PROP_NONE);
552  RNA_def_property_enum_sdna(prop, NULL, "color_tag");
554  prop, "rna_Collection_color_tag_get", "rna_Collection_color_tag_set", NULL);
556  RNA_def_property_ui_text(prop, "Collection Color", "Color tag for a collection");
557  RNA_def_property_update(prop, NC_SCENE | ND_LAYER_CONTENT, "rna_Collection_color_tag_update");
558 
560 }
561 
562 #endif
struct ListBase BKE_collection_object_cache_get(struct Collection *collection)
Definition: collection.c:827
bool BKE_collection_child_add(struct Main *bmain, struct Collection *parent, struct Collection *child)
Definition: collection.c:1606
void BKE_collection_object_cache_free(struct Collection *collection)
Definition: collection.c:872
bool BKE_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *ob)
Definition: collection.c:1134
bool BKE_collection_child_remove(struct Main *bmain, struct Collection *parent, struct Collection *child)
Definition: collection.c:1621
bool BKE_collection_is_in_scene(struct Collection *collection)
Definition: collection.c:1391
bool BKE_collection_object_remove(struct Main *bmain, struct Collection *collection, struct Object *object, const bool free_us)
Definition: collection.c:1193
void BKE_main_collection_sync(const struct Main *bmain)
void id_us_min(struct ID *id)
Definition: lib_id.c:297
void id_us_plus(struct ID *id)
Definition: lib_id.c:288
void BKE_reportf(ReportList *reports, ReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert(a)
Definition: BLI_assert.h:58
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, const 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)
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:654
#define ID_IS_LINKED(_id)
Definition: DNA_ID.h:426
#define ID_IS_OVERRIDE_LIBRARY(_id)
Definition: DNA_ID.h:445
@ IDOVERRIDE_LIBRARY_OP_REPLACE
Definition: DNA_ID.h:176
Object groups, one object can be in many groups at once.
@ COLLECTION_LRT_EXCLUDE
@ COLLECTION_LRT_INCLUDE
@ COLLECTION_LRT_INTERSECTION_ONLY
@ COLLECTION_LRT_OCCLUSION_ONLY
@ COLLECTION_LRT_NO_INTERSECTION
@ 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
@ COLLECTION_RESTRICT_RENDER
@ COLLECTION_RESTRICT_VIEWPORT
@ COLLECTION_IS_MASTER
@ COLLECTION_RESTRICT_SELECT
Object is a sort of wrapper for general info.
StructRNA RNA_Collection
StructRNA RNA_Object
@ PARM_REQUIRED
Definition: RNA_types.h:337
@ FUNC_USE_REPORTS
Definition: RNA_types.h:578
@ FUNC_USE_MAIN
Definition: RNA_types.h:576
@ STRUCT_ID_REFCOUNT
Definition: RNA_types.h:621
@ PROP_FLOAT
Definition: RNA_types.h:75
@ PROP_BOOLEAN
Definition: RNA_types.h:73
@ PROP_ENUM
Definition: RNA_types.h:77
@ PROP_COLLECTION
Definition: RNA_types.h:79
#define RNA_TRANSLATION_PREC_DEFAULT
Definition: RNA_types.h:104
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
Definition: RNA_types.h:297
@ PROPOVERRIDE_NO_COMPARISON
Definition: RNA_types.h:305
@ PROP_ANIMATABLE
Definition: RNA_types.h:188
@ PROP_NEVER_NULL
Definition: RNA_types.h:225
@ PROP_NONE
Definition: RNA_types.h:113
@ PROP_TRANSLATION
Definition: RNA_types.h:140
#define ND_DRAW
Definition: WM_types.h:362
#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 NC_OBJECT
Definition: WM_types.h:280
Scene scene
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
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:760
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_ui_text(PropertyRNA *prop, const char *name, const char *description)
Definition: rna_define.c:1676
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_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
Definition: rna_define.c:1892
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
Definition: rna_define.c:1067
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
Definition: rna_define.c:1157
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
Definition: rna_define.c:1792
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
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
Definition: rna_define.c:3251
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
Definition: rna_define.c:1279
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
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
Definition: rna_define.c:1047
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
Definition: rna_define.c:2623
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
Definition: rna_define.c:1267
void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
Definition: rna_define.c:2906
void RNA_def_property_override_clear_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
Definition: rna_define.c:1530
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
Definition: rna_define.c:1706
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
struct Object * object
struct Collection * collection
struct Object * ob
union CollectionPropertyIterator::@1099 internal
ListBaseIterator listbase
Definition: RNA_types.h:394
char name[66]
Definition: DNA_ID.h:283
Definition: BKE_main.h:116
struct StructRNA * type
Definition: RNA_types.h:51
void * data
Definition: RNA_types.h:52
struct ID * owner_id
Definition: RNA_types.h:50
void WM_main_add_notifier(unsigned int type, void *reference)
PointerRNA * ptr
Definition: wm_files.c:3157