83 static bool rna_collection_objects_edit_check(
Collection *collection,
89 reports,
RPT_ERROR,
"Collection '%s' is not an original ID", collection->
id.
name + 2);
100 "Could not (un)link the object '%s' because the collection '%s' is overridden",
108 "Could not (un)link the object '%s' because the collection '%s' is linked",
116 static void rna_Collection_objects_link(
Collection *collection,
121 if (!rna_collection_objects_edit_check(collection, reports,
object)) {
127 "Object '%s' already in collection '%s'",
138 static void rna_Collection_objects_unlink(
Collection *collection,
143 if (!rna_collection_objects_edit_check(collection, reports,
object)) {
149 "Object '%s' not in collection '%s'",
160 static bool rna_Collection_objects_override_apply(
Main *bmain,
167 const int UNUSED(len_dst),
168 const int UNUSED(len_src),
169 const int UNUSED(len_storage),
176 "Unsupported RNA override operation on collections' objects");
189 if (ob_src == ob_dst) {
196 if (cob_dst ==
NULL) {
197 BLI_assert_msg(0,
"Could not find destination object in destination collection!");
204 cob_dst->
ob = ob_src;
230 static bool rna_collection_children_edit_check(
Collection *collection,
236 reports,
RPT_ERROR,
"Collection '%s' is not an original ID", collection->
id.
name + 2);
247 "Could not (un)link the collection '%s' because the collection '%s' is overridden",
255 "Could not (un)link the collection '%s' because the collection '%s' is linked",
263 static void rna_Collection_children_link(
Collection *collection,
268 if (!rna_collection_children_edit_check(collection, reports, child)) {
274 "Collection '%s' already in collection '%s'",
285 static void rna_Collection_children_unlink(
Collection *collection,
290 if (!rna_collection_children_edit_check(collection, reports, child)) {
296 "Collection '%s' not in collection '%s'",
307 static bool rna_Collection_children_override_apply(
Main *bmain,
314 const int UNUSED(len_dst),
315 const int UNUSED(len_src),
316 const int UNUSED(len_storage),
323 "Unsupported RNA override operation on collections' children");
339 if (collchild_dst ==
NULL) {
340 BLI_assert_msg(0,
"Could not find destination sub-collection in destination collection!");
357 static void rna_Collection_flag_set(
PointerRNA *
ptr,
const bool value,
const int flag)
366 collection->
flag |= flag;
369 collection->
flag &= ~flag;
373 static void rna_Collection_hide_select_set(
PointerRNA *
ptr,
bool value)
378 static void rna_Collection_hide_viewport_set(
PointerRNA *
ptr,
bool value)
383 static void rna_Collection_hide_render_set(
PointerRNA *
ptr,
bool value)
399 static int rna_Collection_color_tag_get(
struct PointerRNA *
ptr)
406 static void rna_Collection_color_tag_set(
struct PointerRNA *
ptr,
int value)
417 static void rna_Collection_color_tag_update(
Main *
UNUSED(bmain),
424 static void rna_Collection_instance_offset_update(
Main *
UNUSED(bmain),
457 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to remove");
477 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to add");
484 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to remove");
504 prop,
"Instance Offset",
"Offset from the origin to use when instancing");
513 "rna_Collection_objects_begin",
514 "rna_iterator_listbase_next",
515 "rna_iterator_listbase_end",
516 "rna_Collection_objects_get",
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",
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",
585 "Generate feature lines for this collection"},
590 "Only use the collection to produce occlusion"},
596 "Only generate intersection lines for this collection"},
601 "Include this collection but do not generate intersection lines"},
603 "FORCE_INTERSECTION",
605 "Force Intersection",
606 "Generate intersection lines even with objects that disabled intersection"},
617 prop,
"Use Intersection Masks",
"Use custom intersection mask for faces in this collection");
624 prop,
"Masks",
"Intersection generated by this collection will have this mask value");
630 "Intersection Priority",
631 "The intersection line will be included into the object with the "
632 "higher intersection priority value");
640 prop,
"Use Intersection Priority",
"Assign intersection priority value for this collection");
646 prop,
"rna_Collection_color_tag_get",
"rna_Collection_color_tag_set",
NULL);
struct ListBase BKE_collection_object_cache_get(struct Collection *collection)
bool BKE_collection_child_add(struct Main *bmain, struct Collection *parent, struct Collection *child)
void BKE_collection_object_cache_free(struct Collection *collection)
bool BKE_collection_object_add(struct Main *bmain, struct Collection *collection, struct Object *ob)
bool BKE_collection_child_remove(struct Main *bmain, struct Collection *parent, struct Collection *child)
bool BKE_collection_object_remove(struct Main *bmain, struct Collection *collection, struct Object *object, bool free_us)
bool BKE_collection_is_in_scene(struct Collection *collection)
void BKE_main_collection_sync(const struct Main *bmain)
void id_us_min(struct ID *id)
void id_us_plus(struct ID *id)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_assert_msg(a, msg)
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
#define UNUSED_VARS_NDEBUG(...)
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
#define ID_IS_LINKED(_id)
@ IDOVERRIDE_LIBRARY_OP_REPLACE
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
@ COLLECTION_LRT_INTERSECTION_ONLY
@ COLLECTION_LRT_FORCE_INTERSECTION
@ COLLECTION_LRT_OCCLUSION_ONLY
@ COLLECTION_LRT_NO_INTERSECTION
@ COLLECTION_HIDE_VIEWPORT
@ COLLECTION_LRT_USE_INTERSECTION_PRIORITY
Object is a sort of wrapper for general info.
#define RNA_TRANSLATION_PREC_DEFAULT
@ PROPOVERRIDE_OVERRIDABLE_LIBRARY
@ PROPOVERRIDE_NO_COMPARISON
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, ListBase *lb, IteratorSkipFunc skip)
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
PointerRNA rna_pointer_inherit_refine(PointerRNA *ptr, StructRNA *type, void *data)
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)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
void RNA_def_property_ui_icon(PropertyRNA *prop, int icon, int consecutive)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_property_srna(PropertyRNA *prop, const char *type)
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)
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
void RNA_def_property_boolean_default(PropertyRNA *prop, bool value)
void RNA_def_property_boolean_funcs(PropertyRNA *prop, const char *get, const char *set)
void RNA_def_property_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_struct_sdna(StructRNA *srna, const char *structname)
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
void RNA_def_property_array(PropertyRNA *prop, int length)
void RNA_def_property_range(PropertyRNA *prop, double min, double max)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_property_enum_sdna(PropertyRNA *prop, const char *structname, const char *propname)
void RNA_def_struct_ui_icon(StructRNA *srna, int icon)
void RNA_def_property_override_funcs(PropertyRNA *prop, const char *diff, const char *store, const char *apply)
void RNA_def_property_override_clear_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_property_ui_range(PropertyRNA *prop, double min, double max, double step, int precision)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
struct Collection * collection
ListBaseIterator listbase
union CollectionPropertyIterator::@1147 internal
void WM_main_add_notifier(unsigned int type, void *reference)