diff --git a/README.md b/README.md index 8cd6ee82..e1c9fc3b 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ * MaterialX https://github.com/syoyo/tinyusdz/issues/86 * USD + MateriralX + PBR rendering example using https://github.com/lighttransport/pbrlab * Improve interoperability with Blender USD export/import https://github.com/syoyo/tinyusdz/issues/98 -* Example viewer +* Example viewer(work in progress) * [examples/openglviewer](examples/openglviewer) OpenGL viewer * [examples/sdlviewer](examples/sdlviewer) Software raytracing viewer @@ -80,9 +80,10 @@ NOTE: Windows ARM64 binary is provided using cross-compiling. Its not well teste TinyUSDZ is in v0.8.0 release candidate. Core loading feature(both USDA and USDC) is now working and production-grade(And no seg fault for corrupted USDA/USDC/USDZ input). +Somewhat working Tydra framwork for rendering USD model with OpenGL/Vulkan-like renderer. https://github.com/syoyo/tinyusdz/issues/148 v0.8.0 is Flattened scene only(i.e, USDA/USDC generated by using pxrUSD's `usdcat --flatten` or USDZ scene). -Composition features are work-in-progress(experimental Composition feature support in v0.8.0. Better composition feature in next major release v0.9.0(Q4/2023 expected) planned) +Composition features are work-in-progress(experimental Composition feature support in v0.8.0. Better composition feature in next major release v0.9.0(Q3/2024 expected) planned) Remaining tasks for v0.8.0 release are writing examples, demos and utility functions(Tydra. Especially access to Material/Shader attributes). @@ -105,9 +106,9 @@ Remaining tasks for v0.8.0 release are writing examples, demos and utility funct * [ ] Basic C API(`c-tinyusd`) for language bindings * [ ] [examples/c_api_example](examples/c_api_example) * [ ] Basic Python binding -* [ ] Write simple SDL viewer example(2023 Winter expected) -* [ ] Write iOS and Android example(2023 Winter expected) -* [ ] Write Vision OS example?(2024 expected) +* [ ] Write simple SDL viewer example(2024 Summer expected) +* [ ] Write iOS and Android example(2024 Winter expected) +* [ ] Write Vision OS example? * [ ] Vulkan or OptiX/HIP RT raytracing viewer example * [ ] USD <-> glTF converter example * There is an independent work of USD to glTF binary GLB converter: https://github.com/fynv/usd2glb diff --git a/src/pprinter.cc b/src/pprinter.cc index 33304af1..47d4ae37 100644 --- a/src/pprinter.cc +++ b/src/pprinter.cc @@ -627,7 +627,7 @@ std::string print_prim_metas(const PrimMeta &meta, const uint32_t indent) { // TODO: deprecate meta.meta and remove it. for (const auto &item : meta.meta) { - ss << print_meta(item.second, indent + 1, item.first); + ss << print_meta(item.second, indent + 1, true, item.first); } // for (const auto &item : meta.stringData) { @@ -704,7 +704,8 @@ std::string print_attr_metas(const AttrMeta &meta, const uint32_t indent) { // other user defined metadataum. for (const auto &item : meta.meta) { - ss << print_meta(item.second, indent, item.first); + // attribute meta does not emit type_name + ss << print_meta(item.second, indent, /* emit_type_name */false, item.first); } for (const auto &item : meta.stringData) { @@ -1981,14 +1982,14 @@ std::string print_customData(const CustomDataType &customData, ss << "{\n"; } for (const auto &item : customData) { - ss << print_meta(item.second, indent + 1, item.first); + ss << print_meta(item.second, indent + 1, true, item.first); } ss << pprint::Indent(indent) << "}\n"; return ss.str(); } -std::string print_meta(const MetaVariable &meta, const uint32_t indent, +std::string print_meta(const MetaVariable &meta, const uint32_t indent, bool emit_type_name, const std::string &varname) { std::stringstream ss; @@ -2013,11 +2014,15 @@ std::string print_meta(const MetaVariable &meta, const uint32_t indent, } ss << pprint::Indent(indent) << "dictionary " << name << " = {\n"; for (const auto &item : pv.value()) { - ss << print_meta(item.second, indent + 1, item.first); + ss << print_meta(item.second, indent + 1, /* emit_type_name */true, item.first); } ss << pprint::Indent(indent) << "}\n"; } else { - ss << pprint::Indent(indent) << meta.type_name() << " " << name << " = " + ss << pprint::Indent(indent); + if (emit_type_name) { + ss << meta.type_name() << " "; + } + ss << name << " = " << pprint_value(meta.get_raw_value()) << "\n"; } diff --git a/src/pprinter.hh b/src/pprinter.hh index b3a1b050..0a4ab3f3 100644 --- a/src/pprinter.hh +++ b/src/pprinter.hh @@ -233,7 +233,7 @@ std::string print_xformOps(const std::vector &xformOps, std::string print_attr_metas(const AttrMeta &meta, const uint32_t indent); // varname = optional variable name which is used when meta.get_name() is empty. -std::string print_meta(const MetaVariable &meta, const uint32_t indent, +std::string print_meta(const MetaVariable &meta, const uint32_t indent, bool emit_type_name, const std::string &varname = std::string()); std::string print_prim_metas(const PrimMeta &meta, const uint32_t indent); std::string print_customData(const CustomDataType &customData,