Skip to content

Commit

Permalink
Print connections in Print Fabric stage button
Browse files Browse the repository at this point in the history
  • Loading branch information
lilleyse committed Jul 12, 2023
1 parent f060e6b commit 6402ef2
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/core/src/FabricUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ std::string printAttributeValue(
}
}

std::string printConnection(const omni::fabric::Path& primPath, const omni::fabric::Token& attributeName) {
auto stageReaderWriter = UsdUtil::getFabricStageReaderWriter();
const auto connection = stageReaderWriter.getConnection(primPath, attributeName);
if (connection == nullptr) {
return NO_DATA_STRING;
}

const auto path = omni::fabric::Path(connection->path).getText();
const auto attrName = omni::fabric::Token(connection->attrName).getText();

return fmt::format("Path: {}, Attribute Name: {}", path, attrName);
}

std::string printAttributeValue(const omni::fabric::Path& primPath, const omni::fabric::AttrNameAndType& attribute) {
auto stageReaderWriter = UsdUtil::getFabricStageReaderWriter();

Expand All @@ -165,6 +178,17 @@ std::string printAttributeValue(const omni::fabric::Path& primPath, const omni::
}
break;
}
case omni::fabric::BaseDataType::eConnection: {
switch (componentCount) {
case 1: {
return printConnection(primPath, name);
}
default: {
break;
}
}
break;
}
case omni::fabric::BaseDataType::eToken: {
switch (componentCount) {
case 1: {
Expand Down

0 comments on commit 6402ef2

Please sign in to comment.