diff options
-rw-r--r-- | source/blender/editors/io/CMakeLists.txt | 4 | ||||
-rw-r--r-- | source/blender/editors/io/io_alembic.c | 17 | ||||
-rw-r--r-- | source/blender/io/alembic/ABC_alembic.h | 7 | ||||
-rw-r--r-- | source/blender/io/alembic/CMakeLists.txt | 8 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_exporter.cc | 4 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_exporter.h | 1 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_reader_archive.cc | 39 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_reader_archive.h | 14 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_writer_archive.cc | 31 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/abc_writer_archive.h | 10 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/alembic_capi.cc | 9 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_enum_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene_api.c | 10 |
13 files changed, 13 insertions, 142 deletions
diff --git a/source/blender/editors/io/CMakeLists.txt b/source/blender/editors/io/CMakeLists.txt index 39548449a86..e7effd05d34 100644 --- a/source/blender/editors/io/CMakeLists.txt +++ b/source/blender/editors/io/CMakeLists.txt @@ -66,10 +66,6 @@ if(WITH_ALEMBIC) bf_alembic ) add_definitions(-DWITH_ALEMBIC) - - if(WITH_ALEMBIC_HDF5) - add_definitions(-DWITH_ALEMBIC_HDF5) - endif() endif() if(WITH_USD) diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index 24c0c1a39ba..fc2c55ffeda 100644 --- a/source/blender/editors/io/io_alembic.c +++ b/source/blender/editors/io/io_alembic.c @@ -133,7 +133,6 @@ static int wm_alembic_export_exec(bContext *C, wmOperator *op) .use_subdiv_schema = RNA_boolean_get(op->ptr, "subdiv_schema"), .export_hair = RNA_boolean_get(op->ptr, "export_hair"), .export_particles = RNA_boolean_get(op->ptr, "export_particles"), - .compression_type = RNA_enum_get(op->ptr, "compression_type"), .packuv = RNA_boolean_get(op->ptr, "packuv"), .triangulate = RNA_boolean_get(op->ptr, "triangulate"), .quad_method = RNA_enum_get(op->ptr, "quad_method"), @@ -163,15 +162,6 @@ static void ui_alembic_export_settings(uiLayout *layout, PointerRNA *imfptr) uiLayout *row; uiLayout *col; -# ifdef WITH_ALEMBIC_HDF5 - box = uiLayoutBox(layout); - row = uiLayoutRow(box, false); - uiItemL(row, IFACE_("Archive Options:"), ICON_NONE); - - row = uiLayoutRow(box, false); - uiItemR(row, imfptr, "compression_type", 0, NULL, ICON_NONE); -# endif - box = uiLayoutBox(layout); row = uiLayoutRow(box, false); uiItemL(row, IFACE_("Manual Transform:"), ICON_NONE); @@ -429,13 +419,6 @@ void WM_OT_alembic_export(wmOperatorType *ot) "Curves as Mesh", "Export curves and NURBS surfaces as meshes"); - RNA_def_enum(ot->srna, - "compression_type", - rna_enum_abc_compression_items, - ABC_ARCHIVE_OGAWA, - "Compression", - ""); - RNA_def_float( ot->srna, "global_scale", diff --git a/source/blender/io/alembic/ABC_alembic.h b/source/blender/io/alembic/ABC_alembic.h index ccc53c589fb..ba430752b29 100644 --- a/source/blender/io/alembic/ABC_alembic.h +++ b/source/blender/io/alembic/ABC_alembic.h @@ -35,11 +35,6 @@ struct bContext; typedef struct AbcArchiveHandle AbcArchiveHandle; -enum { - ABC_ARCHIVE_OGAWA = 0, - ABC_ARCHIVE_HDF5 = 1, -}; - int ABC_get_version(void); struct AlembicExportParams { @@ -68,8 +63,6 @@ struct AlembicExportParams { bool export_hair; bool export_particles; - unsigned int compression_type : 1; - /* See MOD_TRIANGULATE_NGON_xxx and MOD_TRIANGULATE_QUAD_xxx * in DNA_modifier_types.h */ int quad_method; diff --git a/source/blender/io/alembic/CMakeLists.txt b/source/blender/io/alembic/CMakeLists.txt index 6de7d327d4e..16f2d944876 100644 --- a/source/blender/io/alembic/CMakeLists.txt +++ b/source/blender/io/alembic/CMakeLists.txt @@ -36,7 +36,6 @@ set(INC set(INC_SYS ${ALEMBIC_INCLUDE_DIRS} ${BOOST_INCLUDE_DIR} - ${HDF5_INCLUDE_DIRS} ${OPENEXR_INCLUDE_DIRS} ) @@ -98,13 +97,6 @@ set(LIB ${OPENEXR_LIBRARIES} ) -if(WITH_ALEMBIC_HDF5) - add_definitions(-DWITH_ALEMBIC_HDF5) - list(APPEND LIB - ${HDF5_LIBRARIES} - ) -endif() - list(APPEND LIB ${BOOST_LIBRARIES} ) diff --git a/source/blender/io/alembic/intern/abc_exporter.cc b/source/blender/io/alembic/intern/abc_exporter.cc index dbf24452b78..8dad8dff199 100644 --- a/source/blender/io/alembic/intern/abc_exporter.cc +++ b/source/blender/io/alembic/intern/abc_exporter.cc @@ -93,7 +93,6 @@ ExportSettings::ExportSettings() apply_subdiv(false), use_subdiv_schema(false), export_child_hairs(true), - export_ogawa(true), pack_uv(false), triangulate(false), quad_method(0), @@ -276,8 +275,7 @@ void AbcExporter::operator()(short *do_update, float *progress, bool *was_cancel abc_scene_name = "untitled"; } - m_writer = new ArchiveWriter( - m_filename, abc_scene_name, m_settings.scene, m_settings.export_ogawa); + m_writer = new ArchiveWriter(m_filename, abc_scene_name, m_settings.scene); /* Create time samplings for transforms and shapes. */ diff --git a/source/blender/io/alembic/intern/abc_exporter.h b/source/blender/io/alembic/intern/abc_exporter.h index 398004d2ec5..049ccb291bd 100644 --- a/source/blender/io/alembic/intern/abc_exporter.h +++ b/source/blender/io/alembic/intern/abc_exporter.h @@ -73,7 +73,6 @@ struct ExportSettings { bool curves_as_mesh; bool use_subdiv_schema; bool export_child_hairs; - bool export_ogawa; bool pack_uv; bool triangulate; diff --git a/source/blender/io/alembic/intern/abc_reader_archive.cc b/source/blender/io/alembic/intern/abc_reader_archive.cc index 563466d81bc..d55736f732a 100644 --- a/source/blender/io/alembic/intern/abc_reader_archive.cc +++ b/source/blender/io/alembic/intern/abc_reader_archive.cc @@ -40,11 +40,8 @@ using Alembic::Abc::IArchive; using Alembic::Abc::kWrapExisting; static IArchive open_archive(const std::string &filename, - const std::vector<std::istream *> &input_streams, - bool &is_hdf5) + const std::vector<std::istream *> &input_streams) { - is_hdf5 = false; - try { Alembic::AbcCoreOgawa::ReadArchive archive_reader(input_streams); @@ -53,22 +50,7 @@ static IArchive open_archive(const std::string &filename, catch (const Exception &e) { std::cerr << e.what() << '\n'; -#ifdef WITH_ALEMBIC_HDF5 - try { - is_hdf5 = true; - Alembic::AbcCoreAbstract::ReadArraySampleCachePtr cache_ptr; - - return IArchive(Alembic::AbcCoreHDF5::ReadArchive(), - filename.c_str(), - ErrorHandler::kThrowPolicy, - cache_ptr); - } - catch (const Exception &) { - std::cerr << e.what() << '\n'; - return IArchive(); - } -#else - /* Inspect the file to see whether it's really a HDF5 file. */ + /* Inspect the file to see whether it's actually a HDF5 file. */ char header[4]; /* char(0x89) + "HDF" */ std::ifstream the_file(filename.c_str(), std::ios::in | std::ios::binary); if (!the_file) { @@ -81,16 +63,12 @@ static IArchive open_archive(const std::string &filename, std::cerr << filename << " has an unknown file format, unable to read." << std::endl; } else { - is_hdf5 = true; std::cerr << filename << " is in the obsolete HDF5 format, unable to read." << std::endl; } if (the_file.is_open()) { the_file.close(); } - - return IArchive(); -#endif } return IArchive(); @@ -113,18 +91,7 @@ ArchiveReader::ArchiveReader(struct Main *bmain, const char *filename) m_streams.push_back(&m_infile); - m_archive = open_archive(abs_filename, m_streams, m_is_hdf5); - - /* We can't open an HDF5 file from a stream, so close it. */ - if (m_is_hdf5) { - m_infile.close(); - m_streams.clear(); - } -} - -bool ArchiveReader::is_hdf5() const -{ - return m_is_hdf5; + m_archive = open_archive(abs_filename, m_streams); } bool ArchiveReader::valid() const diff --git a/source/blender/io/alembic/intern/abc_reader_archive.h b/source/blender/io/alembic/intern/abc_reader_archive.h index 35273e10108..304c876adce 100644 --- a/source/blender/io/alembic/intern/abc_reader_archive.h +++ b/source/blender/io/alembic/intern/abc_reader_archive.h @@ -25,11 +25,6 @@ #define __ABC_READER_ARCHIVE_H__ #include <Alembic/Abc/All.h> - -#ifdef WITH_ALEMBIC_HDF5 -# include <Alembic/AbcCoreHDF5/All.h> -#endif - #include <Alembic/AbcCoreOgawa/All.h> #include <fstream> @@ -46,21 +41,12 @@ class ArchiveReader { Alembic::Abc::IArchive m_archive; std::ifstream m_infile; std::vector<std::istream *> m_streams; - bool m_is_hdf5; public: ArchiveReader(struct Main *bmain, const char *filename); bool valid() const; - /** - * Returns true when either Blender is compiled with HDF5 support and - * the archive was successfully opened (valid() will also return true), - * or when Blender was built without HDF5 support but a HDF5 file was - * detected (valid() will return false). - */ - bool is_hdf5() const; - Alembic::Abc::IObject getTop(); }; diff --git a/source/blender/io/alembic/intern/abc_writer_archive.cc b/source/blender/io/alembic/intern/abc_writer_archive.cc index e7dee536cb9..40926532f85 100644 --- a/source/blender/io/alembic/intern/abc_writer_archive.cc +++ b/source/blender/io/alembic/intern/abc_writer_archive.cc @@ -43,10 +43,8 @@ using Alembic::Abc::OArchive; /* This kinda duplicates CreateArchiveWithInfo, but Alembic does not seem to * have a version supporting streams. */ static OArchive create_archive(std::ostream *ostream, - const std::string &filename, const std::string &scene_name, - double scene_fps, - bool ogawa) + double scene_fps) { Alembic::Abc::MetaData abc_metadata; @@ -73,38 +71,25 @@ static OArchive create_archive(std::ostream *ostream, abc_metadata.set(Alembic::Abc::kDateWrittenKey, buffer); ErrorHandler::Policy policy = ErrorHandler::kThrowPolicy; - -#ifdef WITH_ALEMBIC_HDF5 - if (!ogawa) { - return OArchive(Alembic::AbcCoreHDF5::WriteArchive(), filename, abc_metadata, policy); - } -#else - static_cast<void>(filename); - static_cast<void>(ogawa); -#endif - Alembic::AbcCoreOgawa::WriteArchive archive_writer; return OArchive(archive_writer(ostream, abc_metadata), kWrapExisting, policy); } ArchiveWriter::ArchiveWriter(const char *filename, const std::string &abc_scene_name, - const Scene *scene, - bool do_ogawa) + const Scene *scene) { /* Use stream to support unicode character paths on Windows. */ - if (do_ogawa) { #ifdef WIN32 - UTF16_ENCODE(filename); - std::wstring wstr(filename_16); - m_outfile.open(wstr.c_str(), std::ios::out | std::ios::binary); - UTF16_UN_ENCODE(filename); + UTF16_ENCODE(filename); + std::wstring wstr(filename_16); + m_outfile.open(wstr.c_str(), std::ios::out | std::ios::binary); + UTF16_UN_ENCODE(filename); #else - m_outfile.open(filename, std::ios::out | std::ios::binary); + m_outfile.open(filename, std::ios::out | std::ios::binary); #endif - } - m_archive = create_archive(&m_outfile, filename, abc_scene_name, FPS, do_ogawa); + m_archive = create_archive(&m_outfile, abc_scene_name, FPS); } OArchive &ArchiveWriter::archive() diff --git a/source/blender/io/alembic/intern/abc_writer_archive.h b/source/blender/io/alembic/intern/abc_writer_archive.h index 82b0e98b376..737717c1710 100644 --- a/source/blender/io/alembic/intern/abc_writer_archive.h +++ b/source/blender/io/alembic/intern/abc_writer_archive.h @@ -25,11 +25,6 @@ #define __ABC_WRITER_ARCHIVE_H__ #include <Alembic/Abc/All.h> - -#ifdef WITH_ALEMBIC_HDF5 -# include <Alembic/AbcCoreHDF5/All.h> -#endif - #include <Alembic/AbcCoreOgawa/All.h> #include <fstream> @@ -47,10 +42,7 @@ class ArchiveWriter { Alembic::Abc::OArchive m_archive; public: - ArchiveWriter(const char *filename, - const std::string &abc_scene_name, - const Scene *scene, - bool do_ogawa); + ArchiveWriter(const char *filename, const std::string &abc_scene_name, const Scene *scene); Alembic::Abc::OArchive &archive(); }; diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc index 6ca9e82a26c..a30b15fee5f 100644 --- a/source/blender/io/alembic/intern/alembic_capi.cc +++ b/source/blender/io/alembic/intern/alembic_capi.cc @@ -373,7 +373,6 @@ bool ABC_export(Scene *scene, job->settings.renderable_only = params->renderable_only; job->settings.use_subdiv_schema = params->use_subdiv_schema; - job->settings.export_ogawa = (params->compression_type == ABC_ARCHIVE_OGAWA); job->settings.pack_uv = params->packuv; job->settings.global_scale = params->global_scale; job->settings.triangulate = params->triangulate; @@ -620,7 +619,6 @@ static std::pair<bool, AbcObjectReader *> visit_object( enum { ABC_NO_ERROR = 0, ABC_ARCHIVE_FAIL, - ABC_UNSUPPORTED_HDF5, }; struct ImportJobData { @@ -659,11 +657,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa ArchiveReader *archive = new ArchiveReader(data->bmain, data->filename); if (!archive->valid()) { -#ifndef WITH_ALEMBIC_HDF5 - data->error_code = archive->is_hdf5() ? ABC_UNSUPPORTED_HDF5 : ABC_ARCHIVE_FAIL; -#else data->error_code = ABC_ARCHIVE_FAIL; -#endif delete archive; return; } @@ -850,9 +844,6 @@ static void import_endjob(void *user_data) case ABC_ARCHIVE_FAIL: WM_report(RPT_ERROR, "Could not open Alembic archive for reading! See console for detail."); break; - case ABC_UNSUPPORTED_HDF5: - WM_report(RPT_ERROR, "Alembic archive in obsolete HDF5 format is not supported."); - break; } WM_main_add_notifier(NC_SCENE | ND_FRAME, data->scene); diff --git a/source/blender/makesrna/RNA_enum_types.h b/source/blender/makesrna/RNA_enum_types.h index b6bae805636..0c462ba6766 100644 --- a/source/blender/makesrna/RNA_enum_types.h +++ b/source/blender/makesrna/RNA_enum_types.h @@ -225,7 +225,6 @@ extern const EnumPropertyItem rna_enum_dt_mix_mode_items[]; extern const EnumPropertyItem rna_enum_dt_layers_select_src_items[]; extern const EnumPropertyItem rna_enum_dt_layers_select_dst_items[]; -extern const EnumPropertyItem rna_enum_abc_compression_items[]; extern const EnumPropertyItem rna_enum_context_mode_items[]; extern const EnumPropertyItem rna_enum_curveprofile_preset_items[]; diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index 1d03b16d5bb..e9c59fc5011 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -41,13 +41,6 @@ # include "ABC_alembic.h" #endif -const EnumPropertyItem rna_enum_abc_compression_items[] = { -#ifdef WITH_ALEMBIC - {ABC_ARCHIVE_OGAWA, "OGAWA", 0, "Ogawa", ""}, - {ABC_ARCHIVE_HDF5, "HDF5", 0, "HDF5", ""}, -#endif - {0, NULL, 0, NULL, NULL}}; - #ifdef RNA_RUNTIME # include "BKE_editmesh.h" @@ -222,7 +215,6 @@ static void rna_Scene_alembic_export(Scene *scene, bool use_subdiv_schema, bool export_hair, bool export_particles, - int compression_type, bool packuv, float scale, bool triangulate, @@ -257,7 +249,6 @@ static void rna_Scene_alembic_export(Scene *scene, .use_subdiv_schema = use_subdiv_schema, .export_hair = export_hair, .export_particles = export_particles, - .compression_type = compression_type, .packuv = packuv, .triangulate = triangulate, .quad_method = quad_method, @@ -410,7 +401,6 @@ void RNA_api_scene(StructRNA *srna) func, "export_hair", 1, "Export Hair", "Exports hair particle systems as animated curves"); RNA_def_boolean( func, "export_particles", 1, "Export Particles", "Exports non-hair particle systems"); - RNA_def_enum(func, "compression_type", rna_enum_abc_compression_items, 0, "Compression", ""); RNA_def_boolean( func, "packuv", 0, "Export with packed UV islands", "Export with packed UV islands"); RNA_def_float( |