Blender  V3.3
abc_archive.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2020 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "ABC_alembic.h"
12 
13 #include <Alembic/Abc/OArchive.h>
14 #include <Alembic/Abc/OTypedScalarProperty.h>
15 
16 #include <fstream>
17 #include <set>
18 #include <string>
19 
20 struct Main;
21 struct Scene;
22 
23 namespace blender::io::alembic {
24 
25 /* Container for an Alembic archive and time sampling info.
26  *
27  * Constructor arguments are used to create the correct output stream and to set the archive's
28  * metadata. */
29 class ABCArchive {
30  public:
31  typedef std::set<double> Frames;
32 
33  Alembic::Abc::OArchive *archive;
34 
35  ABCArchive(const Main *bmain,
36  const Scene *scene,
38  std::string filename);
39  ~ABCArchive();
40 
43 
44  Frames::const_iterator frames_begin() const;
45  Frames::const_iterator frames_end() const;
46  size_t total_frame_count() const;
47 
48  bool is_xform_frame(double frame) const;
49  bool is_shape_frame(double frame) const;
50 
51  ExportSubset export_subset_for_frame(double frame) const;
52 
53  void update_bounding_box(const Imath::Box3d &bounds);
54 
55  private:
56  std::ofstream abc_ostream_;
57  uint32_t time_sampling_index_transforms_;
58  uint32_t time_sampling_index_shapes_;
59 
60  Frames xform_frames_;
61  Frames shape_frames_;
62  Frames export_frames_;
63 
64  Alembic::Abc::OBox3dProperty abc_archive_bbox_;
65 };
66 
67 } // namespace blender::io::alembic
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
Frames::const_iterator frames_end() const
Definition: abc_archive.cc:215
ABCArchive(const Main *bmain, const Scene *scene, AlembicExportParams params, std::string filename)
Definition: abc_archive.cc:155
bool is_xform_frame(double frame) const
Definition: abc_archive.cc:224
ExportSubset export_subset_for_frame(double frame) const
Definition: abc_archive.cc:232
bool is_shape_frame(double frame) const
Definition: abc_archive.cc:228
Frames::const_iterator frames_begin() const
Definition: abc_archive.cc:211
uint32_t time_sampling_index_shapes() const
Definition: abc_archive.cc:206
Alembic::Abc::OArchive * archive
Definition: abc_archive.h:33
void update_bounding_box(const Imath::Box3d &bounds)
Definition: abc_archive.cc:240
uint32_t time_sampling_index_transforms() const
Definition: abc_archive.cc:201
Scene scene
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
unsigned int uint32_t
Definition: stdint.h:80
Definition: BKE_main.h:121