Support double type in MetaVariable.

This commit is contained in:
Syoyo Fujita
2022-11-14 17:43:44 +09:00
parent 02b8c8f537
commit 522ceb0b5e
2 changed files with 24 additions and 0 deletions

View File

@@ -735,6 +735,20 @@ bool AsciiParser::ParseDictElement(std::string *out_key,
}
var.set_value(val);
}
} else if (type_name == value::kDouble) {
if (array_qual) {
std::vector<double> vss;
if (!ParseBasicTypeArray(&vss)) {
PUSH_ERROR_AND_RETURN("Failed to parse `double[]`");
}
var.set_value(vss);
} else {
double str;
if (!ReadBasicType(&str)) {
PUSH_ERROR_AND_RETURN("Failed to parse `double`");
}
var.set_value(str);
}
} else if (type_name == value::kString) {
if (array_qual) {
std::vector<value::StringData> strs;

View File

@@ -0,0 +1,10 @@
#usda 1.0
(
doc = "Exporterd from TinyUSDZ v0.8.0rc1"
"Generated by TinyUSDZ api_tutorial."
customLayerData = {
double mycustom = 1.3
string mystring = "hello"
double myvalue = 2.45
}
)