Skip to content

Commit

Permalink
fix-abc
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Dec 6, 2024
1 parent 771074c commit 648d80f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions projects/Alembic/ReadAlembic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,7 @@ struct ReadAlembic : INode {
frameid = getGlobalState()->frameid;
}
auto abctree = std::make_shared<ABCTree>();
bool read_face_set = get_input2<bool>("read_face_set");
{
auto path = get_input<StringObject>("path")->get();
if (usedPath != path) {
Expand All @@ -1185,7 +1186,6 @@ struct ReadAlembic : INode {
// fmt::print("GetArchiveStartAndEndTime: {}\n", start);
// fmt::print("archive.getNumTimeSamplings: {}\n", archive.getNumTimeSamplings());
auto obj = archive.getTop();
bool read_face_set = get_input2<bool>("read_face_set");
bool outOfRangeAsEmpty = get_input2<bool>("outOfRangeAsEmpty");
bool skipInvisibleObject = get_input2<bool>("skipInvisibleObject");
Alembic::Util::uint32_t numSamplings = archive.getNumTimeSamplings();
Expand Down Expand Up @@ -1215,7 +1215,7 @@ struct ReadAlembic : INode {
}
set_output("namelist", namelist);
}
if (get_input2<bool>("CopyFacesetToMatid")) {
if (get_input2<bool>("CopyFacesetToMatid") && read_face_set) {
abctree->visitPrims([](auto &prim){
prim_copy_faceset_to_matid(prim.get());
});
Expand Down
2 changes: 1 addition & 1 deletion zeno/src/nodes/neo/PrimMerge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ ZENO_API void prim_set_abcpath(PrimitiveObject* prim, std::string path_name) {

ZENO_API void prim_copy_faceset_to_matid(PrimitiveObject* prim) {
auto &ud = prim->userData();
auto faceset_count = ud.get2<int>("faceset_count");
auto faceset_count = ud.get2<int>("faceset_count", 0);
ud.set2("matNum", faceset_count);
for (auto i = 0; i < faceset_count; i++) {
auto value = ud.get2<std::string>(format("faceset_{}", i));
Expand Down

0 comments on commit 648d80f

Please sign in to comment.