31 std::string abc_name(
name);
32 std::replace(abc_name.begin(), abc_name.end(),
' ',
'_');
33 std::replace(abc_name.begin(), abc_name.end(),
'.',
'_');
34 std::replace(abc_name.begin(), abc_name.end(),
':',
'_');
35 std::replace(abc_name.begin(), abc_name.end(),
'/',
'_');
85 const Alembic::AbcGeom::ISampleSelector &selector,
86 const std::string &
name)
88 for (
size_t i = 0;
i < schema.getNumProperties();
i++) {
89 const PropertyHeader &header = schema.getPropertyHeader(
i);
91 if (header.isCompound()) {
92 const Alembic::Abc::ICompoundProperty &prop = Alembic::Abc::ICompoundProperty(
93 schema, header.getName());
98 const PropertyHeader *header = prop.getPropertyHeader(
name);
99 if (!IV3fArrayProperty::matches(*header)) {
103 const IV3fArrayProperty &velocity_prop = IV3fArrayProperty(prop,
name, 0);
105 return velocity_prop.getValue(selector);
109 else if (header.isArray()) {
110 if (header.getName() ==
name && IV3fArrayProperty::matches(header)) {
111 const IV3fArrayProperty &velocity_prop = IV3fArrayProperty(schema,
name, 0);
112 return velocity_prop.getValue(selector);
117 return V3fArraySamplePtr();
123 const Alembic::AbcGeom::ISampleSelector &selector,
124 const Alembic::AbcCoreAbstract::TimeSamplingPtr &time_sampling,
125 size_t samples_number)
127 const chrono_t time = selector.getRequestedTime();
128 samples_number = std::max(samples_number,
size_t(1));
131 Alembic::AbcCoreAbstract::index_t i0 = t0.first;
133 if (samples_number == 1 || (
fabs(time - t0.second) < 0.0001)) {
138 Alembic::AbcCoreAbstract::index_t i1 = t1.first;
144 const double bias = (time - t0.second) / (t1.second - t0.second);
146 if (
fabs(1.0 - bias) < 0.0001) {
159 const Alembic::AbcGeom::MetaData &md =
object.getMetaData();
161 if (Alembic::AbcGeom::IXform::matches(md)) {
164 else if (Alembic::AbcGeom::IPolyMesh::matches(md)) {
167 else if (Alembic::AbcGeom::ISubD::matches(md)) {
170 else if (Alembic::AbcGeom::INuPatch::matches(md)) {
181 else if (Alembic::AbcGeom::ICamera::matches(md)) {
184 else if (Alembic::AbcGeom::IPoints::matches(md)) {
187 else if (Alembic::AbcMaterial::IMaterial::matches(md)) {
190 else if (Alembic::AbcGeom::ILight::matches(md)) {
193 else if (Alembic::AbcGeom::IFaceSet::matches(md)) {
196 else if (Alembic::AbcGeom::ICurves::matches(md)) {
200 std::cerr <<
"Alembic: unknown how to handle objects of schema '" << md.get(
"schemaObjTitle")
201 <<
"', skipping object '" <<
object.getFullName() <<
"'" << std::endl;