Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix-abc #2067

Merged
merged 1 commit into from
Dec 6, 2024
Merged

fix-abc #2067

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading