Skip to content

Commit

Permalink
Use std::string insted of problematic 'value::StringData' for 'string…
Browse files Browse the repository at this point in the history
…' attribute
  • Loading branch information
syoyo committed May 8, 2024
1 parent 8a84582 commit 71068ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/ascii-parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ bool AsciiParser::ParseDictElement(std::string *out_key,
switch (tyid) {
APPLY_TO_METAVARIABLE_TYPE(PARSE_BASE_TYPE)
case value::TYPE_ID_STRING: {
// FIXME: Use std::string
if (array_qual) {
std::vector<value::StringData> strs;
if (!ParseBasicTypeArray(&strs)) {
Expand Down Expand Up @@ -4200,7 +4201,7 @@ bool AsciiParser::ParsePrimProps(std::map<std::string, Property> *props,
return false;
}
} else if (type_name == value::kString) {
if (!ParseBasicPrimAttr<value::StringData>(array_qual, primattr_name,
if (!ParseBasicPrimAttr<std::string>(array_qual, primattr_name,
pattr)) {
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions tests/usda/shader-primvarreader-001.usda
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

def Shader "TexCoordReader"
{
uniform token info:id = "UsdPrimvarReader_string"
uniform token info:id = "UsdPrimvarReader_float2"
# UsdPreviewSurface spec 2.3 changes type for varname from `token` to `string`.
string inputs:varname = "st"
string outputs:result
float2 outputs:result
}

0 comments on commit 71068ff

Please sign in to comment.