mirror of
https://github.com/lighttransport/tinyusdz.git
synced 2026-01-18 01:11:17 +01:00
Add NodeGraph support and fix build errors
- Add NodeGraph template instantiation declarations in usdc-reader.cc and composition.cc - Fix shadow variable warning in tydra/render-data.cc (rename found_in_stage to found_current_in_stage) - Update value-types.hh with additional type IDs for OpenPBR support These changes fix compilation errors after the value-opt merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -73,6 +73,7 @@ RECONSTRUCT_PRIM_DECL(Skeleton);
|
||||
RECONSTRUCT_PRIM_DECL(BlendShape);
|
||||
RECONSTRUCT_PRIM_DECL(Material);
|
||||
RECONSTRUCT_PRIM_DECL(Shader);
|
||||
RECONSTRUCT_PRIM_DECL(NodeGraph);
|
||||
|
||||
#undef RECONSTRUCT_PRIM_DECL
|
||||
|
||||
|
||||
@@ -5289,10 +5289,10 @@ nonstd::expected<bool, std::string> GetConnectedMtlxTexture(
|
||||
const Prim *current_prim{nullptr};
|
||||
|
||||
// First, try regular stage lookup
|
||||
bool found_in_stage = stage.find_prim_at_path(Path(current_prim_part, ""), current_prim, &err);
|
||||
bool found_current_in_stage = stage.find_prim_at_path(Path(current_prim_part, ""), current_prim, &err);
|
||||
|
||||
// If not found and this is under a NodeGraph, look in NodeGraph children
|
||||
if (!found_in_stage || !current_prim) {
|
||||
if (!found_current_in_stage || !current_prim) {
|
||||
// Check if this path is under the NodeGraph we found earlier
|
||||
size_t last_slash = current_prim_part.rfind('/');
|
||||
if (last_slash != std::string::npos) {
|
||||
|
||||
@@ -103,6 +103,7 @@ RECONSTRUCT_PRIM_DECL(Skeleton);
|
||||
RECONSTRUCT_PRIM_DECL(BlendShape);
|
||||
RECONSTRUCT_PRIM_DECL(Material);
|
||||
RECONSTRUCT_PRIM_DECL(Shader);
|
||||
RECONSTRUCT_PRIM_DECL(NodeGraph);
|
||||
|
||||
#undef RECONSTRUCT_PRIM_DECL
|
||||
|
||||
|
||||
@@ -502,6 +502,8 @@ enum TypeId {
|
||||
|
||||
TYPE_ID_IMAGING_MTLX_PREVIEWSURFACE,
|
||||
TYPE_ID_IMAGING_MTLX_STANDARDSURFACE,
|
||||
TYPE_ID_IMAGING_MTLX_OPENPBRSURFACE,
|
||||
TYPE_ID_IMAGING_OPENPBR_SURFACE,
|
||||
|
||||
TYPE_ID_IMAGING_END,
|
||||
|
||||
@@ -525,6 +527,7 @@ enum TypeId {
|
||||
TYPE_ID_COLLECTION,
|
||||
TYPE_ID_COLLECTION_INSTANCE,
|
||||
TYPE_ID_MATERIAL_BINDING,
|
||||
TYPE_ID_MATERIALX_CONFIG_API,
|
||||
TYPE_ID_API_END,
|
||||
|
||||
// Base ID for user data type(less than `TYPE_ID_STL_ARRAY_BIT-1`)
|
||||
@@ -1809,6 +1812,7 @@ struct TypeTraits<TypedArray<T>> {
|
||||
static constexpr uint32_t array_bit() { return TYPE_ID_TYPED_ARRAY_BIT; }
|
||||
};
|
||||
|
||||
#if 0 // Disabled: ChunkedTypedArray causes redefinition error
|
||||
template <typename T>
|
||||
struct TypeTraits<ChunkedTypedArray<T>> {
|
||||
using value_type = TypedArray<T>;
|
||||
@@ -1830,6 +1834,7 @@ struct TypeTraits<ChunkedTypedArray<T>> {
|
||||
static constexpr bool is_array() { return true; }
|
||||
static constexpr uint32_t array_bit() { return TYPE_ID_TYPED_ARRAY_BIT; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#if 0 // Current pxrUSD does not support 2D array
|
||||
|
||||
Reference in New Issue
Block a user