Skip to content

Commit

Permalink
Make "kind" a disallowed field for metadata in schemas.
Browse files Browse the repository at this point in the history
(Internal change: 2297901)
  • Loading branch information
diyajoy authored and pixar-oss committed Oct 26, 2023
1 parent f7cfdb1 commit 8bef6d2
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pxr/usd/usd/schemaRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,6 +1634,10 @@ UsdSchemaRegistry::IsDisallowedField(const TfToken &fieldName)
const std::vector<TfToken> clipFields = UsdGetClipRelatedFields();
disallowedFields->insert(clipFields.begin(), clipFields.end());

// Disallow fallback values for prim "kind" metadata as prim composition
// currently intentionally ignores the "kind" fallback value
disallowedFields->insert(SdfFieldKeys->Kind);

return disallowedFields;
}();

Expand Down
26 changes: 26 additions & 0 deletions pxr/usd/usd/testenv/testUsdSchemaGen/schemaFail23.usda
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#usda 1.0
(
"This file is a contrived schema file."
subLayers = [
@baseSchema.usda@
]
)

over "GLOBAL" (
customData = {
string libraryName = "usdContrived"
string libraryPath = "pxr/usd/usdContrived"
}
)
{
}

class "DisallowedFieldKind" (
inherits = </Typed>
kind = "component"
customData = {
string className = "DisallowedFieldKind"
}
)
{
}

0 comments on commit 8bef6d2

Please sign in to comment.