Skip to content

Commit

Permalink
Fix built-in property is not handled as TypedAttribute for SkelRoot
Browse files Browse the repository at this point in the history
Prim.
  • Loading branch information
syoyo committed May 8, 2024
1 parent 5df6d63 commit 2016236
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/prim-reconstruct.cc
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,8 @@ static ParseResult ParseExtentAttribute(std::set<std::string> &table, /* inout *
{
ParseResult ret;

DCOUT("Parse Extent attribute.");

#if 0
if (prop_name.compare(name + ".connect") == 0) {
std::string propname = removeSuffix(name, ".connect");
Expand Down Expand Up @@ -934,7 +936,7 @@ static ParseResult ParseExtentAttribute(std::set<std::string> &table, /* inout *
has_connections = true;
}

DCOUT("Adding typed attribute: " << name);
DCOUT("Adding typed extent attribute: " << name);

if (attr.is_blocked()) {
// e.g. "float3[] extent = None"
Expand Down Expand Up @@ -1010,7 +1012,7 @@ static ParseResult ParseExtentAttribute(std::set<std::string> &table, /* inout *
return ret;
}

DCOUT("Added typed attribute: " << name);
DCOUT("Added typed extent attribute: " << name);

target.metas() = attr.metas();
table.insert(name);
Expand Down Expand Up @@ -2838,12 +2840,12 @@ bool ReconstructPrim<SkelRoot>(

// custom props only
for (const auto &prop : properties) {
ADD_PROPERTY(table, prop, SkelRoot, root->props)
PARSE_TIMESAMPLED_ENUM_PROPERTY(table, prop, kVisibility, Visibility, VisibilityEnumHandler, SkelRoot,
root->visibility, options.strict_allowedToken_check)
PARSE_UNIFORM_ENUM_PROPERTY(table, prop, kPurpose, Purpose, PurposeEnumHandler, SkelRoot,
root->purpose, options.strict_allowedToken_check)
PARSE_EXTENT_ATTRIBUTE(table, prop, kExtent, SkelRoot, root->extent)
ADD_PROPERTY(table, prop, SkelRoot, root->props)
PARSE_PROPERTY_END_MAKE_WARN(table, prop)
}

Expand Down
12 changes: 12 additions & 0 deletions tests/usda/extent-001.usda
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#usda 1.0

def SkelRoot "myskel" (
kind = "component"
)
{
float3[] extent = [(-1, 4, -10), (12, 12, 6)]
float3[] extent.timeSamples = {
2: [(-12, 5, -11), (12, 12, 6)],
3: [(-13, 5, -12), (13, 13, 7)],
4: [(-15, 5, -14), (14, 14, 8)]}
}

0 comments on commit 2016236

Please sign in to comment.