36 {0,
nullptr, 0,
nullptr,
nullptr},
40 "Collection color total is an invalid size");
44# include <fmt/format.h>
94static bool rna_collection_objects_edit_check(
Collection *collection,
100 reports,
RPT_ERROR,
"Collection '%s' is not an original ID", collection->id.name + 2);
111 "Could not (un)link the object '%s' because the collection '%s' is overridden",
113 collection->id.name + 2);
119 "Could not (un)link the object '%s' because the collection '%s' is linked",
121 collection->id.name + 2);
127static void rna_Collection_objects_link(
Collection *collection,
132 if (!rna_collection_objects_edit_check(collection, reports,
object)) {
138 "Object '%s' already in collection '%s'",
140 collection->id.name + 2);
149static void rna_Collection_objects_unlink(
Collection *collection,
154 if (!rna_collection_objects_edit_check(collection, reports,
object)) {
160 "Object '%s' not in collection '%s'",
162 collection->id.name + 2);
171static bool rna_Collection_objects_override_apply(
Main *bmain,
181 "Unsupported RNA override operation on collections' objects");
186 if (ptr_item_dst->type ==
nullptr || ptr_item_src->type ==
nullptr) {
191 Object *ob_dst =
static_cast<Object *
>(ptr_item_dst->data);
192 Object *ob_src =
static_cast<Object *
>(ptr_item_src->data);
194 if (ob_src == ob_dst) {
199 BLI_assert_msg(0,
"Could not find destination object in destination collection!");
222static bool rna_collection_children_edit_check(
Collection *collection,
228 reports,
RPT_ERROR,
"Collection '%s' is not an original ID", collection->id.name + 2);
239 "Could not (un)link the collection '%s' because the collection '%s' is overridden",
241 collection->id.name + 2);
247 "Could not (un)link the collection '%s' because the collection '%s' is linked",
249 collection->id.name + 2);
255static void rna_Collection_children_link(
Collection *collection,
260 if (!rna_collection_children_edit_check(collection, reports, child)) {
266 "Collection '%s' already in collection '%s'",
268 collection->id.name + 2);
277static void rna_Collection_children_unlink(
Collection *collection,
282 if (!rna_collection_children_edit_check(collection, reports, child)) {
288 "Collection '%s' not in collection '%s'",
290 collection->id.name + 2);
299static bool rna_Collection_children_override_apply(
Main *bmain,
309 "Unsupported RNA override operation on collections' children");
314 if (ptr_item_dst->type ==
nullptr || ptr_item_src->type ==
nullptr) {
325 if (collchild_dst ==
nullptr) {
326 BLI_assert_msg(0,
"Could not find destination sub-collection in destination collection!");
343static void rna_Collection_flag_set(
PointerRNA *
ptr,
const bool value,
const int flag)
352 collection->flag |=
flag;
355 collection->flag &= ~flag;
359static void rna_Collection_hide_select_set(
PointerRNA *
ptr,
bool value)
364static void rna_Collection_hide_viewport_set(
PointerRNA *
ptr,
bool value)
369static void rna_Collection_hide_render_set(
PointerRNA *
ptr,
bool value)
389 return collection->color_tag;
392static void rna_Collection_color_tag_set(
PointerRNA *
ptr,
int value)
400 collection->color_tag = value;
408static void rna_Collection_instance_offset_update(
Main * ,
416static std::optional<std::string> rna_CollectionLightLinking_path(
const PointerRNA *
ptr)
425 if (&collection_object->light_linking == collection_light_linking) {
426 return fmt::format(
"collection_objects[{}].light_linking", counter);
433 if (&collection_child->light_linking == collection_light_linking) {
434 return fmt::format(
"collection_children[{}].light_linking", counter);
453static void rna_CollectionExport_name_set(
PointerRNA *
ptr,
const char *value)
503 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to remove");
523 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to add");
530 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to remove");
543 {0,
nullptr, 0,
nullptr,
nullptr},
550 "Collection Light Linking",
551 "Light linking settings of objects and children collections of a collection");
558 prop,
"Link State",
"Light or shadow receiving state of the object or collection");
571 srna,
"Collection Object",
"Object of a collection with its collection related settings");
588 srna,
"Collection Child",
"Child collection with its collection related settings");
595 prop,
"Light Linking",
"Light linking settings of the collection object");
621 prop,
"Export Properties",
"Properties associated with the configured exporter");
623 prop,
"rna_CollectionExport_export_properties_get",
nullptr,
nullptr,
nullptr);
642 prop,
"Instance Offset",
"Offset from the origin to use when instancing");
651 "rna_Collection_objects_begin",
652 "rna_iterator_listbase_next",
653 "rna_iterator_listbase_end",
654 "rna_Collection_objects_get",
664 prop,
"All Objects",
"Objects that are in this collection and its child collections");
668 "rna_Collection_all_objects_begin",
669 "rna_iterator_listbase_next",
670 "rna_iterator_listbase_end",
671 "rna_Collection_all_objects_get",
680 prop,
nullptr,
nullptr,
"rna_Collection_children_override_apply");
682 prop,
"Children",
"Collections that are immediate children of this collection");
684 "rna_Collection_children_begin",
685 "rna_iterator_listbase_next",
686 "rna_iterator_listbase_end",
687 "rna_Collection_children_get",
700 "Collection Objects",
701 "Objects of the collection with their parent-collection-specific settings");
709 "Collection Children",
710 "Children collections with their parent-collection-specific settings");
717 prop,
"Collection Export Handlers",
"Export Handlers configured for the collection");
722 prop,
"Active Collection Exporter Index",
"Active index in the exporters list");
756 "Generate feature lines for this collection"},
761 "Only use the collection to produce occlusion"},
767 "Only generate intersection lines for this collection"},
772 "Include this collection but do not generate intersection lines"},
774 "FORCE_INTERSECTION",
776 "Force Intersection",
777 "Generate intersection lines even with objects that disabled intersection"},
778 {0,
nullptr, 0,
nullptr,
nullptr}};
788 prop,
"Use Intersection Masks",
"Use custom intersection mask for faces in this collection");
795 prop,
"Masks",
"Intersection generated by this collection will have this mask value");
800 "Intersection Priority",
801 "The intersection line will be included into the object with the "
802 "higher intersection priority value");
810 prop,
"Use Intersection Priority",
"Assign intersection priority value for this collection");
816 prop,
"rna_Collection_color_tag_get",
"rna_Collection_color_tag_set",
nullptr);
bool BKE_collection_object_remove(Main *bmain, Collection *collection, Object *ob, bool free_us)
void BKE_collection_object_cache_free(const Main *bmain, Collection *collection, const int id_create_flag)
bool BKE_collection_child_remove(Main *bmain, Collection *parent, Collection *child)
bool BKE_collection_object_replace(Main *bmain, Collection *collection, Object *ob_old, Object *ob_new)
bool BKE_collection_child_add(Main *bmain, Collection *parent, Collection *child)
void BKE_collection_exporter_name_set(const ListBase *exporters, CollectionExport *data, const char *newname)
ListBase BKE_collection_object_cache_get(Collection *collection)
bool BKE_collection_object_add(Main *bmain, Collection *collection, Object *ob)
void BKE_main_collection_sync(const Main *bmain)
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
#define BLI_STATIC_ASSERT(a, msg)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
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(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
bool DEG_is_original_id(const ID *id)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
@ COLLECTION_HIDE_VIEWPORT
@ COLLECTION_LIGHT_LINKING_STATE_EXCLUDE
@ COLLECTION_LIGHT_LINKING_STATE_INCLUDE
@ COLLECTION_LRT_INTERSECTION_ONLY
@ COLLECTION_LRT_FORCE_INTERSECTION
@ COLLECTION_LRT_OCCLUSION_ONLY
@ COLLECTION_LRT_NO_INTERSECTION
@ 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
#define ND_SPACE_PROPERTIES
FileHandlerType * file_handler_find(StringRef idname)
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(const PointerRNA *ptr, StructRNA *type, void *data)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
static void rna_def_collection_child(BlenderRNA *brna)
static void rna_def_collection_objects(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_collection_object(BlenderRNA *brna)
static void rna_def_collection_exporter_data(BlenderRNA *brna)
static void rna_def_collection_children(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_collections(BlenderRNA *brna)
static void rna_def_collection_light_linking(BlenderRNA *brna)
const EnumPropertyItem rna_enum_collection_color_items[]
void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop)
void RNA_define_lib_overridable(const bool make_overridable)
void RNA_def_struct_path_func(StructRNA *srna, const char *path)
void RNA_def_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t bit)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
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)
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)
FunctionRNA * RNA_def_function(StructRNA *srna, const char *identifier, const char *call)
void RNA_def_struct_clear_flag(StructRNA *srna, int flag)
void RNA_def_property_array(PropertyRNA *prop, int length)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
void RNA_def_property_collection_sdna(PropertyRNA *prop, const char *structname, const char *propname, const char *lengthpropname)
void RNA_def_function_ui_description(FunctionRNA *func, const char *description)
void RNA_def_property_update(PropertyRNA *prop, int noteflag, const char *func)
PropertyRNA * RNA_def_property(StructOrFunctionRNA *cont_, const char *identifier, int type, int subtype)
void RNA_def_property_enum_funcs(PropertyRNA *prop, const char *get, const char *set, const char *item)
StructRNA * RNA_def_struct(BlenderRNA *brna, const char *identifier, const char *from)
void RNA_def_function_flag(FunctionRNA *func, int flag)
void RNA_def_property_clear_flag(PropertyRNA *prop, PropertyFlag flag)
void RNA_def_property_pointer_funcs(PropertyRNA *prop, const char *get, const char *set, const char *type_fn, const char *poll)
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_flag(PropertyRNA *prop, PropertyFlag flag)
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::@1329 internal
IDOverrideLibraryPropertyOperation * liboverride_operation
char export_operator[OP_MAX_TYPENAME]
void WM_main_add_notifier(uint type, void *reference)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)