[Bf-blender-cvs] [9dffdfc84b8] asset-engine: Fixes for changes in master after last merge

Julian Eisel noreply at git.blender.org
Thu Jun 11 15:51:29 CEST 2020


Commit: 9dffdfc84b8139b8148b18c25245c3b697995d2b
Author: Julian Eisel
Date:   Thu Jun 11 15:50:11 2020 +0200
Branches: asset-engine
https://developer.blender.org/rB9dffdfc84b8139b8148b18c25245c3b697995d2b

Fixes for changes in master after last merge

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

M	source/blender/blenkernel/intern/library.c
M	source/blender/blenkernel/intern/library_asset.c
M	source/blender/blenloader/intern/readfile.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/blenloader/intern/writefile.c
M	source/blender/editors/space_file/file_draw.c
M	source/blender/editors/space_file/file_ops.c
M	source/blender/editors/space_file/filelist.c
M	source/blender/editors/space_file/space_file.c
M	source/blender/editors/space_view3d/space_view3d.c
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/windowmanager/intern/wm_files_link.c

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

diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 801bafb1680..adb672b579e 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -48,10 +48,6 @@
 
 static void library_free_data(ID *id)
 {
-  if (lib->flag & LIBRARY_FLAG_VIRTUAL) {
-    return;
-  }
-
   Library *library = (Library *)id;
   if (library->packedfile) {
     BKE_packedfile_free(library->packedfile);
diff --git a/source/blender/blenkernel/intern/library_asset.c b/source/blender/blenkernel/intern/library_asset.c
index e570f7194ea..515e0f4a693 100644
--- a/source/blender/blenkernel/intern/library_asset.c
+++ b/source/blender/blenkernel/intern/library_asset.c
@@ -41,8 +41,9 @@
 #include "RNA_types.h"
 
 #include "BKE_asset_engine.h"
+#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
 #include "BKE_library.h"
-#include "BKE_library_query.h"
 #include "BKE_main.h"
 
 /* Asset managing - TODO: we most likely want to turn this into a hashing at some point, could
@@ -172,23 +173,20 @@ void BKE_libraries_asset_repositories_clear(Main *bmain)
   BKE_main_id_tag_all(bmain, LIB_TAG_ASSET, false);
 }
 
-static int library_asset_dependencies_rebuild_cb(void *userdata,
-                                                 ID *id_self,
-                                                 ID **idp,
-                                                 int UNUSED(cd_flag))
+static int library_asset_dependencies_rebuild_cb(LibraryIDLinkCallbackData *data)
 {
-  if (!idp || !*idp) {
+  if (!data->id_pointer || !*data->id_pointer) {
     return IDWALK_RET_NOP;
   }
 
-  AssetRef *aref = userdata;
-  ID *id = *idp;
+  AssetRef *aref = data->user_data;
+  ID *id = *data->id_pointer;
 
   if (id->uuid) {
     return IDWALK_RET_STOP_RECURSION;
   }
 
-  printf("%s (from %s)\n", id->name, id_self->name);
+  printf("%s (from %s)\n", id->name, data->id_self->name);
 
   BKE_library_asset_repository_subdata_add(aref, (const void *)id);
   id->tag |= LIB_TAG_ASSET;
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 1d8e10318fc..10a42389a60 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -133,6 +133,7 @@
 #include "BKE_lib_id.h"
 #include "BKE_lib_override.h"
 #include "BKE_lib_query.h"
+#include "BKE_library.h"
 #include "BKE_main.h"  // for Main
 #include "BKE_main_idmap.h"
 #include "BKE_material.h"
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index e78f633988d..79d14f28f9c 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -4356,43 +4356,9 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
     }
   }
 
-<<<<<<< HEAD
-  if (1 || !DNA_struct_find(fd->filesdna, "AssetUUID")) {
-    /* struct_find will have to wait, not working for now... */
-    /* Move non-op filebrowsers to 'library browsing' type/mode. */
-    for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
-      for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
-        for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
-          if (sl->spacetype == SPACE_FILE) {
-            SpaceFile *sfile = (SpaceFile *)sl;
-            if (sfile->params != NULL) {
-              sfile->params->type = FILE_LOADLIB;
-              sfile->params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB;
-              /* For now, always init filterid to 'all true' */
-              sfile->params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR |
-                                         FILTER_ID_CA | FILTER_ID_CU | FILTER_ID_GD |
-                                         FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA |
-                                         FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA |
-                                         FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME |
-                                         FILTER_ID_MSK | FILTER_ID_NT | FILTER_ID_OB |
-                                         FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC |
-                                         FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO |
-                                         FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF |
-                                         FILTER_ID_WO | FILTER_ID_CF;
-            }
-          }
-        }
-      }
-    }
-  }
-
-  {
-    /* Versioning code until next subversion bump goes here. */
-=======
   if (!MAIN_VERSION_ATLEAST(bmain, 282, 2)) {
     do_version_curvemapping_walker(bmain, do_version_curvemapping_flag_extend_extrapolate);
 
->>>>>>> asset-uuid
     for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
       LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) {
         area->flag &= ~AREA_FLAG_UNUSED_6;
@@ -5112,4 +5078,33 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
   {
     /* Keep this block, even when empty. */
   }
+
+  if (1 || !DNA_struct_find(fd->filesdna, "AssetUUID")) {
+    /* struct_find will have to wait, not working for now... */
+    /* Move non-op filebrowsers to 'library browsing' type/mode. */
+    for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+      for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+        for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) {
+          if (sl->spacetype == SPACE_FILE) {
+            SpaceFile *sfile = (SpaceFile *)sl;
+            if (sfile->params != NULL) {
+              sfile->params->type = FILE_LOADLIB;
+              sfile->params->filter = FILE_TYPE_FOLDER | FILE_TYPE_BLENDERLIB;
+              /* For now, always init filterid to 'all true' */
+              sfile->params->filter_id = FILTER_ID_AC | FILTER_ID_AR | FILTER_ID_BR |
+                                         FILTER_ID_CA | FILTER_ID_CU | FILTER_ID_GD |
+                                         FILTER_ID_GR | FILTER_ID_IM | FILTER_ID_LA |
+                                         FILTER_ID_LS | FILTER_ID_LT | FILTER_ID_MA |
+                                         FILTER_ID_MB | FILTER_ID_MC | FILTER_ID_ME |
+                                         FILTER_ID_MSK | FILTER_ID_NT | FILTER_ID_OB |
+                                         FILTER_ID_PA | FILTER_ID_PAL | FILTER_ID_PC |
+                                         FILTER_ID_SCE | FILTER_ID_SPK | FILTER_ID_SO |
+                                         FILTER_ID_TE | FILTER_ID_TXT | FILTER_ID_VF |
+                                         FILTER_ID_WO | FILTER_ID_CF;
+            }
+          }
+        }
+      }
+    }
+  }
 }
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 8476d4b1563..2a091582965 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -4037,7 +4037,7 @@ static void write_libraries(WriteData *wd, Main *main)
             if (id->us > 0 &&
                 ((id->tag & LIB_TAG_EXTERN) ||
                  ((id->tag & LIB_TAG_INDIRECT) && (id->flag & LIB_INDIRECT_WEAK_LINK)))) {
-              if (!BKE_idcode_is_linkable(GS(id->name))) {
+              if (!BKE_idtype_idcode_is_linkable(GS(id->name))) {
                 printf(
                     "ERROR: write file: data-block '%s' from lib '%s' is not linkable "
                     "but is flagged as directly linked",
@@ -4047,9 +4047,10 @@ static void write_libraries(WriteData *wd, Main *main)
               }
               writestruct(wd, ID_LINK_PLACEHOLDER, ID, 1, id);
               /* It is mandatory to write id's asset uuid reference for placeholders too, otherwise
-               * the whole asset info would be completely lost when reloading the linked data-block,
-               * especially in case it is not immediately found and needs to go through the whole
-               * 'asset engine update' process after main .blend read process is finished. */
+               * the whole asset info would be completely lost when reloading the linked
+               * data-block, especially in case it is not immediately found and needs to go through
+               * the whole 'asset engine update' process after main .blend read process is
+               * finished. */
               write_iddata(&writer, id);
             }
           }
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 094fea5f962..44aad773992 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -142,7 +142,6 @@ static void file_draw_icon(uiBlock *block,
                            int icon,
                            int width,
                            int height,
-                           bool drag,
                            bool dimmed,
                            uiDragLibraryHandle *drag_data)
 {
@@ -213,7 +212,6 @@ void file_calc_previews(const bContext *C, ARegion *region)
 }
 
 static void file_draw_preview(uiBlock *block,
-                              const char *path,
                               int sx,
                               int sy,
                               const float icon_aspect,
@@ -222,9 +220,9 @@ static void file_draw_preview(uiBlock *block,
                               FileLayout *layout,
                               const bool is_icon,
                               const int typeflags,
-                              const bool drag,
                               const bool dimmed,
-                              const bool is_link)
+                              const bool is_link,
+                              const uiDragLibraryHandle *drag_data)
 {
   uiBut *but;
   float fx, fy;
@@ -847,7 +845,6 @@ void file_draw_list(const bContext *C, ARegion *region)
       }
 
       file_draw_preview(block,
-                        path,
                         sx,
                         sy,
                         thumb_icon_aspect,
@@ -856,7 +853,6 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list