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;
55void split(
const std::string &s,
char delim, std::vector<std::string> &tokens);
57template<
class TContainer>
bool begins_with(
const TContainer &
input,
const TContainer &match)
59 return input.size() >= match.size() && std::equal(match.begin(), match.end(),
input.begin());
62template<
typename Schema>
65 const Alembic::Abc::TimeSamplingPtr &time_samp = schema.getTimeSampling();
67 if (!schema.isConstant()) {
68 const size_t num_samps = schema.getNumSamples();
71 const chrono_t min_time = time_samp->getSampleTime(0);
72 min = std::min(
min, min_time);
74 const chrono_t max_time = time_samp->getSampleTime(num_samps - 1);
75 max = std::max(
max, max_time);
80template<
typename Schema>
88 const Alembic::AbcGeom::IObject &parent =
object.getParent();
89 if (parent.valid() && Alembic::AbcGeom::IXform::matches(parent.getMetaData())) {
90 Alembic::AbcGeom::IXform xform(parent, Alembic::AbcGeom::kWrapExisting);
95bool has_property(
const Alembic::Abc::ICompoundProperty &prop,
const std::string &name);
97 const Alembic::AbcGeom::ISampleSelector &selector,
98 const std::string &name);
120 const Alembic::AbcGeom::ISampleSelector &selector,
121 const Alembic::AbcCoreAbstract::TimeSamplingPtr &time_sampling,
122 size_t samples_number);
131 const char *m_message;
140# define SCOPE_TIMER(message) ScopeTimer prof(message)
142# define SCOPE_TIMER(message)
157 std::ostringstream m_stream;
163 std::string
str()
const;
174 std::ostringstream &
stream();
177#define ABC_LOG(logger) logger.stream()
182std::ostream &
operator<<(std::ostream &os,
const SimpleLogger &logger);
ScopeTimer(const char *message)
std::ostringstream & stream()
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)
std::ostream & operator<<(std::ostream &os, const SimpleLogger &logger)
std::string get_object_dag_path_name(const Object *const ob, Object *dupli_parent)
get_object_dag_path_name returns the name under which the object will be exported in the Alembic file...
V3fArraySamplePtr get_velocity_prop(const Alembic::Abc::ICompoundProperty &schema, const Alembic::AbcGeom::ISampleSelector &selector, const std::string &name)
std::string get_id_name(const Object *const ob)
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