[Bf-blender-cvs] [52151821c01] asset-engine: Merge branch 'master' into asset-engine

Bastien Montagne noreply at git.blender.org
Mon Oct 14 21:17:33 CEST 2019


Commit: 52151821c0171482b66c9bce6d986365d4c6df1a
Author: Bastien Montagne
Date:   Mon Oct 14 21:14:03 2019 +0200
Branches: asset-engine
https://developer.blender.org/rB52151821c0171482b66c9bce6d986365d4c6df1a

Merge branch 'master' into asset-engine

Conflicts:
	source/blender/blenloader/intern/versioning_280.c
	source/blender/editors/space_file/file_ops.c

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



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

diff --cc release/scripts/startup/bl_ui/space_filebrowser.py
index 94bb68af55a,181032e4d96..2936087c0e2
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@@ -220,12 -158,10 +220,13 @@@ class FILEBROWSER_PT_filter(Panel)
  
  
  def panel_poll_is_upper_region(region):
-     # The upper region is left-aligned, the lower is split into it then. Note that after "Flip Regions" it's right-aligned.
+     # The upper region is left-aligned, the lower is split into it then.
+     # Note that after "Flip Regions" it's right-aligned.
      return region.alignment in {'LEFT', 'RIGHT'}
  
 +"""
 +>>>>> master
 +"""
  
  class FILEBROWSER_UL_dir(UIList):
      def draw_item(self, _context, layout, _data, item, icon, _active_data, active_propname, _index):
diff --cc source/blender/blenloader/intern/versioning_280.c
index 713685e811b,9e0d3b7a419..e65df622628
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -3962,4 -3929,8 +3930,37 @@@ void blo_do_versions_280(FileData *fd, 
        }
      }
    }
+ 
++  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. */
+   }
  }
diff --cc source/blender/editors/space_file/file_ops.c
index 9b058436f71,44f562393d5..40a0e84f712
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@@ -2476,7 -2395,26 +2476,28 @@@ void FILE_OT_filenum(struct wmOperatorT
    RNA_def_int(ot->srna, "increment", 1, -100, 100, "Increment", "", -100, 100);
  }
  
- static int file_rename_exec(bContext *C, wmOperator *UNUSED(op))
+ static void file_rename_state_activate(SpaceFile *sfile, int file_idx, bool require_selected)
+ {
 -  const int numfiles = filelist_files_ensure(sfile->files);
 -
 -  if ((file_idx > 0) && (file_idx < numfiles)) {
 -    FileDirEntry *file = filelist_file(sfile->files, file_idx);
 -
 -    if ((require_selected == false) ||
 -        (filelist_entry_select_get(sfile->files, file, CHECK_ALL) & FILE_SEL_SELECTED)) {
 -      filelist_entry_select_index_set(
 -          sfile->files, file_idx, FILE_SEL_ADD, FILE_SEL_EDITING, CHECK_ALL);
 -      BLI_strncpy(sfile->params->renamefile, file->relpath, FILE_MAXFILE);
 -      /* We can skip the pending state,
 -       * as we can directly set FILE_SEL_EDITING on the expected entry here. */
 -      sfile->params->rename_flag = FILE_PARAMS_RENAME_ACTIVE;
++  if (sfile->params) {
++    const int numfiles = filelist_files_ensure(sfile->files, sfile->params);
++
++    if ((file_idx > 0) && (file_idx < numfiles)) {
++      FileDirEntry *file = filelist_file(sfile->files, file_idx);
++
++      if ((require_selected == false) ||
++          (filelist_entry_select_get(sfile->files, file, CHECK_ALL) & FILE_SEL_SELECTED)) {
++        filelist_entry_select_index_set(
++            sfile->files, file_idx, FILE_SEL_ADD, FILE_SEL_EDITING, CHECK_ALL);
++        BLI_strncpy(sfile->params->renamefile, file->relpath, FILE_MAXFILE);
++        /* We can skip the pending state,
++         * as we can directly set FILE_SEL_EDITING on the expected entry here. */
++        sfile->params->rename_flag = FILE_PARAMS_RENAME_ACTIVE;
++      }
+     }
+   }
+ }
+ 
+ static int file_rename_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
  {
    ScrArea *sa = CTX_wm_area(C);
    SpaceFile *sfile = (SpaceFile *)CTX_wm_space_data(C);
@@@ -2582,9 -2491,10 +2574,10 @@@ int file_delete_exec(bContext *C, wmOpe
    SpaceFile *sfile = CTX_wm_space_file(C);
    ScrArea *sa = CTX_wm_area(C);
    FileDirEntry *file;
 -  int numfiles = filelist_files_ensure(sfile->files);
 +  int numfiles = filelist_files_ensure(sfile->files, ED_fileselect_get_params(sfile));
    int i;
  
+   const char *error_message = NULL;
    bool report_error = false;
    errno = 0;
    for (i = 0; i < numfiles; i++) {



More information about the Bf-blender-cvs mailing list