29void rna_BlendImportContextLibrary_filepath_get(
PointerRNA *
ptr,
char *value)
33 const size_t str_len = ctx_lib->
path.length();
37int rna_BlendImportContextLibrary_filepath_len(
PointerRNA *
ptr)
41 return int(ctx_lib->
path.length());
44void rna_BlendImportContextItem_name_get(
PointerRNA *
ptr,
char *value)
48 const size_t str_len = ctx_item->
name.length();
56 return int(ctx_item->
name.length());
63 return int(ctx_item->
idcode);
66struct RNABlendImportContextItemLibrariesIterator {
67 BlendfileLinkAppendContextItem *ctx_item;
68 blender::bits::BitIterator iter;
78 RNABlendImportContextItemLibrariesIterator *libs_iter =
79 MEM_new<RNABlendImportContextItemLibrariesIterator>(
80 __func__, RNABlendImportContextItemLibrariesIterator{ctx_item, libraries.
begin(), 0});
82 while (!(*libs_iter->iter) && libs_iter->iter != libs_iter->ctx_item->libraries.end()) {
83 libs_iter->iter.operator++();
84 libs_iter->iter_index++;
86 iter->
valid = (libs_iter->iter != libs_iter->ctx_item->libraries.end());
91 RNABlendImportContextItemLibrariesIterator *libs_iter =
92 static_cast<RNABlendImportContextItemLibrariesIterator *
>(iter->
internal.
custom);
94 libs_iter->iter.operator++();
95 libs_iter->iter_index++;
96 }
while (!(*libs_iter->iter) && libs_iter->iter != libs_iter->ctx_item->libraries.end());
97 iter->
valid = (libs_iter->iter != libs_iter->ctx_item->libraries.end());
102 RNABlendImportContextItemLibrariesIterator *libs_iter =
103 static_cast<RNABlendImportContextItemLibrariesIterator *
>(iter->
internal.
custom);
107 MEM_delete(libs_iter);
112 RNABlendImportContextItemLibrariesIterator *libs_iter =
113 static_cast<RNABlendImportContextItemLibrariesIterator *
>(iter->
internal.
custom);
116 libs_iter->ctx_item->lapp_context->libraries[libs_iter->iter_index];
135int rna_BlendImportContextItem_append_action_get(
PointerRNA *
ptr)
139 return int(ctx_item->
action);
142int rna_BlendImportContextItem_import_info_get(
PointerRNA *
ptr)
146 return int(ctx_item->
tag);
177struct RNABlendImportContextItemsIterator {
178 BlendfileLinkAppendContext *ctx;
186 RNABlendImportContextItemsIterator *items_iter = MEM_new<RNABlendImportContextItemsIterator>(
187 __func__, RNABlendImportContextItemsIterator{ctx, ctx->
items.begin()});
189 iter->
valid = (items_iter->iter != items_iter->ctx->items.end());
194 RNABlendImportContextItemsIterator *items_iter =
195 static_cast<RNABlendImportContextItemsIterator *
>(iter->
internal.
custom);
197 iter->
valid = (items_iter->iter != items_iter->ctx->items.end());
202 RNABlendImportContextItemsIterator *items_iter =
203 static_cast<RNABlendImportContextItemsIterator *
>(iter->
internal.
custom);
207 MEM_delete(items_iter);
212 RNABlendImportContextItemsIterator *items_iter =
213 static_cast<RNABlendImportContextItemsIterator *
>(iter->
internal.
custom);
222 return int(ctx->
items.size());
244 srna =
RNA_def_struct(brna,
"BlendImportContextLibrary",
nullptr);
247 "Blendfile Import Context Library",
248 "Library (blendfile) reference in a BlendImportContext data. Currently only "
249 "exposed as read-only data for the pre/post blendimport handlers");
256 "rna_BlendImportContextLibrary_filepath_get",
257 "rna_BlendImportContextLibrary_filepath_len",
268 srna =
RNA_def_struct(brna,
"BlendImportContextLibraries",
nullptr);
270 "Blendfile Import Context Libraries",
271 "Collection of source libraries, i.e. blendfile paths");
282 "Blendfile Import Context Item",
283 "An item (representing a data-block) in a BlendImportContext data. Currently only "
284 "exposed as read-only data for the pre/post linking handlers");
292 prop,
"rna_BlendImportContextItem_name_get",
"rna_BlendImportContextItem_name_len",
nullptr);
306 "List of libraries to search and import that ID from. The ID will be "
307 "imported from the first file in that list that contains it");
309 "rna_BlendImportContextItem_libraries_begin",
310 "rna_BlendImportContextItem_libraries_next",
311 "rna_BlendImportContextItem_libraries_end",
312 "rna_BlendImportContextItem_libraries_get",
313 "rna_BlendImportContextItem_libraries_len",
326 "An existing matching local ID has been re-used"},
332 "The linked ID had other unrelated usages, so it has been duplicated into a local copy"},
333 {0,
nullptr, 0,
nullptr,
nullptr},
340 "How this item has been handled by the append operation. Only set if "
341 "the data has been appended");
343 prop,
"rna_BlendImportContextItem_append_action_get",
nullptr,
nullptr);
350 "That item was added for an indirectly imported ID, as a dependency of another data-block"},
352 "LIBOVERRIDE_DEPENDENCY",
355 "That item represents an ID also used as liboverride dependency (either directly, as a "
356 "liboverride reference, or indirectly, as data used by a liboverride reference). It should "
357 "never be directly made local. Mutually exclusive with `LIBOVERRIDE_DEPENDENCY_ONLY`"},
359 "LIBOVERRIDE_DEPENDENCY_ONLY",
362 "That item represents an ID only used as liboverride dependency (either directly or "
363 "indirectly, see `LIBOVERRIDE_DEPENDENCY` for precisions). It should not be considered "
364 "during the 'make local' (append) process, and remain purely linked data. Mutually "
365 "exclusive with `LIBOVERRIDE_DEPENDENCY`"},
366 {0,
nullptr, 0,
nullptr,
nullptr},
373 prop,
"Import Info",
"Various status info about an item after it has been imported");
375 prop,
"rna_BlendImportContextItem_import_info_get",
nullptr,
nullptr);
382 "The imported ID. None until it has been linked or appended. "
383 "May be the same as ``reusable_local_id`` when appended");
385 prop,
"rna_BlendImportContextItem_id_get",
nullptr,
nullptr,
nullptr);
392 "Library ID representing the blendfile from which the ID was imported. "
393 "None until the ID has been linked or appended");
395 prop,
"rna_BlendImportContextItem_source_library_get",
nullptr,
nullptr,
nullptr);
402 "Library Overridden ID",
403 "The library override of the linked ID. None until it has been created");
405 prop,
"rna_BlendImportContextItem_library_override_id_get",
nullptr,
nullptr,
nullptr);
412 "The already existing local ID that may be reused in append & reuse "
413 "case. None until it has been found");
415 prop,
"rna_BlendImportContextItem_reusable_local_id_get",
nullptr,
nullptr,
nullptr);
427 srna,
"Blendfile Import Context Items",
"Collection of blendfile import context items");
440 "Blendfile Import Context",
441 "Contextual data for a blendfile library/linked-data related operation. Currently "
442 "only exposed as read-only data for the pre/post blendimport handlers");
451 "rna_BlendImportContext_import_items_begin",
452 "rna_BlendImportContext_import_items_next",
453 "rna_BlendImportContext_import_items_end",
454 "rna_BlendImportContext_import_items_get",
455 "rna_BlendImportContext_import_items_len",
462 {
FILE_LINK,
"LINK", 0,
"",
"Only link data, instead of appending it"},
464 "MAKE_PATHS_RELATIVE",
467 "Make paths of used library blendfiles relative to current blendfile"},
472 "Generate a placeholder (empty ID) if not found in any library files"},
477 "Force loaded ID to be tagged as indirectly linked (used in reload context only)"},
479 "APPEND_SET_FAKEUSER",
482 "Set fake user on appended IDs"},
487 "Append (make local) also indirect dependencies of appended IDs coming from other "
488 "libraries. NOTE: All IDs (including indirectly linked ones) coming from the same initial "
489 "library are always made local"},
491 "APPEND_LOCAL_ID_REUSE",
494 "Try to re-use previously appended matching IDs when appending them again, instead of "
495 "creating local duplicates"},
497 "APPEND_ASSET_DATA_CLEAR",
500 "Clear the asset data on append (it is always kept for linked data)"},
501 {
FILE_AUTOSELECT,
"SELECT_OBJECTS", 0,
"",
"Automatically select imported objects"},
503 "USE_ACTIVE_COLLECTION",
506 "Use the active Collection of the current View Layer to instantiate imported "
507 "collections and objects"},
512 "Instantiate object data IDs (i.e. create objects for them if needed)"},
514 "COLLECTION_INSTANCE",
517 "Instantiate collections as empties, instead of linking them into the current view layer"},
518 {0,
nullptr, 0,
nullptr,
nullptr},
533 "Blendfile import context has been initialized and filled with a list of items to import, "
534 "no data has been linked or appended yet"},
539 "All data has been imported and is available in the list of \"import_items\""},
540 {0,
nullptr, 0,
nullptr,
nullptr},
@ LINK_APPEND_ACT_MAKE_LOCAL
@ LINK_APPEND_ACT_REUSE_LOCAL
@ LINK_APPEND_ACT_KEEP_LINKED
@ LINK_APPEND_ACT_COPY_LOCAL
@ LINK_APPEND_TAG_INDIRECT
@ LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY_ONLY
@ LINK_APPEND_TAG_LIBOVERRIDE_DEPENDENCY
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
external readfile function prototypes.
@ BLO_LIBLINK_APPEND_RECURSIVE
@ BLO_LIBLINK_USE_PLACEHOLDERS
@ BLO_LIBLINK_APPEND_ASSET_DATA_CLEAR
@ BLO_LIBLINK_OBDATA_INSTANCE
@ BLO_LIBLINK_APPEND_SET_FAKEUSER
@ BLO_LIBLINK_FORCE_INDIRECT
@ BLO_LIBLINK_APPEND_LOCAL_ID_REUSE
@ BLO_LIBLINK_COLLECTION_INSTANCE
#define BLT_I18NCONTEXT_ID_ID
BitIterator begin() const
const EnumPropertyItem rna_enum_id_type_items[]
PointerRNA RNA_pointer_create_with_parent(const PointerRNA &parent, StructRNA *type, void *data)
PointerRNA RNA_id_pointer_create(ID *id)
static void rna_def_blendfile_import_context(BlenderRNA *brna)
static void rna_def_blendfile_import_library(BlenderRNA *brna)
static void RNA_def_blendfile_import_libraries(BlenderRNA *brna, PropertyRNA *cprop)
static void rna_def_blendfile_import_items(BlenderRNA *brna, PropertyRNA *cprop)
void RNA_def_blendfile_import(BlenderRNA *brna)
static void rna_def_blendfile_import_item(BlenderRNA *brna)
void RNA_def_property_string_funcs(PropertyRNA *prop, const char *get, const char *length, const char *set)
void RNA_define_verify_sdna(bool verify)
void RNA_def_property_ui_text(PropertyRNA *prop, const char *name, const char *description)
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_enum_items(PropertyRNA *prop, const EnumPropertyItem *item)
void RNA_def_property_struct_type(PropertyRNA *prop, const char *type)
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_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_translation_context(PropertyRNA *prop, const char *context)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
blender::BitVector libraries
LibraryLink_Params * params
std::list< BlendfileLinkAppendContextItem >::iterator items_iterator_t
ProcessStage process_stage
std::list< BlendfileLinkAppendContextItem > items
union CollectionPropertyIterator::@220100362304005352221007113371015217044252346141 internal