Blender V4.3
wm_files_link.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11#include <cctype>
12#include <cerrno>
13#include <cfloat>
14#include <cstddef>
15#include <cstdio>
16#include <cstring>
17
18#include "CLG_log.h"
19
20#include "MEM_guardedalloc.h"
21
22#include "DNA_ID.h"
24#include "DNA_key_types.h"
25#include "DNA_object_types.h"
26#include "DNA_scene_types.h"
27#include "DNA_screen_types.h"
29
30#include "BLI_bitmap.h"
31#include "BLI_blenlib.h"
32#include "BLI_linklist.h"
33#include "BLI_map.hh"
34#include "BLI_memarena.h"
35#include "BLI_utildefines.h"
36
37#include "BLO_readfile.hh"
38
39#include "BKE_armature.hh"
40#include "BKE_blendfile.hh"
42#include "BKE_context.hh"
43#include "BKE_global.hh"
44#include "BKE_key.hh"
45#include "BKE_layer.hh"
46#include "BKE_lib_id.hh"
47#include "BKE_lib_override.hh"
48#include "BKE_lib_query.hh"
49#include "BKE_lib_remap.hh"
50#include "BKE_main.hh"
51#include "BKE_material.h"
52#include "BKE_object.hh"
53#include "BKE_report.hh"
54#include "BKE_rigidbody.h"
55#include "BKE_scene.hh"
56
57#include "BKE_idtype.hh"
58
59#include "DEG_depsgraph.hh"
61
63
64#include "ED_datafiles.h"
65#include "ED_screen.hh"
66
67#include "RNA_access.hh"
68#include "RNA_define.hh"
69
70#include "WM_api.hh"
71#include "WM_types.hh"
72
73#include "wm_files.hh"
74
75static CLG_LogRef LOG = {"wm.files_link"};
76
77/* -------------------------------------------------------------------- */
82{
83 if (WM_operator_winactive(C)) {
84 /* NOTE(@sergey): Linking changes active object which is pretty useful in general,
85 * but which totally confuses edit mode (i.e. it becoming not so obvious
86 * to leave from edit mode and invalid tools in toolbar might be displayed)
87 * so disable link/append when in edit mode. */
88 if (CTX_data_edit_object(C)) {
89 return false;
90 }
91
92 return true;
93 }
94
95 return false;
96}
97
98static int wm_link_append_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
99{
100 if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
101 const char *blendfile_path = BKE_main_blendfile_path_from_global();
102 if (G.filepath_last_library[0] != '\0') {
103 RNA_string_set(op->ptr, "filepath", G.filepath_last_library);
104 }
105 else if (blendfile_path[0] != '\0') {
106 char dirpath[FILE_MAX];
107 BLI_path_split_dir_part(blendfile_path, dirpath, sizeof(dirpath));
108 RNA_string_set(op->ptr, "filepath", dirpath);
109 }
110 }
111
114}
115
117{
118 PropertyRNA *prop;
119 int flag = 0;
120
121 if (RNA_boolean_get(op->ptr, "autoselect")) {
123 }
124 if (RNA_boolean_get(op->ptr, "active_collection")) {
126 }
127 if ((prop = RNA_struct_find_property(op->ptr, "relative_path")) &&
128 RNA_property_boolean_get(op->ptr, prop))
129 {
131 }
132 if (RNA_boolean_get(op->ptr, "link")) {
133 flag |= FILE_LINK;
134 }
135 else {
136 if (RNA_boolean_get(op->ptr, "use_recursive")) {
138 }
139 if (RNA_boolean_get(op->ptr, "set_fake")) {
141 }
142 if (RNA_boolean_get(op->ptr, "do_reuse_local_id")) {
144 }
145 if (RNA_boolean_get(op->ptr, "clear_asset_data")) {
147 }
148 }
149 if (RNA_boolean_get(op->ptr, "instance_collections")) {
151 }
152 if (RNA_boolean_get(op->ptr, "instance_object_data")) {
154 }
155
156 return flag;
157}
158
165 const char *filepath,
166 const char *group,
167 const char *name,
168 const bool do_append)
169{
170 short idcode;
171
172 if (!group || !name) {
173 CLOG_WARN(&LOG, "Skipping %s", filepath);
174 return false;
175 }
176
177 idcode = BKE_idtype_idcode_from_name(group);
178
179 if (!BKE_idtype_idcode_is_linkable(idcode) ||
180 (!do_append && BKE_idtype_idcode_is_only_appendable(idcode)))
181 {
182 if (reports) {
183 if (do_append) {
184 BKE_reportf(reports,
186 "Can't append data-block '%s' of type '%s'",
187 name,
188 group);
189 }
190 else {
191 BKE_reportf(reports,
193 "Can't link data-block '%s' of type '%s'",
194 name,
195 group);
196 }
197 }
198 return false;
199 }
200
201 return true;
202}
203
205{
206 Main *bmain = CTX_data_main(C);
207 Scene *scene = CTX_data_scene(C);
208 ViewLayer *view_layer = CTX_data_view_layer(C);
209 PropertyRNA *prop;
210 BlendfileLinkAppendContext *lapp_context;
211 char filepath[FILE_MAX_LIBEXTRA], root[FILE_MAXDIR], libname[FILE_MAX_LIBEXTRA],
212 relname[FILE_MAX];
213 char *group, *name;
214 int totfiles = 0;
215
216 RNA_string_get(op->ptr, "filename", relname);
217 RNA_string_get(op->ptr, "directory", root);
218
219 BLI_path_join(filepath, sizeof(filepath), root, relname);
220
221 /* Test if we have a valid data. */
222 const bool is_librarypath_valid = BKE_blendfile_library_path_explode(
223 filepath, libname, &group, &name);
224
225 /* NOTE: Need to also check filepath, as typically libname is an empty string here (when trying
226 * to append from current file from the file-browser e.g.). */
227 if (BLI_path_cmp(BKE_main_blendfile_path(bmain), filepath) == 0 ||
228 BLI_path_cmp(BKE_main_blendfile_path(bmain), libname) == 0)
229 {
230 BKE_reportf(op->reports, RPT_ERROR, "'%s': cannot use current file as library", filepath);
231 return OPERATOR_CANCELLED;
232 }
233 if (!group) {
234 BKE_reportf(op->reports, RPT_ERROR, "'%s': nothing indicated", filepath);
235 return OPERATOR_CANCELLED;
236 }
237 if (!is_librarypath_valid) {
238 BKE_reportf(op->reports, RPT_ERROR, "'%s': not a library", filepath);
239 return OPERATOR_CANCELLED;
240 }
241
242 /* Check if something is indicated for append/link. */
243 prop = RNA_struct_find_property(op->ptr, "files");
244 if (prop) {
245 totfiles = RNA_property_collection_length(op->ptr, prop);
246 if (totfiles == 0) {
247 if (!name) {
248 BKE_reportf(op->reports, RPT_ERROR, "'%s': nothing indicated", filepath);
249 return OPERATOR_CANCELLED;
250 }
251 }
252 }
253 else if (!name) {
254 BKE_reportf(op->reports, RPT_ERROR, "'%s': nothing indicated", filepath);
255 return OPERATOR_CANCELLED;
256 }
257
258 int flag = wm_link_append_flag(op);
259 const bool do_append = (flag & FILE_LINK) == 0;
260
261 /* From here down, no error returns. */
262
263 if (view_layer && RNA_boolean_get(op->ptr, "autoselect")) {
264 BKE_view_layer_base_deselect_all(scene, view_layer);
265 }
266
267 /* Sanity checks for flag. */
268 if (scene && scene->id.lib) {
271 "Scene '%s' is linked, instantiation of objects is disabled",
272 scene->id.name + 2);
274 scene = nullptr;
275 }
276
277 /* Tag everything, all untagged data can be made local
278 * its also generally useful to know what is new.
279 *
280 * Take extra care `BKE_main_id_flag_all(bmain, ID_TAG_PRE_EXISTING, false)` is called after! */
282
283 /* We define our working data...
284 * Note that here, each item 'uses' one library, and only one. */
285 LibraryLink_Params lapp_params;
287 &lapp_params, bmain, flag, 0, scene, view_layer, CTX_wm_view3d(C));
288
289 lapp_context = BKE_blendfile_link_append_context_new(&lapp_params);
292
293 if (totfiles != 0) {
295 int lib_idx = 0;
296
297 RNA_BEGIN (op->ptr, itemptr, "files") {
298 RNA_string_get(&itemptr, "name", relname);
299
300 BLI_path_join(filepath, sizeof(filepath), root, relname);
301
302 if (BKE_blendfile_library_path_explode(filepath, libname, &group, &name)) {
303 if (!wm_link_append_item_poll(nullptr, filepath, group, name, do_append)) {
304 continue;
305 }
306
307 if (libraries.add(libname, lib_idx)) {
308 lib_idx++;
309 BKE_blendfile_link_append_context_library_add(lapp_context, libname, nullptr);
310 }
311 }
312 }
313 RNA_END;
314
315 RNA_BEGIN (op->ptr, itemptr, "files") {
316 RNA_string_get(&itemptr, "name", relname);
317
318 BLI_path_join(filepath, sizeof(filepath), root, relname);
319
320 if (BKE_blendfile_library_path_explode(filepath, libname, &group, &name)) {
322
323 if (!wm_link_append_item_poll(op->reports, filepath, group, name, do_append)) {
324 continue;
325 }
326
327 lib_idx = libraries.lookup(libname);
328
330 lapp_context, name, BKE_idtype_idcode_from_name(group), nullptr);
332 }
333 }
334 RNA_END;
335 }
336 else {
338
339 BKE_blendfile_link_append_context_library_add(lapp_context, libname, nullptr);
341 lapp_context, name, BKE_idtype_idcode_from_name(group), nullptr);
343 }
344
346 /* Early out in case there is nothing to link. */
348 /* Clear pre existing tag. */
350 return OPERATOR_CANCELLED;
351 }
352
354
355 /* XXX We'd need re-entrant locking on Main for this to work... */
356 // BKE_main_lock(bmain);
357
358 BKE_blendfile_link(lapp_context, op->reports);
359
360 // BKE_main_unlock(bmain);
361
362 /* Mark all library linked objects to be updated. */
365
366 /* Append, rather than linking. */
367 if (do_append) {
368 BKE_blendfile_append(lapp_context, op->reports);
369 }
370
371 /* Instantiate loose data in the scene (e.g. add object to the active collection). */
373
375
377
378 /* Important we unset, otherwise these object won't
379 * link into other scenes from this blend file. */
381
382 /* TODO(sergey): Use proper flag for tagging here. */
383
384 /* TODO(dalai): Temporary solution!
385 * Ideally we only need to tag the new objects themselves, not the scene.
386 * This way we'll avoid flush of collection properties
387 * to all objects and limit update to the particular object only.
388 * But afraid first we need to change collection evaluation in DEG
389 * according to depsgraph manifesto. */
390 if (scene) {
391 DEG_id_tag_update(&scene->id, 0);
392 }
393
394 /* Recreate dependency graph to include new objects. */
396
397 /* TODO: align `G.filepath_last_library` with other directory storage
398 * (like last opened image, etc). */
399 STRNCPY(G.filepath_last_library, root);
400
401 WM_event_add_notifier(C, NC_WINDOW, nullptr);
402
403 return OPERATOR_FINISHED;
404}
405
407{
408 PropertyRNA *prop;
409
410 /* Better not save _any_ settings for this operator. */
411
412 /* Properties. */
413 prop = RNA_def_boolean(
414 ot->srna, "link", is_link, "Link", "Link the objects or data-blocks rather than appending");
416
417 prop = RNA_def_boolean(
418 ot->srna,
419 "do_reuse_local_id",
420 false,
421 "Re-Use Local Data",
422 "Try to re-use previously matching appended data-blocks instead of appending a new copy");
424 prop = RNA_def_boolean(ot->srna,
425 "clear_asset_data",
426 false,
427 "Clear Asset Data",
428 "Don't add asset meta-data or tags from the original data-block");
430
431 prop = RNA_def_boolean(ot->srna, "autoselect", true, "Select", "Select new objects");
433
434 prop = RNA_def_boolean(ot->srna,
435 "active_collection",
436 true,
437 "Active Collection",
438 "Put new objects on the active collection");
440
441 prop = RNA_def_boolean(
442 ot->srna,
443 "instance_collections",
444 is_link,
445 "Instance Collections",
446 "Create instances for collections, rather than adding them directly to the scene");
448
449 prop = RNA_def_boolean(
450 ot->srna,
451 "instance_object_data",
452 true,
453 "Instance Object Data",
454 "Create instances for object data which are not referenced by any objects");
456}
457
481
483{
484 ot->name = "Append";
485 ot->idname = "WM_OT_append";
486 ot->description = "Append from a Library .blend file";
487
491
493
502
505 "set_fake",
506 false,
507 "Fake User",
508 "Set \"Fake User\" for appended items (except objects and collections)");
510 ot->srna,
511 "use_recursive",
512 true,
513 "Localize All",
514 "Localize all appended data, including those indirectly linked from other libraries");
515}
516
519/* -------------------------------------------------------------------- */
525 Scene *scene,
526 ViewLayer *view_layer,
527 View3D *v3d,
528 const char *filepath,
529 const short id_code,
530 const char *id_name,
531 const int flag)
532{
533 const bool do_append = (flag & FILE_LINK) == 0;
534 /* Tag everything so we can make local only the new datablock. */
536
537 /* Define working data, with just the one item we want to link. */
538 LibraryLink_Params lapp_params;
539 BLO_library_link_params_init_with_context(&lapp_params, bmain, flag, 0, scene, view_layer, v3d);
540
544
545 BKE_blendfile_link_append_context_library_add(lapp_context, filepath, nullptr);
547 lapp_context, id_name, id_code, nullptr);
549
551
552 /* Link datablock. */
553 BKE_blendfile_link(lapp_context, nullptr);
554
555 if (do_append) {
556 BKE_blendfile_append(lapp_context, nullptr);
557 }
558
559 BKE_blendfile_link_append_instantiate_loose(lapp_context, nullptr);
560
562
563 /* Get linked datablock and free working data. */
565
567
569
570 return id;
571}
572
574 Scene *scene,
575 ViewLayer *view_layer,
576 View3D *v3d,
577 const char *filepath,
578 const short id_code,
579 const char *id_name,
580 int flag)
581{
582 flag |= FILE_LINK;
584 bmain, scene, view_layer, v3d, filepath, id_code, id_name, flag);
585}
586
588 Scene *scene,
589 ViewLayer *view_layer,
590 View3D *v3d,
591 const char *filepath,
592 const short id_code,
593 const char *id_name,
594 int flag)
595{
596 BLI_assert((flag & FILE_LINK) == 0);
598 bmain, scene, view_layer, v3d, filepath, id_code, id_name, flag);
599
600 return id;
601}
602
605/* -------------------------------------------------------------------- */
609static int wm_lib_relocate_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
610{
611 Library *lib;
612 char lib_name[MAX_NAME];
613
614 RNA_string_get(op->ptr, "library", lib_name);
616
617 if (lib) {
618 if (lib->runtime.parent) {
621 "Cannot relocate indirectly linked library '%s'",
622 lib->runtime.filepath_abs);
623 return OPERATOR_CANCELLED;
624 }
625 RNA_string_set(op->ptr, "filepath", lib->runtime.filepath_abs);
626
628
630 }
631
632 return OPERATOR_CANCELLED;
633}
634
636{
637 if (!BKE_blendfile_extension_check(lib->runtime.filepath_abs)) {
639 reports, RPT_ERROR, "'%s' is not a valid library filepath", lib->runtime.filepath_abs);
640 return;
641 }
642
643 if (!BLI_exists(lib->runtime.filepath_abs)) {
644 BKE_reportf(reports,
645 RPT_ERROR,
646 "Trying to reload library '%s' from invalid path '%s'",
647 lib->id.name,
648 lib->runtime.filepath_abs);
649 return;
650 }
651
652 Main *bmain = CTX_data_main(C);
653 LibraryLink_Params lapp_params;
655 bmain,
658 0,
661 nullptr);
662
664
665 BKE_blendfile_link_append_context_library_add(lapp_context, lib->runtime.filepath_abs, nullptr);
666
667 BKE_blendfile_library_relocate(lapp_context, reports, lib, true);
668
670
673
674 /* Important we unset, otherwise these object won't link into other scenes from this blend file.
675 */
677
678 /* Recreate dependency graph to include new IDs. */
680
681 WM_event_add_notifier(C, NC_WINDOW, nullptr);
682}
683
684static int wm_lib_relocate_exec_do(bContext *C, wmOperator *op, bool do_reload)
685{
686 Main *bmain = CTX_data_main(C);
687 char lib_name[MAX_NAME];
688
689 RNA_string_get(op->ptr, "library", lib_name);
690 Library *lib = (Library *)BKE_libblock_find_name(bmain, ID_LI, lib_name);
691 if (lib == nullptr) {
692 return OPERATOR_CANCELLED;
693 }
694
695 PropertyRNA *prop;
696 BlendfileLinkAppendContext *lapp_context;
697
698 char filepath[FILE_MAX], root[FILE_MAXDIR], libname[FILE_MAX], relname[FILE_MAX];
699 short flag = 0;
700
701 if (RNA_boolean_get(op->ptr, "relative_path")) {
703 }
704
705 if (lib->runtime.parent && !do_reload) {
708 "Cannot relocate indirectly linked library '%s'",
709 lib->runtime.filepath_abs);
710 return OPERATOR_CANCELLED;
711 }
712
713 RNA_string_get(op->ptr, "directory", root);
714 RNA_string_get(op->ptr, "filename", libname);
715
716 if (!BKE_blendfile_extension_check(libname)) {
717 BKE_report(op->reports, RPT_ERROR, "Not a library");
718 return OPERATOR_CANCELLED;
719 }
720
721 BLI_path_join(filepath, sizeof(filepath), root, libname);
722
723 if (!BLI_exists(filepath)) {
726 "Trying to reload or relocate library '%s' to invalid path '%s'",
727 lib->id.name,
728 filepath);
729 return OPERATOR_CANCELLED;
730 }
731
732 if (BLI_path_cmp(BKE_main_blendfile_path(bmain), filepath) == 0) {
735 "Cannot relocate library '%s' to current blend file '%s'",
736 lib->id.name,
737 filepath);
738 return OPERATOR_CANCELLED;
739 }
740
741 LibraryLink_Params lapp_params;
743 &lapp_params, bmain, flag, 0, CTX_data_scene(C), CTX_data_view_layer(C), nullptr);
744
745 if (BLI_path_cmp(lib->runtime.filepath_abs, filepath) == 0) {
746 CLOG_INFO(&LOG, 4, "We are supposed to reload '%s' lib (%d)", lib->filepath, lib->id.us);
747
748 do_reload = true;
749
750 lapp_context = BKE_blendfile_link_append_context_new(&lapp_params);
751 BKE_blendfile_link_append_context_library_add(lapp_context, filepath, nullptr);
752 }
753 else {
754 int totfiles = 0;
755
756 CLOG_INFO(
757 &LOG, 4, "We are supposed to relocate '%s' lib to new '%s' one", lib->filepath, libname);
758
759 /* Check if something is indicated for relocate. */
760 prop = RNA_struct_find_property(op->ptr, "files");
761 if (prop) {
762 totfiles = RNA_property_collection_length(op->ptr, prop);
763 if (totfiles == 0) {
764 if (!libname[0]) {
765 BKE_report(op->reports, RPT_ERROR, "Nothing indicated");
766 return OPERATOR_CANCELLED;
767 }
768 }
769 }
770
771 lapp_context = BKE_blendfile_link_append_context_new(&lapp_params);
772
773 if (totfiles) {
774 RNA_BEGIN (op->ptr, itemptr, "files") {
775 RNA_string_get(&itemptr, "name", relname);
776
777 BLI_path_join(filepath, sizeof(filepath), root, relname);
778
779 if (BLI_path_cmp(filepath, lib->runtime.filepath_abs) == 0 ||
781 {
782 continue;
783 }
784
785 CLOG_INFO(&LOG, 4, "\tCandidate new lib to reload datablocks from: %s", filepath);
786 BKE_blendfile_link_append_context_library_add(lapp_context, filepath, nullptr);
787 }
788 RNA_END;
789 }
790 else {
791 CLOG_INFO(&LOG, 4, "\tCandidate new lib to reload datablocks from: %s", filepath);
792 BKE_blendfile_link_append_context_library_add(lapp_context, filepath, nullptr);
793 }
794 }
795
798 (do_reload ? BLO_LIBLINK_USE_PLACEHOLDERS : 0),
799 true);
800
801 BKE_blendfile_library_relocate(lapp_context, op->reports, lib, do_reload);
802
804
805 /* TODO: align `G.filepath_last_library` with other directory storage
806 * (like last opened image, etc). */
807 STRNCPY(G.filepath_last_library, root);
808
811
812 /* Important we unset, otherwise these object won't link into other scenes from this blend
813 * file.
814 */
816
817 /* Recreate dependency graph to include new IDs. */
819
820 WM_event_add_notifier(C, NC_WINDOW, nullptr);
821
822 return OPERATOR_FINISHED;
823}
824
826{
827 return wm_lib_relocate_exec_do(C, op, false);
828}
829
831{
832 PropertyRNA *prop;
833
834 ot->name = "Relocate Library";
835 ot->idname = "WM_OT_lib_relocate";
836 ot->description = "Relocate the given library to one or several others";
837
840
842
843 prop = RNA_def_string(ot->srna, "library", nullptr, MAX_NAME, "Library", "Library to relocate");
845
854}
855
857{
858 return wm_lib_relocate_exec_do(C, op, true);
859}
860
862{
863 PropertyRNA *prop;
864
865 ot->name = "Reload Library";
866 ot->idname = "WM_OT_lib_reload";
867 ot->description = "Reload the given library";
868
870
872
873 prop = RNA_def_string(ot->srna, "library", nullptr, MAX_NAME, "Library", "Library to reload");
875
884}
885
bool BKE_blendfile_library_path_explode(const char *path, char *r_dir, char **r_group, char **r_name)
Definition blendfile.cc:89
bool BKE_blendfile_extension_check(const char *str)
Definition blendfile.cc:83
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
bool BKE_idtype_idcode_is_linkable(short idcode)
Definition idtype.cc:201
short BKE_idtype_idcode_from_name(const char *idtype_name)
Definition idtype.cc:189
bool BKE_idtype_idcode_is_only_appendable(short idcode)
Definition idtype.cc:208
void BKE_view_layer_base_deselect_all(const Scene *scene, ViewLayer *view_layer)
ID * BKE_libblock_find_name(Main *bmain, short type, const char *name, const std::optional< Library * > lib=std::nullopt) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition lib_id.cc:1657
void BKE_main_lib_objects_recalc_all(Main *bmain)
Definition lib_id.cc:1267
void BKE_main_id_tag_all(Main *mainvar, int tag, bool value)
Definition lib_id.cc:1198
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:832
const char * BKE_main_blendfile_path_from_global()
Definition main.cc:837
General operations, lookup, etc. for materials.
General operations, lookup, etc. for blender objects.
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
void BKE_report(ReportList *reports, eReportType type, const char *message)
Definition report.cc:125
API for Blender-side Rigid Body stuff.
#define BLI_assert(a)
Definition BLI_assert.h:50
int BLI_exists(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:350
#define FILE_MAX
#define BLI_path_join(...)
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
#define FILE_MAXDIR
#define BLI_path_cmp
#define STRNCPY(dst, src)
Definition BLI_string.h:593
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
void BLO_library_link_params_init_with_context(LibraryLink_Params *params, Main *bmain, int flag, int id_tag_extra, Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Definition readfile.cc:4315
#define CLOG_WARN(clg_ref,...)
Definition CLG_log.h:181
#define CLOG_INFO(clg_ref, level,...)
Definition CLG_log.h:179
void DEG_id_tag_update(ID *id, unsigned int flags)
void DEG_relations_tag_update(Main *bmain)
ID and Library types, which are fundamental for SDNA.
@ ID_TAG_PRE_EXISTING
Definition DNA_ID.h:872
@ ID_LI
Object groups, one object can be in many groups at once.
#define MAX_NAME
Definition DNA_defs.h:50
Object is a sort of wrapper for general info.
@ FILE_SORT_DEFAULT
@ FILE_LOADLIB
@ FILE_BLENDER
@ FILE_TYPE_BLENDER
@ FILE_TYPE_FOLDER
@ FILE_TYPE_BLENDERLIB
@ FILE_DEFAULTDISPLAY
@ FILE_ACTIVE_COLLECTION
@ FILE_RELPATH
@ FILE_AUTOSELECT
@ FILE_LINK
#define FILE_MAX_LIBEXTRA
@ OPERATOR_RUNNING_MODAL
@ RPT_ERROR_INVALID_INPUT
int datatoc_startup_blend_size
const char datatoc_startup_blend[]
void IMB_colormanagement_check_file_config(Main *bmain)
Read Guarded memory(de)allocation.
#define RNA_BEGIN(sptr, itemptr, propname)
#define RNA_END
@ PROP_SKIP_SAVE
Definition RNA_types.hh:245
@ PROP_HIDDEN
Definition RNA_types.hh:239
@ WM_FILESEL_FILES
Definition WM_api.hh:937
@ WM_FILESEL_DIRECTORY
Definition WM_api.hh:934
@ WM_FILESEL_RELPATH
Definition WM_api.hh:933
@ WM_FILESEL_SHOW_PROPS
Definition WM_api.hh:939
@ WM_FILESEL_FILEPATH
Definition WM_api.hh:936
@ WM_FILESEL_FILENAME
Definition WM_api.hh:935
@ FILE_OPENFILE
Definition WM_api.hh:945
@ OPTYPE_UNDO
Definition WM_types.hh:162
#define NC_WINDOW
Definition WM_types.hh:342
bool add(const Key &key, const Value &value)
Definition BLI_map.hh:271
const Value & lookup(const Key &key) const
Definition BLI_map.hh:506
std::string id_name(void *id)
#define G(x, y, z)
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
bool RNA_property_boolean_get(PointerRNA *ptr, PropertyRNA *prop)
void RNA_string_get(PointerRNA *ptr, const char *name, char *value)
bool RNA_struct_property_is_set(PointerRNA *ptr, const char *identifier)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_property_collection_length(PointerRNA *ptr, 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)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
void RNA_def_property_flag(PropertyRNA *prop, PropertyFlag flag)
Definition DNA_ID.h:413
const char * name
Definition WM_types.hh:990
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
const char * idname
Definition WM_types.hh:992
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1022
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1006
const char * description
Definition WM_types.hh:996
StructRNA * srna
Definition WM_types.hh:1080
struct ReportList * reports
struct PointerRNA * ptr
static DynamicLibrary lib
void WM_event_add_fileselect(bContext *C, wmOperator *op)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition wm_files.cc:4125
void WM_operator_properties_filesel(wmOperatorType *ot, const int filter, const short type, const eFileSel_Action action, const eFileSel_Flag flag, const short display, const short sort)
bool WM_operator_winactive(bContext *C)
uint8_t flag
Definition wm_window.cc:138