12#include <Alembic/Abc/Foundation.h>
13#include <Alembic/Abc/ICompoundProperty.h>
14#include <Alembic/Abc/IObject.h>
15#include <Alembic/Abc/ISampleSelector.h>
16#include <Alembic/Abc/TypedArraySample.h>
17#include <Alembic/AbcCoreAbstract/Foundation.h>
18#include <Alembic/AbcCoreAbstract/TimeSampling.h>
19#include <Alembic/AbcGeom/IXform.h>
25using Alembic::Abc::chrono_t;
26using Alembic::Abc::V3fArraySamplePtr;
43void split(
const std::string &s,
char delim, std::vector<std::string> &tokens);
45template<
class TContainer>
bool begins_with(
const TContainer &
input,
const TContainer &match)
47 return input.size() >= match.size() && std::equal(match.begin(), match.end(),
input.begin());
50template<
typename Schema>
53 const Alembic::Abc::TimeSamplingPtr &time_samp = schema.getTimeSampling();
55 if (!schema.isConstant()) {
56 const size_t num_samps = schema.getNumSamples();
59 const chrono_t min_time = time_samp->getSampleTime(0);
60 min = std::min(
min, min_time);
62 const chrono_t max_time = time_samp->getSampleTime(num_samps - 1);
63 max = std::max(
max, max_time);
68template<
typename Schema>
76 const Alembic::AbcGeom::IObject &parent =
object.getParent();
77 if (parent.valid() && Alembic::AbcGeom::IXform::matches(parent.getMetaData())) {
78 Alembic::AbcGeom::IXform xform(parent, Alembic::AbcGeom::kWrapExisting);
83bool has_property(
const Alembic::Abc::ICompoundProperty &prop,
const std::string &
name);
85 const Alembic::AbcGeom::ISampleSelector &selector,
86 const std::string &
name);
94 Alembic::AbcGeom::index_t
index;
108 const Alembic::AbcGeom::ISampleSelector &selector,
109 const Alembic::AbcCoreAbstract::TimeSamplingPtr &time_sampling,
110 size_t samples_number);
bool begins_with(const TContainer &input, const TContainer &match)
void get_min_max_time(const Alembic::AbcGeom::IObject &object, const Schema &schema, chrono_t &min, chrono_t &max)
std::string get_valid_abc_name(const char *name)
V3fArraySamplePtr get_velocity_prop(const Alembic::Abc::ICompoundProperty &schema, const Alembic::AbcGeom::ISampleSelector &selector, const std::string &name)
Imath::M44d convert_matrix_datatype(const float mat[4][4])
bool has_property(const Alembic::Abc::ICompoundProperty &prop, const std::string &name)
void get_min_max_time_ex(const Schema &schema, chrono_t &min, chrono_t &max)
AbcObjectReader * create_reader(const Alembic::AbcGeom::IObject &object, ImportSettings &settings)
std::optional< SampleInterpolationSettings > get_sample_interpolation_settings(const Alembic::AbcGeom::ISampleSelector &selector, const Alembic::AbcCoreAbstract::TimeSamplingPtr &time_sampling, size_t samples_number)
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
Alembic::AbcGeom::index_t index
Alembic::AbcGeom::index_t ceil_index