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,
103 reports,
RPT_ERROR,
"Collection '%s' is not an original ID", collection->
id.
name + 2);
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,
231 reports,
RPT_ERROR,
"Collection '%s' is not an original ID", collection->
id.
name + 2);
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)
470 if (
types.index_range().contains(type)) {
471 fh =
types[type].get();
492static void rna_CollectionExport_move(
Collection *collection,
500 "Could not move collection exporter from index '%d' to '%d'",
519 for (
const int i :
types.index_range()) {
523 item_tmp.identifier = fh->
idname;
524 item_tmp.name = fh->
label;
550 ptr->owner_id, &RNA_IDPropertyWrapPtr,
data->export_properties);
556 ptr->owner_id, &RNA_IDPropertyWrapPtr,
data->export_properties);
573static void rna_CollectionExport_filepath_get(
PointerRNA *
ptr,
char *value)
576 const char *value_src = rna_CollectionExport_filepath_value_from_idprop(
data);
577 strcpy(value, value_src ? value_src :
"");
579static int rna_CollectionExport_filepath_length(
PointerRNA *
ptr)
582 const char *value_src = rna_CollectionExport_filepath_value_from_idprop(
data);
583 return value_src ? strlen(value_src) : 0;
585static void rna_CollectionExport_filepath_set(
PointerRNA *
ptr,
const char *value)
588 if (!
data->export_properties) {
595 const char *prop_id =
"filepath";
596 const size_t value_maxsize =
FILE_MAX;
602 if (prop ==
nullptr) {
636 parm =
RNA_def_pointer(func,
"object",
"Object",
"",
"Object to remove");
656 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to add");
663 parm =
RNA_def_pointer(func,
"child",
"Collection",
"",
"Collection to remove");
685 RNA_def_string(func,
"name",
nullptr, 0,
"Name",
"Name of the new export handler");
686 parm =
RNA_def_pointer(func,
"exporter",
"CollectionExport",
"",
"Newly created export handler");
691 parm =
RNA_def_pointer(func,
"exporter",
"CollectionExport",
"",
"Export Handler to remove");
698 func,
"from_index", -1, INT_MIN, INT_MAX,
"From Index",
"Index to move", 0, 10000);
700 parm =
RNA_def_int(func,
"to_index", -1, INT_MIN, INT_MAX,
"To Index",
"Target index", 0, 10000);
713 {0,
nullptr, 0,
nullptr,
nullptr},
722 "Collection Light Linking",
723 "Light linking settings of objects and children collections of a collection");
730 prop,
"Link State",
"Light or shadow receiving state of the object or collection");
745 srna,
"Collection Object",
"Object of a collection with its collection related settings");
766 srna,
"Collection Child",
"Child collection with its collection related settings");
775 prop,
"Light Linking",
"Light linking settings of the collection object");
803 prop,
"Export Properties",
"Properties associated with the configured exporter");
805 prop,
"rna_CollectionExport_export_properties_get",
nullptr,
nullptr,
nullptr);
814 "rna_CollectionExport_filepath_get",
815 "rna_CollectionExport_filepath_length",
816 "rna_CollectionExport_filepath_set");
839 prop,
"Instance Offset",
"Offset from the origin to use when instancing");
848 "rna_Collection_objects_begin",
849 "rna_iterator_listbase_next",
850 "rna_iterator_listbase_end",
851 "rna_Collection_objects_get",
861 prop,
"All Objects",
"Objects that are in this collection and its child collections");
865 "rna_Collection_all_objects_begin",
866 "rna_iterator_listbase_next",
867 "rna_iterator_listbase_end",
868 "rna_Collection_all_objects_get",
877 prop,
nullptr,
nullptr,
"rna_Collection_children_override_apply");
879 prop,
"Children",
"Collections that are immediate children of this collection");
881 "rna_Collection_children_begin",
882 "rna_iterator_listbase_next",
883 "rna_iterator_listbase_end",
884 "rna_Collection_children_get",
897 "Collection Objects",
898 "Objects of the collection with their parent-collection-specific settings");
906 "Collection Children",
907 "Children collections with their parent-collection-specific settings");
914 prop,
"Collection Export Handlers",
"Export Handlers configured for the collection");
920 prop,
"Active Collection Exporter Index",
"Active index in the exporters list");
954 "Generate feature lines for this collection"},
959 "Only use the collection to produce occlusion"},
965 "Only generate intersection lines for this collection"},
970 "Include this collection but do not generate intersection lines"},
972 "FORCE_INTERSECTION",
974 "Force Intersection",
975 "Generate intersection lines even with objects that disabled intersection"},
976 {0,
nullptr, 0,
nullptr,
nullptr}};
986 prop,
"Use Intersection Masks",
"Use custom intersection mask for faces in this collection");
991 prop,
nullptr,
"lineart_intersection_mask", 1 << 0, 8);
993 prop,
"Masks",
"Intersection generated by this collection will have this mask value");
998 "Intersection Priority",
999 "The intersection line will be included into the object with the "
1000 "higher intersection priority value");
1008 prop,
"Use Intersection Priority",
"Assign intersection priority value for this collection");
1014 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_exporter_remove(Collection *collection, CollectionExport *data)
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)
bool BKE_collection_exporter_move(Collection *collection, const int from, const int to)
void BKE_collection_exporter_name_set(const ListBase *exporters, CollectionExport *data, const char *newname)
CollectionExport * BKE_collection_exporter_add(Collection *collection, char *idname, char *label)
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()
#define IDP_string_get(prop)
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)
#define ID_IS_EDITABLE(_id)
#define ID_IS_OVERRIDE_LIBRARY(_id)
Object groups, one object can be in many groups at once.
@ 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_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
@ PROP_PATH_SUPPORTS_BLEND_RELATIVE
#define ND_SPACE_PROPERTIES
BMesh const char void * data
FileHandlerType * file_handler_find(StringRef idname)
Span< std::unique_ptr< FileHandlerType > > file_handlers()
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)
static void rna_def_collection_exporters(BlenderRNA *brna, PropertyRNA *cprop)
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)
PropertyRNA * RNA_def_string(StructOrFunctionRNA *cont_, const char *identifier, const char *default_value, const int maxlen, const char *ui_name, const char *ui_description)
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_function_return(FunctionRNA *func, PropertyRNA *ret)
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)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
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_enum_item_end(EnumPropertyItem **items, int *totitem)
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_enum_item_add(EnumPropertyItem **items, int *totitem, const EnumPropertyItem *item)
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)
PropertyRNA * RNA_def_int(StructOrFunctionRNA *cont_, const char *identifier, const int default_value, const int hardmin, const int hardmax, const char *ui_name, const char *ui_description, const int softmin, const int softmax)
void RNA_def_property_override_flag(PropertyRNA *prop, PropertyOverrideFlag flag)
void RNA_def_parameter_flags(PropertyRNA *prop, PropertyFlag flag_property, ParameterFlag flag_parameter)
const EnumPropertyItem rna_enum_dummy_NULL_items[]
const EnumPropertyItem rna_enum_dummy_DEFAULT_items[]
struct Collection * collection
union CollectionPropertyIterator::@220100362304005352221007113371015217044252346141 internal
ListBaseIterator listbase
IDOverrideLibraryPropertyOperation * liboverride_operation
char label[OP_MAX_TYPENAME]
char idname[OP_MAX_TYPENAME]
char export_operator[OP_MAX_TYPENAME]
void WM_main_add_notifier(uint type, void *reference)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)