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:
Syoyo Fujita
2025-11-14 01:46:45 +09:00
parent 1fa977302f
commit 8eee4b4a41
4 changed files with 9 additions and 2 deletions

View File

@@ -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

View File

@@ -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) {

View File

@@ -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

View File

@@ -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