Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct mesh Vertex/SurfaceAttributes && Polygon/Material mappings #281

Merged
merged 2 commits into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions examples/VerifyData/CDToRenderData/Main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#include "CDProducer.h"
#include "Framework/Processor.h"
#include "Scene/SceneDatabase.h"
#include "Utilities/MeshUtils.hpp"
#include "Utilities/PerformanceProfiler.h"

int main(int argc, char** argv)
{
// argv[0] : exe name
// argv[1] : input file path
if (argc != 2)
{
return 1;
}

using namespace cdtools;

PerformanceProfiler profiler("AssetPipeline");

const char* pInputFilePath = argv[1];

auto pSceneDatabase = std::make_unique<cd::SceneDatabase>();
CDProducer producer(pInputFilePath);
Processor processor(&producer, nullptr, pSceneDatabase.get());
processor.Run();

for (const auto& mesh : pSceneDatabase->GetMeshes())
{
auto vb = cd::BuildVertexBufferForStaticMesh(mesh, mesh.GetVertexFormat());
assert(vb.has_value());

auto ibs = cd::BuildIndexBufferesForMesh(mesh);
for (const auto& ib : ibs)
{
assert(ib.has_value());
}
}

return 0;
}
15 changes: 15 additions & 0 deletions private/Consumers/FbxConsumer/FbxConsumer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,19 @@ void FbxConsumer::Execute(const cd::SceneDatabase* pSceneDatabase)
m_pFbxConsumerImpl->Execute(pSceneDatabase);
}

void FbxConsumer::EnableOption(FbxConsumerOptions option)
{
m_pFbxConsumerImpl->GetOptions().Enable(option);
}

void FbxConsumer::DisableOption(FbxConsumerOptions option)
{
m_pFbxConsumerImpl->GetOptions().Disable(option);
}

bool FbxConsumer::IsOptionEnabled(FbxConsumerOptions option) const
{
return m_pFbxConsumerImpl->GetOptions().IsEnabled(option);
}

}
Loading