[Bf-blender-cvs] [4fe8c62b56d] master: Cleanup: Readfile: Remove deprecated `BLO_library_link_copypaste`.

Bastien Montagne noreply at git.blender.org
Thu Dec 2 11:14:19 CET 2021


Commit: 4fe8c62b56d738163902e9f38565a1891abc5a36
Author: Bastien Montagne
Date:   Tue Nov 30 17:39:45 2021 +0100
Branches: master
https://developer.blender.org/rB4fe8c62b56d738163902e9f38565a1891abc5a36

Cleanup: Readfile: Remove deprecated `BLO_library_link_copypaste`.

Rewrite of ID paste code in rB3f08488244c0 made this function useless,
ID pasting is now handled by the BKE_blendfile_link_append module too.

===================================================================

M	source/blender/blenloader/BLO_readfile.h
M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index e3a8fd2bf3f..7d6d471adc3 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -283,8 +283,6 @@ void BLO_library_link_end(struct Main *mainl,
                           BlendHandle **bh,
                           const struct LibraryLink_Params *params);
 
-int BLO_library_link_copypaste(struct Main *mainl, BlendHandle *bh, const uint64_t id_types_mask);
-
 /**
  * Struct for temporarily loading datablocks from a blend file.
  */
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index e4fe3e8da00..1d1127329e1 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -4785,55 +4785,6 @@ static ID *link_named_part(
   return id;
 }
 
-/**
- * Simple reader for copy/paste buffers.
- */
-int BLO_library_link_copypaste(Main *mainl, BlendHandle *bh, const uint64_t id_types_mask)
-{
-  FileData *fd = (FileData *)(bh);
-  BHead *bhead;
-  int num_directly_linked = 0;
-
-  for (bhead = blo_bhead_first(fd); bhead; bhead = blo_bhead_next(fd, bhead)) {
-    ID *id = NULL;
-
-    if (bhead->code == ENDB) {
-      break;
-    }
-
-    if (blo_bhead_is_id_valid_type(bhead) && BKE_idtype_idcode_is_linkable((short)bhead->code) &&
-        (id_types_mask == 0 ||
-         (BKE_idtype_idcode_to_idfilter((short)bhead->code) & id_types_mask) != 0)) {
-      read_libblock(fd, mainl, bhead, LIB_TAG_NEED_EXPAND | LIB_TAG_EXTERN, false, &id);
-      num_directly_linked++;
-    }
-
-    if (id) {
-      /* sort by name in list */
-      ListBase *lb = which_libbase(mainl, GS(id->name));
-      id_sort_by_name(lb, id, NULL);
-
-      /* Tag as loose object (or data associated with objects)
-       * needing to be instantiated (see also #link_named_part and its usage of
-       * #BLO_LIBLINK_NEEDS_ID_TAG_DOIT above). */
-      if (library_link_idcode_needs_tag_check(GS(id->name), BLO_LIBLINK_NEEDS_ID_TAG_DOIT)) {
-        id->tag |= LIB_TAG_DOIT;
-      }
-
-      if (bhead->code == ID_OB) {
-        /* Instead of instancing Base's directly, postpone until after collections are loaded
-         * otherwise the base's flag is set incorrectly when collections are used */
-        Object *ob = (Object *)id;
-        ob->mode = OB_MODE_OBJECT;
-        /* ensure add_loose_objects_to_scene runs on this object */
-        BLI_assert(id->us == 0);
-      }
-    }
-  }
-
-  return num_directly_linked;
-}
-
 /**
  * Link a named data-block from an external blend file.
  *



More information about the Bf-blender-cvs mailing list