Commit: 43985368a1c83fa736bef70178fdf61e41c5a178
Author: Bastien Montagne
Date:   Wed Jan 30 22:46:16 2019 +0100
Branches: asset-engine
https://developer.blender.org/rB43985368a1c83fa736bef70178fdf61e41c5a178

Merge branch 'master' into asset-engine

Conflicts:
        source/blender/blenkernel/BKE_library.h
        source/blender/blenloader/BLO_readfile.h
        source/blender/editors/space_file/file_ops.c
        source/blender/editors/space_file/filelist.c
        source/blender/editors/space_file/filelist.h
        source/blender/makesdna/DNA_space_types.h
        source/blender/windowmanager/intern/wm_files_link.c

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



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

diff --cc source/blender/blenkernel/BKE_library.h
index 4874c0e53a8,9c358c7177f..06d5fe36884
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@@ -38,19 -38,35 +38,37 @@@ extern "C" 
  
  #include "BLI_compiler_attrs.h"
  
+ /**
+  * Naming: BKE_id_ vs BKE_libblock_
+  *
+  * WARNING: description below is ideal goal, current status of naming does 
not yet
+  * fully follow it (this is WIP).
+  *
+  * BKE_id_ should be used for rather high-level operations, that involve Main 
database and
+  * relations with other IDs, and can be considered as 'safe' (as in, in 
themselves, they leave
+  * affected IDs/Main in a consistent status).
+  *
+  * BKE_libblock_ should be used for lower level operations, that perform some 
parts of BKE_id_ ones,
+  * but will generally not ensure caller that affected data is in a consistent 
state
+  * by their own execution alone.
+  *
+  * Consequently, external code should not typically use BKE_libblock_ 
functions,
+  * except in some specific cases requiring advanced (and potentially 
dangerous) handling.
+  */
+ 
 +struct AssetEngineType;
 +struct AssetUUID;
  struct BlendThumbnail;
  struct GHash;
- struct ListBase;
  struct ID;
  struct ImBuf;
- struct Main;
  struct Library;
- struct wmWindowManager;
- struct bContext;
+ struct ListBase;
+ struct Main;
  struct PointerRNA;
  struct PropertyRNA;
+ struct bContext;
+ struct wmWindowManager;
  
  size_t BKE_libblock_get_alloc_info(short type, const char **name);
  void *BKE_libblock_alloc_notest(short type) ATTR_WARN_UNUSED_RESULT;
diff --cc source/blender/blenkernel/CMakeLists.txt
index c247035679d,1143394cb49..510b4a82321
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@@ -132,8 -131,9 +132,10 @@@ set(SR
        intern/keyconfig.c
        intern/lamp.c
        intern/lattice.c
+       intern/layer.c
+       intern/layer_utils.c
        intern/library.c
 +      intern/library_asset.c
        intern/library_idmap.c
        intern/library_override.c
        intern/library_query.c
diff --cc source/blender/blenkernel/intern/library.c
index 1d448e48793,1db36b459fe..d9bec018e29
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@@ -1655,10 -1677,12 +1685,13 @@@ void id_clear_lib_data_ex(Main *bmain, 
        id_fake_user_clear(id);
  
        id->lib = NULL;
 +      MEM_SAFE_FREE(id->uuid);
        id->tag &= ~(LIB_TAG_INDIRECT | LIB_TAG_EXTERN);
-       if (id_in_mainlist)
-               new_id(which_libbase(bmain, GS(id->name)), id, NULL);
+       if (id_in_mainlist) {
+               if (new_id(which_libbase(bmain, GS(id->name)), id, NULL)) {
+                       bmain->is_memfile_undo_written = false;
+               }
+       }
  
        /* Internal bNodeTree blocks inside datablocks also stores id->lib, 
make sure this stays in sync. */
        if ((ntree = ntreeFromID(id))) {
diff --cc source/blender/blenloader/BLO_readfile.h
index 8f3e8ceb3d5,05f9a5d274d..d95d7b53982
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@@ -36,10 -36,9 +36,11 @@@
  extern "C" {
  #endif
  
 +struct AssetEngineType;
 +struct AssetUUID;
+ struct BHead;
  struct BlendThumbnail;
- struct bScreen;
+ struct FileData;
  struct LinkNode;
  struct ListBase;
  struct Main;
diff --cc source/blender/blenloader/intern/versioning_280.c
index c0e26c9a8bf,e1e821d6897..2947421f651
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -2785,42 -2783,18 +2784,53 @@@ void blo_do_versions_280(FileData *fd, 
                }
        }
  
+       if (!MAIN_VERSION_ATLEAST(bmain, 280, 43)) {
+               ListBase *lb = which_libbase(bmain, ID_BR);
+               BKE_main_id_repair_duplicate_names_listbase(lb);
+       }
+ 
        {
                /* Versioning code until next subversion bump goes here. */
+ 
+               if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", 
"a")) {
+                       for (Material *mat = bmain->mat.first; mat; mat = 
mat->id.next) {
+                               mat->a = 1.0f;
+                       }
+               }
        }
 +
 +
 +
 +
 +
 +
 +      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->screen.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 --cc source/blender/editors/space_file/file_ops.c
index 3417b3d526e,2dcd13d2295..52e062debb4
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@@ -30,13 -30,8 +30,12 @@@
  
  #include "BLI_blenlib.h"
  #include "BLI_utildefines.h"
- #include "BLI_fileops_types.h"
  #include "BLI_linklist.h"
  
 +#include "RNA_access.h"
 +#include "RNA_define.h"
 +#include "RNA_types.h"
 +
  #include "BLO_readfile.h"
  
  #include "BKE_appdir.h"
diff --cc source/blender/editors/space_file/filelist.c
index da597fb33f1,2e99e7400f5..1393ee299cd
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@@ -1445,13 -1356,9 +1453,14 @@@ void filelist_free(struct FileList *fil
                return;
        }
  
-       filelist_clear_ex(filelist, false, false);  /* No need to clear cache & 
selection_state, we free them anyway. */
+       /* No need to clear cache & selection_state, we free them anyway. */
+       filelist_clear_ex(filelist, false, false);
 -      filelist_cache_free(&filelist->filelist_cache);
 +      filelist_cache_free(&filelist->filelist_cache, filelist->ae);
 +
 +      if (filelist->ae) {
 +              BKE_asset_engine_free(filelist->ae);
 +              filelist->ae = NULL;
 +      }
  
        if (filelist->selection_state) {
                BLI_ghash_free(filelist->selection_state, MEM_freeN, NULL);
@@@ -1970,11 -1734,12 +1981,12 @@@ bool filelist_file_cache_block(struct F
                else {
  //                    printf("Partial Recaching!\n");
  
-                       /* At this point, we know we keep part of currently 
cached entries, so update previews if needed,
-                        * and remove everything from working queue - we'll add 
all newly needed entries at the end. */
+                       /* At this point, we know we keep part of currently 
cached entries, so update previews
+                        * if needed, and remove everything from working queue 
- we'll add all newly needed
+                        * entries at the end. */
                        if (cache->flags & FLC_PREVIEWS_ACTIVE) {
                                filelist_cache_previews_update(filelist);
 -                              filelist_cache_previews_clear(cache);
 +                              filelist_cache_previews_clear(cache, 
filelist->ae);
                        }
  
  //                    printf("\tpreview cleaned up...\n");
@@@ -2649,7 -2289,8 +2670,8 @@@ static int filelist_readjob_list_lib(co
                return nbr_entries;
        }
  
-       /* memory for strings is passed into filelist[i].entry->relpath and 
freed in BKE_filedir_entry_free. */
+       /* memory for strings is passed into filelist[i].entry->relpath
 -       * and freed in filelist_entry_free. */
++       * and freed in BKE_filedir_entry_free. */
        if (group) {
                idcode = groupname_to_code(group);
                names = BLO_blendhandle_get_datablock_names(libfiledata, 
idcode, &nnames);
@@@ -2981,15 -2628,9 +3009,16 @@@ static void filelist_readjob_main
  typedef struct FileListReadJob {
        ThreadMutex lock;
        char main_name[FILE_MAX];
 +
 +      FileSelectParams *params;
 +
        struct FileList *filelist;
-       struct FileList *tmp_filelist;  /* XXX We may use a simpler struct 
here... just a linked list and root path? */
+       /** XXX We may use a simpler struct here... just a linked list and root 
path? */
+       struct FileList *tmp_filelist;
 +
 +      int ae_job_id;
 +      float *progress;
 +      short *stop;
  } FileListReadJob;
  
  static void filelist_readjob_startjob(void *flrjv, short *stop, short 
*do_update, float *progress)
diff --cc source/blender/editors/space_file/filelist.h
index 41363c2b340,c095925d185..31e5b46f629
--- a/source/blender/editors/space_file/filelist.h
+++ b/source/blender/editors/space_file/filelist.h
@@@ -52,9 -47,15 +52,9 @@@ struct FileDirEntryArr
  typedef enum FileSelType {
        FILE_SEL_REMOVE = 0,
        FILE_SEL_ADD    = 1,
-       FILE_SEL_TOGGLE = 2
+       FILE_SEL_TOGGLE = 2,
  } FileSelType;
  
 -typedef enum FileCheckType {
 -      CHECK_DIRS = 1,
 -      CHECK_FILES = 2,
 -      CHECK_ALL = 3,
 -} FileCheckType;
 -
  struct ListBase    *folderlist_new(void);
  void                folderlist_free(struct ListBase *folderlist);
  struct ListBase    *folderlist_duplicate(ListBase *folderlist);
diff --cc source/blender/editors/space_file/space_file.c
index 4fead327136,769e13ea5bf..d6cf3afa224
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@@ -36,14 -36,9 +36,12 @@@
  
  #include "BLI_blenlib.h"
  #include "BLI_utildefines.h"
- #include "BLI_fileops_types.h"
  
 +#include "RNA_access.h"
 +#include "RNA_types.h"
  
  #include "BKE_appdir.h"
 +#include "BKE_asset_engine.h"
  #include "BKE_context.h"
  #include "BKE_screen.h"
  #include "BKE_global.h"
diff --cc source/blender/editors/space_script/script_edit.c
index 719e0c1cafe,bfca232a58c..64a03e04809
--- a/source/blender/editors/space_script/script_edit.c
+++ b/source/blender/editors/space_script/script_edit.c
@@@ -35,8 -35,7 +35,8 @@@
  #include "BLI_utildefines.h"
  
  #include "BKE_context.h"
- #include "BKE_report.

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to