Skip to content

Commit

Permalink
improve-abc-curve
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Aug 8, 2024
1 parent 38054a5 commit 5a51b04
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions projects/Alembic/ReadAlembic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -990,6 +990,20 @@ static std::shared_ptr<PrimitiveObject> foundABCCurves(Alembic::AbcGeom::ICurves
offset += count;
}
}
if (auto width = mesh.getWidthsParam()) {
auto widthsamp =
width.getIndexedValue(Alembic::Abc::v12::ISampleSelector((Alembic::AbcCoreAbstract::index_t)sample_index));
int index_size = (int)widthsamp.getIndices()->size();
prim->userData().set2("index_size", index_size);
if (prim->verts.size() == index_size) {
auto &width_attr = prim->add_attr<float>("width");
for (auto i = 0; i < prim->verts.size(); i++) {
auto index = widthsamp.getIndices()->operator[](i);
auto value = widthsamp.getVals()->operator[](index);
width_attr[i] = value;
}
}
}
ICompoundProperty arbattrs = mesh.getArbGeomParams();
read_attributes2(prim, arbattrs, iSS, read_done);
ICompoundProperty usrData = mesh.getUserProperties();
Expand Down

0 comments on commit 5a51b04

Please sign in to comment.