Skip to content

Commit 3b27bed

Browse files
committed
Fix ValueBlock Relationship was not handled correctly.
1 parent a4cff31 commit 3b27bed

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

src/ascii-parser.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3519,6 +3519,7 @@ bool AsciiParser::ParseRelationship(Relationship *result) {
35193519
PUSH_ERROR_AND_RETURN("Failed to parse None.");
35203520
}
35213521

3522+
DCOUT("Relationship valueblock.");
35223523
result->set_blocked();
35233524
} else {
35243525
PUSH_ERROR_AND_RETURN("Unexpected char \"" + std::to_string(c) +
@@ -3804,7 +3805,8 @@ bool AsciiParser::ParsePrimProps(std::map<std::string, Property> *props,
38043805
PUSH_ERROR_AND_RETURN("Failed to parse `rel` property.");
38053806
}
38063807

3807-
if (!SkipWhitespace()) {
3808+
if (!SkipCommentAndWhitespaceAndNewline()) {
3809+
return false;
38083810
}
38093811

38103812
if (!LookChar1(&c)) {

src/prim-reconstruct.cc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1399,8 +1399,12 @@ static ParseResult ParseShaderInputConnectionProperty(std::set<std::string> &tab
13991399
__target = rel; \
14001400
table.insert(prop.first); \
14011401
DCOUT("Added rel " << __propname); \
1402+
} else if (rel.is_blocked()) { \
1403+
__target = rel; \
1404+
table.insert(prop.first); \
1405+
DCOUT("Added ValueBlocked rel " << __propname); \
14021406
} else { \
1403-
PUSH_ERROR_AND_RETURN(fmt::format("`{}` target must be Path.", __propname)); \
1407+
PUSH_ERROR_AND_RETURN(fmt::format("Internal error. Property `{}` is not a valid Relationship.", __propname)); \
14041408
} \
14051409
}
14061410

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#usda 1.0
2+
3+
def Xform "geom"
4+
{
5+
# common material
6+
rel material:binding = None
7+
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#usda 1.0
2+
3+
def Xform "geom"
4+
{
5+
rel material:binding = None ( bindMaterialAs = "strongerThanDescendants" )
6+
}

0 commit comments

Comments
 (0)