[Bf-blender-cvs] [07f57c751a5] temp-alembic-exporter-T73363-ms2: Alembic export: use the export subset feature of the AHI
Sybren A. Stüvel
noreply at git.blender.org
Fri Mar 20 12:36:47 CET 2020
Commit: 07f57c751a5852f522d2dc9d305f2dd69ceee3ef
Author: Sybren A. Stüvel
Date: Fri Mar 20 12:36:32 2020 +0100
Branches: temp-alembic-exporter-T73363-ms2
https://developer.blender.org/rB07f57c751a5852f522d2dc9d305f2dd69ceee3ef
Alembic export: use the export subset feature of the AHI
===================================================================
M source/blender/io/alembic/intern/export/abc_archive.cc
M source/blender/io/alembic/intern/export/abc_archive.h
M source/blender/io/alembic/intern/export/abc_export_capi.cc
===================================================================
diff --git a/source/blender/io/alembic/intern/export/abc_archive.cc b/source/blender/io/alembic/intern/export/abc_archive.cc
index aa354a8dffd..1bc75a29ba7 100644
--- a/source/blender/io/alembic/intern/export/abc_archive.cc
+++ b/source/blender/io/alembic/intern/export/abc_archive.cc
@@ -246,5 +246,13 @@ bool ABCArchive::is_shape_frame(double frame) const
{
return shape_frames_.find(frame) != shape_frames_.end();
}
+ExportSubset ABCArchive::export_subset_for_frame(double frame) const
+{
+ ExportSubset subset = {
+ .transforms = is_xform_frame(frame),
+ .shapes = is_shape_frame(frame),
+ };
+ return subset;
+}
} // namespace ABC
\ No newline at end of file
diff --git a/source/blender/io/alembic/intern/export/abc_archive.h b/source/blender/io/alembic/intern/export/abc_archive.h
index 9b8cfba091e..b074b9708a3 100644
--- a/source/blender/io/alembic/intern/export/abc_archive.h
+++ b/source/blender/io/alembic/intern/export/abc_archive.h
@@ -24,17 +24,20 @@
#pragma once
#include "ABC_alembic.h"
+#include "abstract_hierarchy_iterator.h"
+#include <Alembic/Abc/OArchive.h>
#include <fstream>
#include <set>
#include <string>
-#include <Alembic/Abc/OArchive.h>
struct Main;
struct Scene;
namespace ABC {
+using USD::ExportSubset;
+
/* Container for an Alembic archive and time sampling info.
*
* Constructor arguments are used to create the correct output stream and to set the archive's
@@ -62,6 +65,8 @@ class ABCArchive {
bool is_xform_frame(double frame) const;
bool is_shape_frame(double frame) const;
+ ExportSubset export_subset_for_frame(double frame) const;
+
private:
std::ofstream abc_ostream_;
uint32_t time_sampling_index_transforms_;
diff --git a/source/blender/io/alembic/intern/export/abc_export_capi.cc b/source/blender/io/alembic/intern/export/abc_export_capi.cc
index e3b8e13d707..9025f7b3ff6 100644
--- a/source/blender/io/alembic/intern/export/abc_export_capi.cc
+++ b/source/blender/io/alembic/intern/export/abc_export_capi.cc
@@ -115,6 +115,8 @@ static void export_startjob(void *customdata, short *stop, short *do_update, flo
scene->r.subframe = frame - scene->r.cfra;
BKE_scene_graph_update_for_newframe(data->depsgraph, data->bmain);
+ ExportSubset export_subset = abc_archive.export_subset_for_frame(frame);
+ iter.set_export_subset(export_subset);
iter.iterate_and_write();
// TODO(Sybren): reinstate:
More information about the Bf-blender-cvs
mailing list