Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
pablode committed Jul 19, 2024
1 parent 4119bd8 commit 7c828d5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/libguc/src/converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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?)
Expand Down
8 changes: 5 additions & 3 deletions src/libguc/src/naming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@
#include <MaterialXFormat/Util.h>

#include <filesystem>
#include <array>

namespace fs = std::filesystem;
namespace mx = MaterialX;

namespace guc
{
static const SdfPath s_entryPaths[] = {
static const std::array<SdfPath, size_t(EntryPathType::ENUM_SIZE)> s_entryPaths = {
SdfPath{ "/Asset" },
SdfPath{ "/Asset/Scenes" },
SdfPath{ "/Asset/Nodes" },
Expand All @@ -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)
{
Expand Down Expand Up @@ -97,6 +98,7 @@ namespace guc
return name + std::to_string(index);
}

// TODO: use Mtlx helper function?
const static std::unordered_set<std::string> MTLX_TYPE_NAME_SET = {
/* Basic data types */
"integer", "boolean", "float", "color3", "color4", "vector2", "vector3",
Expand Down
1 change: 1 addition & 0 deletions src/libguc/src/naming.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ namespace guc
Meshes,
Cameras,
Lights,
Skins,
ENUM_SIZE
};
const SdfPath& getEntryPath(EntryPathType type);
Expand Down

0 comments on commit 7c828d5

Please sign in to comment.