From b0a1cf2c9ae696b07f7a236bc855a5ab4a493dcb Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 17 Mar 2020 14:41:48 +0100 Subject: Objects: add Volume object type, and prototypes for Hair and PointCloud Only the volume object is exposed in the user interface. It is based on OpenVDB internally. Drawing and rendering code will follow in another commit. https://wiki.blender.org/wiki/Source/Objects/Volume https://wiki.blender.org/wiki/Reference/Release_Notes/2.83/Volumes Hair and PointCloud object types are hidden behind a WITH_NEW_OBJECT_TYPES build option. These are unfinished, and included only to make it easier to cooperate on development in the future and avoid tricky merges. https://wiki.blender.org/wiki/Source/Objects/New_Object_Types Ref T73201, T68981 Differential Revision: https://developer.blender.org/D6945 --- source/blender/editors/space_file/filelist.c | 17 ++++++++++++++--- source/blender/editors/space_file/filesel.c | 3 +++ 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/space_file') diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 188f3417ddc..1fc0866bd9f 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1080,6 +1080,9 @@ static int filelist_geticon_ex(FileDirEntry *file, else if (typeflag & FILE_TYPE_USD) { return ICON_FILE_3D; } + else if (typeflag & FILE_TYPE_VOLUME) { + return ICON_FILE_VOLUME; + } else if (typeflag & FILE_TYPE_OBJECT_IO) { return ICON_FILE_3D; } @@ -2236,6 +2239,9 @@ int ED_path_extension_type(const char *path) else if (BLI_path_extension_check_n(path, ".usd", ".usda", ".usdc", NULL)) { return FILE_TYPE_USD; } + else if (BLI_path_extension_check(path, ".vdb")) { + return FILE_TYPE_VOLUME; + } else if (BLI_path_extension_check(path, ".zip")) { return FILE_TYPE_ARCHIVE; } @@ -2298,6 +2304,8 @@ int ED_file_extension_icon(const char *path) return ICON_FILE_TEXT; case FILE_TYPE_ARCHIVE: return ICON_FILE_ARCHIVE; + case FILE_TYPE_VOLUME: + return ICON_FILE_VOLUME; default: return ICON_FILE_BLANK; } @@ -2625,9 +2633,9 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist) if (filelist->dir[0] == 0) { /* make directories */ # ifdef WITH_FREESTYLE - filelist->filelist.nbr_entries = 24; + filelist->filelist.nbr_entries = 27; # else - filelist->filelist.nbr_entries = 23; + filelist->filelist.nbr_entries = 26; # endif filelist_resize(filelist, filelist->filelist.nbr_entries); @@ -2658,8 +2666,11 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist) filelist->filelist.entries[20].entry->relpath = BLI_strdup("Action"); filelist->filelist.entries[21].entry->relpath = BLI_strdup("NodeTree"); filelist->filelist.entries[22].entry->relpath = BLI_strdup("Speaker"); + filelist->filelist.entries[23].entry->relpath = BLI_strdup("Hair"); + filelist->filelist.entries[24].entry->relpath = BLI_strdup("Point Cloud"); + filelist->filelist.entries[25].entry->relpath = BLI_strdup("Volume"); # ifdef WITH_FREESTYLE - filelist->filelist.entries[23].entry->relpath = BLI_strdup("FreestyleLineStyle"); + filelist->filelist.entries[26].entry->relpath = BLI_strdup("FreestyleLineStyle"); # endif } else { diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index d07db12eeac..6c0f79f0f5c 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -218,6 +218,9 @@ short ED_fileselect_set_params(SpaceFile *sfile) if ((prop = RNA_struct_find_property(op->ptr, "filter_usd"))) { params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_USD : 0; } + if ((prop = RNA_struct_find_property(op->ptr, "filter_volume"))) { + params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_VOLUME : 0; + } if ((prop = RNA_struct_find_property(op->ptr, "filter_glob"))) { /* Protection against pyscripts not setting proper size limit... */ char *tmp = RNA_property_string_get_alloc( -- cgit v1.2.3