35 {0,
nullptr, 0,
nullptr,
nullptr},
39 "Collection color total is an invalid size");
43# include <fmt/format.h>
97static bool rna_collection_objects_edit_check(
Collection *collection,
114 "Could not (un)link the object '%s' because the collection '%s' is overridden",
122 "Could not (un)link the object '%s' because the collection '%s' is linked",
130static void rna_Collection_objects_link(
Collection *collection,
135 if (!rna_collection_objects_edit_check(collection,
reports,
object)) {
141 "Object '%s' already in collection '%s'",
152static void rna_Collection_objects_unlink(
Collection *collection,
157 if (!rna_collection_objects_edit_check(collection,
reports,
object)) {
163 "Object '%s' not in collection '%s'",
174static bool rna_Collection_objects_override_apply(
Main *bmain,
184 "Unsupported RNA override operation on collections' objects");
189 if (ptr_item_dst->type ==
nullptr || ptr_item_src->type ==
nullptr) {
194 Object *ob_dst =
static_cast<Object *
>(ptr_item_dst->data);
195 Object *ob_src =
static_cast<Object *
>(ptr_item_src->data);
197 if (ob_src == ob_dst) {
202 BLI_assert_msg(0,
"Could not find destination object in destination collection!");
225static bool rna_collection_children_edit_check(
Collection *collection,
242 "Could not (un)link the collection '%s' because the collection '%s' is overridden",
250 "Could not (un)link the collection '%s' because the collection '%s' is linked",
258static void rna_Collection_children_link(
Collection *collection,
263 if (!rna_collection_children_edit_check(collection,
reports, child)) {
269 "Collection '%s' already in collection '%s'",
280static void rna_Collection_children_unlink(
Collection *collection,
285 if (!rna_collection_children_edit_check(collection,
reports, child)) {
291 "Collection '%s' not in collection '%s'",
302static bool rna_Collection_children_override_apply(
Main *bmain,
312 "Unsupported RNA override operation on collections' children");
317 if (ptr_item_dst->type ==
nullptr || ptr_item_src->type ==
nullptr) {
328 if (collchild_dst ==
nullptr) {
329 BLI_assert_msg(0,
"Could not find destination sub-collection in destination collection!");
346static void rna_Collection_flag_set(
PointerRNA *
ptr,
const bool value,
const int flag)
362static void rna_Collection_hide_select_set(
PointerRNA *
ptr,
bool value)
367static void rna_Collection_hide_viewport_set(
PointerRNA *
ptr,
bool value)
372static void rna_Collection_hide_render_set(
PointerRNA *
ptr,
bool value)
395static void rna_Collection_color_tag_set(
PointerRNA *
ptr,
int value)
411static void rna_Collection_instance_offset_update(
Main * ,
419static std::optional<std::string> rna_CollectionLightLinking_path(
const PointerRNA *
ptr)
428 if (&collection_object->light_linking == collection_light_linking) {
429 return fmt::format(
"collection_objects[{}].light_linking", counter);
436 if (&collection_child->light_linking == collection_light_linking) {
437 return fmt::format(
"collection_children[{}].light_linking", counter);
456static void rna_CollectionExport_name_set(
PointerRNA *
ptr,
const char *value)
471 ptr->owner_id, &RNA_IDPropertyWrapPtr,
data->export_properties);
477 ptr->owner_id, &RNA_IDPropertyWrapPtr,
data->export_properties);
494static void rna_CollectionExport_filepath_get(
PointerRNA *
ptr,
char *value)
497 const char *value_src = rna_CollectionExport_filepath_value_from_idprop(
data);
498 strcpy(value, value_src ? value_src :
"");
500static int rna_CollectionExport_filepath_length(
PointerRNA *
ptr)
503 const char *value_src = rna_CollectionExport_filepath_value_from_idprop(
data);
504 return value_src ? strlen(value_src) : 0;
506static void rna_CollectionExport_filepath_set(
PointerRNA *
ptr,
const char *value)
509 if (!
data->export_properties) {
516 const char *prop_id =
"filepath";
517 const size_t value_maxsize =
FILE_MAX;
523 if (prop ==
nullptr) {
557 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to remove");
577 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to add");
584 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to remove");
597 {0,
nullptr, 0,
nullptr,
nullptr},
604 "Collection Light Linking",
605 "Light linking settings of objects and children collections of a collection");
612 prop,
"Link State",
"Light or shadow receiving state of the object or collection");
625 srna,
"Collection Object",
"Object of a collection with its collection related settings");
642 srna,
"Collection Child",
"Child collection with its collection related settings");
649 prop,
"Light Linking",
"Light linking settings of the collection object");
675 prop,
"Export Properties",
"Properties associated with the configured exporter");
677 prop,
"rna_CollectionExport_export_properties_get",
nullptr,
nullptr,
nullptr);
686 "rna_CollectionExport_filepath_get",
687 "rna_CollectionExport_filepath_length",
688 "rna_CollectionExport_filepath_set");
711 prop,
"Instance Offset",
"Offset from the origin to use when instancing");
720 "rna_Collection_objects_begin",
721 "rna_iterator_listbase_next",
722 "rna_iterator_listbase_end",
723 "rna_Collection_objects_get",
733 prop,
"All Objects",
"Objects that are in this collection and its child collections");
737 "rna_Collection_all_objects_begin",
738 "rna_iterator_listbase_next",
739 "rna_iterator_listbase_end",
740 "rna_Collection_all_objects_get",
749 prop,
nullptr,
nullptr,
"rna_Collection_children_override_apply");
751 prop,
"Children",
"Collections that are immediate children of this collection");
753 "rna_Collection_children_begin",
754 "rna_iterator_listbase_next",
755 "rna_iterator_listbase_end",
756 "rna_Collection_children_get",
769 "Collection Objects",
770 "Objects of the collection with their parent-collection-specific settings");
778 "Collection Children",
779 "Children collections with their parent-collection-specific settings");
786 prop,
"Collection Export Handlers",
"Export Handlers configured for the collection");
791 prop,
"Active Collection Exporter Index",
"Active index in the exporters list");
825 "Generate feature lines for this collection"},
830 "Only use the collection to produce occlusion"},
836 "Only generate intersection lines for this collection"},
841 "Include this collection but do not generate intersection lines"},
843 "FORCE_INTERSECTION",
845 "Force Intersection",
846 "Generate intersection lines even with objects that disabled intersection"},
847 {0,
nullptr, 0,
nullptr,
nullptr}};
857 prop,
"Use Intersection Masks",
"Use custom intersection mask for faces in this collection");
862 prop,
nullptr,
"lineart_intersection_mask", 1 << 0, 8);
864 prop,
"Masks",
"Intersection generated by this collection will have this mask value");
869 "Intersection Priority",
870 "The intersection line will be included into the object with the "
871 "higher intersection priority value");
879 prop,
"Use Intersection Priority",
"Assign intersection priority value for this collection");
885 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)
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, blender::StringRef name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void IDP_FreeFromGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
void IDP_AssignStringMaxSize(IDProperty *prop, const char *st, size_t st_maxncpy) ATTR_NONNULL()
IDProperty * IDP_New(char type, const IDPropertyTemplate *val, blender::StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
IDProperty * IDP_NewStringMaxSize(const char *st, size_t st_maxncpy, blender::StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT
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(const T *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
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
#define ND_SPACE_PROPERTIES
BMesh const char void * data
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
FileHandlerType * file_handler_find(StringRef idname)
void rna_iterator_listbase_begin(CollectionPropertyIterator *iter, PointerRNA *ptr, ListBase *lb, IteratorSkipFunc skip)
void RNA_property_update_main(Main *bmain, Scene *scene, PointerRNA *ptr, PropertyRNA *prop)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
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_property_boolean_sdna(PropertyRNA *prop, const char *structname, const char *propname, int64_t booleanbit)
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_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_bitset_array_sdna(PropertyRNA *prop, const char *structname, const char *propname, const int64_t booleanbit, const int length)
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)
PropertyRNA * RNA_def_pointer(StructOrFunctionRNA *cont_, const char *identifier, const char *type, const char *ui_name, const char *ui_description)
void RNA_def_property_string_maxlength(PropertyRNA *prop, int maxlength)
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::@277172262001176145116102322066145204253046376362 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)