auto attribute = sphere.GetPrim().CreateAttribute(
pxr::TfToken {"userProperties:some_attribute"},
pxr::SdfValueTypeNames->Bool,
true
);
attribute.Set(false);
attribute = sphere.GetPrim().CreateAttribute(
"userProperties:some_attribute", Sdf.ValueTypeNames.Bool, True
)
attribute.Set(False)
auto is_user_property = [&](std::string const &path) {
static std::string const properties = "userProperties";
// If `path` starts with "userProperties" then it's a user property
return strncmp(path.c_str(), properties.c_str(), strlen(properties.c_str())) == 0;
};
for (auto const &property : sphere.GetPrim().GetAuthoredProperties(is_user_property)) {
std::cout << property.GetName() << " ";
}
std::cout << '\n';
def is_user_property(node):
return node.startswith("userProperties:")
print('user properties', sphere.GetPrim().GetAuthoredProperties(is_user_property))
https://graphics.pixar.com/usd/docs/Maya-USD-Plugins.html