diff --git a/src/libguc/src/converter.cpp b/src/libguc/src/converter.cpp index acb3fc2..57f7933 100644 --- a/src/libguc/src/converter.cpp +++ b/src/libguc/src/converter.cpp @@ -292,6 +292,11 @@ namespace guc } // Step 4: create scene graph (nodes, meshes, lights, cameras, ...) + if (m_data->skins_count > 0) + { + UsdGeomScope::Define(m_stage, getEntryPath(EntryPathType::Skins)); + } + auto createNodes = [this](const cgltf_node* nodeData, SdfPath path) { std::string baseName(nodeData->name ? nodeData->name : "node"); @@ -700,7 +705,6 @@ namespace guc auto root = UsdSkelRoot::Define(m_stage, path); UsdPrim prim = root.GetPrim(); - auto skelApi = UsdSkelBindingAPI::Apply(prim); // TODO: create and link skeleton (TODO: lazy/global or not?) diff --git a/src/libguc/src/naming.cpp b/src/libguc/src/naming.cpp index cf0c70f..011e550 100644 --- a/src/libguc/src/naming.cpp +++ b/src/libguc/src/naming.cpp @@ -21,13 +21,14 @@ #include #include +#include namespace fs = std::filesystem; namespace mx = MaterialX; namespace guc { - static const SdfPath s_entryPaths[] = { + static const std::array s_entryPaths = { SdfPath{ "/Asset" }, SdfPath{ "/Asset/Scenes" }, SdfPath{ "/Asset/Nodes" }, @@ -36,9 +37,9 @@ namespace guc SdfPath{ "/Asset/Materials/MaterialX" }, SdfPath{ "/Asset/Meshes" }, SdfPath{ "/Asset/Cameras" }, - SdfPath{ "/Asset/Lights" } + SdfPath{ "/Asset/Lights" }, + SdfPath{ "/Asset/Skins" } }; - static_assert(sizeof(s_entryPaths) / sizeof(s_entryPaths[0]) == size_t(EntryPathType::ENUM_SIZE)); const SdfPath& getEntryPath(EntryPathType type) { @@ -97,6 +98,7 @@ namespace guc return name + std::to_string(index); } + // TODO: use Mtlx helper function? const static std::unordered_set MTLX_TYPE_NAME_SET = { /* Basic data types */ "integer", "boolean", "float", "color3", "color4", "vector2", "vector3", diff --git a/src/libguc/src/naming.h b/src/libguc/src/naming.h index 80613ab..c4943d2 100644 --- a/src/libguc/src/naming.h +++ b/src/libguc/src/naming.h @@ -35,6 +35,7 @@ namespace guc Meshes, Cameras, Lights, + Skins, ENUM_SIZE }; const SdfPath& getEntryPath(EntryPathType type);