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

Bastien Montagne noreply at git.blender.org
Thu Sep 12 15:45:39 CEST 2019


Commit: a644b3aba78d223bb671ae4369354662a72f76da
Author: Bastien Montagne
Date:   Thu Sep 12 15:45:01 2019 +0200
Branches: asset-engine
https://developer.blender.org/rBa644b3aba78d223bb671ae4369354662a72f76da

Merge branch 'master' into asset-engine

Note: reworking filebrowser UI is still TODO.

Conflicts:
	release/scripts/startup/bl_ui/space_filebrowser.py
	source/blender/blenloader/intern/versioning_280.c
	source/blender/editors/include/ED_fileselect.h
	source/blender/editors/space_file/file_draw.c
	source/blender/editors/space_view3d/space_view3d.c

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



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

diff --cc release/scripts/startup/bl_ui/space_filebrowser.py
index a3178bc6116,948a797e7fe..2eea2252aab
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@@ -43,62 -36,7 +43,62 @@@ class FILEBROWSER_HT_header(Header)
          layout.menu("FILEBROWSER_MT_select")
  
          # can be None when save/reload with a file selector open
 -
 +        """
-         <<<<<<< HEAD
++        <<<<< HEAD
 +                layout.separator()
 +                if st.asset_engine and is_lib_browser:
 +                    draw_header = getattr(st.asset_engine, "draw_header", None)
 +                    if draw_header:
 +                        draw_header(layout, context)
 +                else:
 +                    layout.operator_context = 'EXEC_DEFAULT'
 +                    layout.operator("file.directory_new", icon='NEWFOLDER', text="")
 +                    layout.separator()
 +
 +                    layout.operator_context = 'INVOKE_DEFAULT'
 +
 +                    # can be None when save/reload with a file selector open
 +                    if params:
 +                        layout.prop(params, "display_type", expand=True, text="")
 +                        layout.prop(params, "sort_method", expand=True, text="")
 +                        layout.prop(params, "show_hidden", text="", icon='FILE_HIDDEN')
 +
 +                    layout.separator_spacer()
 +
 +                    layout.template_running_jobs()
 +
 +                    if params:
 +                        layout.prop(params, "use_filter", text="", icon='FILTER')
 +
 +                        row = layout.row(align=True)
 +                        row.active = params.use_filter
 +
 +                        row.prop(params, "use_filter_folder", text="")
 +
 +                        if params.filter_glob:
 +                            # if st.active_operator and hasattr(st.active_operator, "filter_glob"):
 +                            #     row.prop(params, "filter_glob", text="")
 +                            row.label(params.filter_glob)
 +                        else:
 +                            row.prop(params, "use_filter_blender", text="")
 +                            row.prop(params, "use_filter_backup", text="")
 +                            row.prop(params, "use_filter_image", text="")
 +                            row.prop(params, "use_filter_movie", text="")
 +                            row.prop(params, "use_filter_script", text="")
 +                            row.prop(params, "use_filter_font", text="")
 +                            row.prop(params, "use_filter_sound", text="")
 +                            row.prop(params, "use_filter_text", text="")
 +
 +                        if is_lib_browser:
 +                            row.prop(params, "use_filter_blendid", text="")
 +                            if params.use_filter_blendid:
 +                                row.separator()
 +                                row.prop(params, "filter_id_category", text="")
 +
 +                        row.separator()
 +                        row.prop(params, "filter_search", text="", icon='VIEWZOOM')
-         =======
++        =====
 +        """
          layout.separator_spacer()
  
          layout.template_running_jobs()
@@@ -220,11 -158,9 +220,12 @@@ 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.
-     return region.alignment == 'LEFT'
+     # 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
++>>>>> master
 +"""
  
  class FILEBROWSER_UL_dir(UIList):
      def draw_item(self, _context, layout, _data, item, icon, _active_data, active_propname, _index):
diff --cc source/blender/blenkernel/intern/blender.c
index f69a226693d,ac432bf0b64..ed98a695e7d
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@@ -32,10 -32,7 +32,9 @@@
  #include "BLI_string.h"
  #include "BLI_listbase.h"
  #include "BLI_utildefines.h"
- #include "BLI_callbacks.h"
  
 +#include "RNA_access.h"
 +
  #include "IMB_imbuf.h"
  #include "IMB_moviecache.h"
  
diff --cc source/blender/blenloader/intern/versioning_280.c
index d48f69c100e,2615c17ace5..31730c74d26
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -3827,5 -3807,42 +3808,71 @@@ void blo_do_versions_280(FileData *fd, 
          do_version_bones_inherit_scale(&arm->bonebase);
        }
      }
+ 
+     /* Convert the Offset flag to the mix mode enum. */
+     if (!DNA_struct_elem_find(fd->filesdna, "bRotateLikeConstraint", "char", "mix_mode")) {
+       LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+         do_version_constraints_copy_rotation_mix_mode(&ob->constraints);
+         if (ob->pose) {
+           LISTBASE_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
+             do_version_constraints_copy_rotation_mix_mode(&pchan->constraints);
+           }
+         }
+       }
+     }
+ 
+     /* Added studiolight intensity */
+     if (!DNA_struct_elem_find(fd->filesdna, "View3DShading", "float", "studiolight_intensity")) {
+       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_VIEW3D) {
+               View3D *v3d = (View3D *)sl;
+               v3d->shading.studiolight_intensity = 1.0f;
+             }
+           }
+         }
+       }
+     }
+ 
+     /* Elatic deform brush */
+     for (Brush *br = bmain->brushes.first; br; br = br->id.next) {
+       if (br->ob_mode & OB_MODE_SCULPT && br->elastic_deform_volume_preservation == 0.0f) {
+         br->elastic_deform_volume_preservation = 0.5f;
+       }
+     }
+   }
+ 
++  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/include/ED_fileselect.h
index 52d1a2c90e7,37090ce3421..1b43c5356b9
--- a/source/blender/editors/include/ED_fileselect.h
+++ b/source/blender/editors/include/ED_fileselect.h
@@@ -134,8 -135,11 +136,13 @@@ void ED_file_read_bookmarks(void)
  
  void ED_file_change_dir(struct bContext *C);
  
+ void ED_file_path_button(struct bScreen *screen,
+                          const struct SpaceFile *sfile,
+                          struct FileSelectParams *params,
+                          struct uiBlock *block);
+ 
 +struct AssetEngine *ED_filelist_assetengine_get(struct SpaceFile *sfile);
 +
  /* File menu stuff */
  
  /* FSMenuEntry's without paths indicate separators */
diff --cc source/blender/editors/space_file/file_draw.c
index fd0d680827b,0aec6d5e6a0..900e4e3845f
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@@ -71,8 -71,52 +71,54 @@@
  
  #include "file_intern.h"  // own include
  
 +#include "MEM_guardedalloc.h"
 +
+ void ED_file_path_button(bScreen *screen,
+                          const SpaceFile *sfile,
+                          FileSelectParams *params,
+                          uiBlock *block)
+ {
+   PointerRNA params_rna_ptr;
+   uiBut *but;
+ 
+   RNA_pointer_create(&screen->id, &RNA_FileSelectParams, params, &params_rna_ptr);
+ 
+   /* callbacks for operator check functions */
+   UI_block_func_set(block, file_draw_check_cb, NULL, NULL);
+ 
+   but = uiDefButR(block,
+                   UI_BTYPE_TEXT,
+                   -1,
+                   "",
+                   0,
+                   0,
+                   UI_UNIT_X * 10,
+                   UI_UNIT_Y,
+                   &params_rna_ptr,
+                   "directory",
+                   0,
+                   0.0f,
+                   (float)FILE_MAX,
+                   0.0f,
+                   0.0f,
+                   TIP_("File path"));
+ 
+   BLI_assert(!UI_but_flag_is_set(but, UI_BUT_UNDO));
+   BLI_assert(!UI_but_is_utf8(but));
+ 
+   UI_but_func_complete_set(but, autocomplete_directory, NULL);
+   UI_but_funcN_set(but, file_directory_enter_handle, NULL, but);
+ 
+   /* TODO, directory editing is non-functional while a library is loaded
+    * until this is properly supported just disable it. */
+   if (sfile && sfile->files && filelist_lib(sfile

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list