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>
26using Alembic::Abc::chrono_t;
27using Alembic::Abc::V3fArraySamplePtr;
56void split(
const std::string &s,
char delim, std::vector<std::string> &tokens);
58template<
class TContainer>
bool begins_with(
const TContainer &input,
const TContainer &match)
60 return input.size() >= match.size() && std::equal(match.begin(), match.end(), input.begin());
63template<
typename Schema>
66 const Alembic::Abc::TimeSamplingPtr &time_samp = schema.getTimeSampling();
68 if (!schema.isConstant()) {
69 const size_t num_samps = schema.getNumSamples();
72 const chrono_t min_time = time_samp->getSampleTime(0);
73 min = std::min(
min, min_time);
75 const chrono_t max_time = time_samp->getSampleTime(num_samps - 1);
76 max = std::max(max, max_time);
81template<
typename Schema>
89 const Alembic::AbcGeom::IObject &parent =
object.getParent();
90 if (parent.valid() && Alembic::AbcGeom::IXform::matches(parent.getMetaData())) {
91 Alembic::AbcGeom::IXform xform(parent, Alembic::AbcGeom::kWrapExisting);
96bool has_property(
const Alembic::Abc::ICompoundProperty &prop,
const std::string &name);
98 const Alembic::AbcGeom::ISampleSelector &selector,
99 const std::string &name);
121 const Alembic::AbcGeom::ISampleSelector &selector,
122 const Alembic::AbcCoreAbstract::TimeSamplingPtr &time_sampling,
123 size_t samples_number);
132 const char *m_message;
141# define SCOPE_TIMER(message) ScopeTimer prof(message)
143# define SCOPE_TIMER(message)
158 std::ostringstream m_stream;
164 std::string
str()
const;
175 std::ostringstream &
stream();
178#define ABC_LOG(logger) logger.stream()
183std::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