added material editing in mesh panel. Renamed mesh component to model component.

This commit is contained in:
a.pilote
2022-07-17 14:15:11 -04:00
parent dbec248d8a
commit 5fb1e376c2
13 changed files with 298 additions and 28 deletions

View File

@@ -1,5 +1,6 @@
#include "ModelResourceInspector.h"
#include <imgui/imgui.h>
#include "MaterialEditor.h"
ModelResourceInspector::ModelResourceInspector(Ref<Nuake::Model> model)
{
@@ -8,16 +9,23 @@ ModelResourceInspector::ModelResourceInspector(Ref<Nuake::Model> model)
void ModelResourceInspector::Draw()
{
ImGui::BeginChild("modelInspector",ImVec2(0,0), true);
ImGui::BeginChild("modelInspector", ImVec2(0, 0), true);
{
for (uint32_t i = 0; i < std::size(_model->GetMeshes()); i++)
{
std::string headerLabel = "Mesh " + std::to_string(i);
if (ImGui::CollapsingHeader(headerLabel.c_str()))
{
std::string childId = "materialEditor" + std::to_string(i);
ImGui::BeginChild(childId.c_str(), ImVec2(0, 0), false);
{
MaterialEditor editor;
editor.Draw(_model->GetMeshes().at(i)->GetMaterial());
}
ImGui::EndChild();
}
}
}
ImGui::EndChild();
}