[Bf-blender-cvs] [2841b2be394] master: IDs: change FILTER_ID_* to 64 bit to make space for new ID types

Brecht Van Lommel noreply at git.blender.org
Tue Mar 3 18:05:32 CET 2020


Commit: 2841b2be3949b7592b50cd2ebd03b9b32a5f2058
Author: Brecht Van Lommel
Date:   Tue Mar 3 17:21:28 2020 +0100
Branches: master
https://developer.blender.org/rB2841b2be3949b7592b50cd2ebd03b9b32a5f2058

IDs: change FILTER_ID_* to 64 bit to make space for new ID types

And change file browser to boolean from bitflag enum, which is only 32 bit.

Differential Revision: https://developer.blender.org/D7004

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

M	release/scripts/startup/bl_ui/space_filebrowser.py
M	source/blender/blenkernel/BKE_blender_copybuffer.h
M	source/blender/blenkernel/BKE_idcode.h
M	source/blender/blenkernel/intern/blender_copybuffer.c
M	source/blender/blenkernel/intern/idcode.c
M	source/blender/blenloader/BLO_readfile.h
M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/space_file/filelist.c
M	source/blender/editors/space_file/filelist.h
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesdna/DNA_space_types.h
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_space.c

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

diff --git a/release/scripts/startup/bl_ui/space_filebrowser.py b/release/scripts/startup/bl_ui/space_filebrowser.py
index 8ff85459d35..95046678b27 100644
--- a/release/scripts/startup/bl_ui/space_filebrowser.py
+++ b/release/scripts/startup/bl_ui/space_filebrowser.py
@@ -148,7 +148,12 @@ class FILEBROWSER_PT_filter(Panel):
             if params.use_filter_blendid:
                 row = col.row()
                 row.label(icon='BLANK1')  # Indentation
-                row.prop(params, "filter_id_category", text="")
+
+                sub = row.column(align=True)
+                filter_id = params.filter_id
+                for identifier in dir(filter_id):
+                    if identifier.startswith("category_"):
+                        sub.prop(filter_id, identifier, toggle=True)
 
                 col.separator()
 
@@ -314,8 +319,11 @@ class FILEBROWSER_PT_advanced_filter(Panel):
             layout.prop(params, "use_filter_blendid")
             if params.use_filter_blendid:
                 layout.separator()
-                col = layout.column()
-                col.prop(params, "filter_id")
+                col = layout.column(align=True)
+                filter_id = params.filter_id
+                for identifier in dir(filter_id):
+                    if identifier.startswith("filter_"):
+                        col.prop(filter_id, identifier, toggle=True)
 
 
 class FILEBROWSER_PT_directory_path(Panel):
diff --git a/source/blender/blenkernel/BKE_blender_copybuffer.h b/source/blender/blenkernel/BKE_blender_copybuffer.h
index fcc30ffc20d..ca20d3d9bba 100644
--- a/source/blender/blenkernel/BKE_blender_copybuffer.h
+++ b/source/blender/blenkernel/BKE_blender_copybuffer.h
@@ -20,6 +20,8 @@
  * \ingroup bke
  */
 
+#include "BLI_sys_types.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -36,12 +38,12 @@ bool BKE_copybuffer_save(struct Main *bmain_src, const char *filename, struct Re
 bool BKE_copybuffer_read(struct Main *bmain_dst,
                          const char *libname,
                          struct ReportList *reports,
-                         const unsigned int id_types_mask);
+                         const uint64_t id_types_mask);
 int BKE_copybuffer_paste(struct bContext *C,
                          const char *libname,
                          const short flag,
                          struct ReportList *reports,
-                         const unsigned int id_types_mask);
+                         const uint64_t id_types_mask);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/blenkernel/BKE_idcode.h b/source/blender/blenkernel/BKE_idcode.h
index dc58651b4e8..067143e3253 100644
--- a/source/blender/blenkernel/BKE_idcode.h
+++ b/source/blender/blenkernel/BKE_idcode.h
@@ -24,6 +24,8 @@
  * \ingroup bke
  */
 
+#include "BLI_sys_types.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -35,8 +37,8 @@ short BKE_idcode_from_name(const char *name);
 bool BKE_idcode_is_linkable(short idcode);
 bool BKE_idcode_is_valid(short idcode);
 
-int BKE_idcode_to_idfilter(const short idcode);
-short BKE_idcode_from_idfilter(const int idfilter);
+uint64_t BKE_idcode_to_idfilter(const short idcode);
+short BKE_idcode_from_idfilter(const uint64_t idfilter);
 
 int BKE_idcode_to_index(const short idcode);
 short BKE_idcode_from_index(const int index);
diff --git a/source/blender/blenkernel/intern/blender_copybuffer.c b/source/blender/blenkernel/intern/blender_copybuffer.c
index f78eefa0a27..8619db34d93 100644
--- a/source/blender/blenkernel/intern/blender_copybuffer.c
+++ b/source/blender/blenkernel/intern/blender_copybuffer.c
@@ -84,7 +84,7 @@ bool BKE_copybuffer_save(Main *bmain_src, const char *filename, ReportList *repo
 bool BKE_copybuffer_read(Main *bmain_dst,
                          const char *libname,
                          ReportList *reports,
-                         const unsigned int id_types_mask)
+                         const uint64_t id_types_mask)
 {
   BlendHandle *bh = BLO_blendhandle_from_file(libname, reports);
   if (bh == NULL) {
@@ -117,7 +117,7 @@ int BKE_copybuffer_paste(bContext *C,
                          const char *libname,
                          const short flag,
                          ReportList *reports,
-                         const unsigned int id_types_mask)
+                         const uint64_t id_types_mask)
 {
   Main *bmain = CTX_data_main(C);
   Scene *scene = CTX_data_scene(C);
diff --git a/source/blender/blenkernel/intern/idcode.c b/source/blender/blenkernel/intern/idcode.c
index 6b7cb181374..b9ca77ceb67 100644
--- a/source/blender/blenkernel/intern/idcode.c
+++ b/source/blender/blenkernel/intern/idcode.c
@@ -179,7 +179,7 @@ short BKE_idcode_from_name(const char *name)
 /**
  * Convert an idcode into an idfilter (e.g. ID_OB -> FILTER_ID_OB).
  */
-int BKE_idcode_to_idfilter(const short idcode)
+uint64_t BKE_idcode_to_idfilter(const short idcode)
 {
 #define CASE_IDFILTER(_id) \
   case ID_##_id: \
@@ -227,7 +227,7 @@ int BKE_idcode_to_idfilter(const short idcode)
 /**
  * Convert an idfilter into an idcode (e.g. FILTER_ID_OB -> ID_OB).
  */
-short BKE_idcode_from_idfilter(const int idfilter)
+short BKE_idcode_from_idfilter(const uint64_t idfilter)
 {
 #define CASE_IDFILTER(_id) \
   case FILTER_ID_##_id: \
diff --git a/source/blender/blenloader/BLO_readfile.h b/source/blender/blenloader/BLO_readfile.h
index ee7877b1a5d..00dbe334356 100644
--- a/source/blender/blenloader/BLO_readfile.h
+++ b/source/blender/blenloader/BLO_readfile.h
@@ -19,6 +19,8 @@
 #ifndef __BLO_READFILE_H__
 #define __BLO_READFILE_H__
 
+#include "BLI_sys_types.h"
+
 /** \file
  * \ingroup blenloader
  * \brief external readfile function prototypes.
@@ -145,9 +147,7 @@ void BLO_library_link_end(struct Main *mainl,
                           struct ViewLayer *view_layer,
                           const struct View3D *v3d);
 
-int BLO_library_link_copypaste(struct Main *mainl,
-                               BlendHandle *bh,
-                               const unsigned int id_types_mask);
+int BLO_library_link_copypaste(struct Main *mainl, BlendHandle *bh, const uint64_t id_types_mask);
 
 void *BLO_library_read_struct(struct FileData *fd, struct BHead *bh, const char *blockname);
 
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index d97fe900679..c1f61db27c3 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -11259,7 +11259,7 @@ static ID *link_named_part(
 /**
  * Simple reader for copy/paste buffers.
  */
-int BLO_library_link_copypaste(Main *mainl, BlendHandle *bh, const unsigned int id_types_mask)
+int BLO_library_link_copypaste(Main *mainl, BlendHandle *bh, const uint64_t id_types_mask)
 {
   FileData *fd = (FileData *)(bh);
   BHead *bhead;
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 9defff74c6f..11304d6ae46 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -269,8 +269,8 @@ typedef struct FileListEntryPreview {
 } FileListEntryPreview;
 
 typedef struct FileListFilter {
-  unsigned int filter;
-  unsigned int filter_id;
+  uint64_t filter;
+  uint64_t filter_id;
   char filter_glob[FILE_MAXFILE];
   char filter_search[66]; /* + 2 for heading/trailing implicit '*' wildcards. */
   short flags;
@@ -361,7 +361,7 @@ static void filelist_readjob_dir(
 
 /* helper, could probably go in BKE actually? */
 static int groupname_to_code(const char *group);
-static unsigned int groupname_to_filter_id(const char *group);
+static uint64_t groupname_to_filter_id(const char *group);
 
 static void filelist_filter_clear(FileList *filelist);
 static void filelist_cache_clear(FileListEntryCache *cache, size_t new_size);
@@ -746,7 +746,7 @@ static bool is_filtered_lib(FileListInternEntry *file, const char *root, FileLis
             is_filtered = false;
           }
           else {
-            unsigned int filter_id = groupname_to_filter_id(group);
+            uint64_t filter_id = groupname_to_filter_id(group);
             if (!(filter_id & filter->filter_id)) {
               is_filtered = false;
             }
@@ -835,8 +835,8 @@ void filelist_setfilter_options(FileList *filelist,
                                 const bool do_filter,
                                 const bool hide_dot,
                                 const bool hide_parent,
-                                const unsigned int filter,
-                                const unsigned int filter_id,
+                                const uint64_t filter,
+                                const uint64_t filter_id,
                                 const char *filter_glob,
                                 const char *filter_search)
 {
@@ -2422,7 +2422,7 @@ static int groupname_to_code(const char *group)
   return buf[0] ? BKE_idcode_from_name(buf) : 0;
 }
 
-static unsigned int groupname_to_filter_id(const char *group)
+static uint64_t groupname_to_filter_id(const char *group)
 {
   int id_code = groupname_to_code(group);
 
diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h
index 9b1107294ff..654a86b1702 100644
--- a/source/blender/editors/space_file/filelist.h
+++ b/source/blender/editors/space_file/filelist.h
@@ -62,8 +62,8 @@ void filelist_setfilter_options(struct FileList *filelist,
                                 const bool do_filter,
                                 const bool hide_dot,
                                 const bool hide_parent,
-                                const unsigned int filter,
-                                const unsigned int filter_id,
+                                const uint64_t filter,
+                                const uint64_t filter_id,
                                 const char *filter_glob,
                                 const char *filter_search);
 void filelist_filter(struct FileList *filelist);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index d0ba2b0c4e5..89af705d5ed 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -645,

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list