Skip to content
Snippets Groups Projects
Commit b17d9020 authored by Arch de Noé's avatar Arch de Noé
Browse files

fix: small UX improvments

parent 82b44b23
Branches
No related merge requests found
......@@ -25,11 +25,11 @@ void MorphistViewer::process_imgui()
ImGui::BeginDisabled(this->is_baking);
char const *file_patterns[3] = {"*.obj", "*.off", "*.stl"};
if (ImGui::Button("Open mesh 1"))
if (ImGui::Button("Select mesh A"))
{
this->is_mesh_baked = false;
char *result = tinyfd_openFileDialog("Selectect Mesh", ".", 3, file_patterns, "3D Objects", false);
char *result = tinyfd_openFileDialog("Select mesh B", ".", 3, file_patterns, "3D Objects", false);
if (result)
{
this->mesh1_path = result;
......@@ -39,9 +39,9 @@ void MorphistViewer::process_imgui()
ImGui::Spacing();
if (ImGui::Button("Open mesh 2"))
if (ImGui::Button("Select mesh B"))
{
char *result = tinyfd_openFileDialog("Selectect Mesh", ".", 3, file_patterns, "3D Objects", false);
char *result = tinyfd_openFileDialog("Select mesh B", ".", 3, file_patterns, "3D Objects", false);
if (result)
{
this->mesh2_path = result;
......@@ -50,25 +50,22 @@ void MorphistViewer::process_imgui()
ImGui::Text("%s", this->mesh2_path.filename().c_str());
ImGui::EndDisabled();
ImGui::Dummy(ImVec2(0.0f, 10.0f));
ImGui::SeparatorText("Pre-Compute");
ImGui::BeginDisabled(this->is_baking);
ImGui::Spacing();
if(ImGui::InputInt("Resolution", &this->bake_resolution, 1))
if (ImGui::InputInt("Resolution", &this->bake_resolution, 1))
{
this->bake_resolution = std::max(16, this->bake_resolution);
}
if (ImGui::Button("Bake"))
// Bake the meshes
if (this->is_baking)
{
this->is_baking = true;
morpher.load_mesh(mesh1_path, mesh2_path);
morpher.compute_sdf(this->bake_resolution);
this->is_baking = false;
......@@ -84,18 +81,15 @@ void MorphistViewer::process_imgui()
update_mesh();
}
ImGui::EndDisabled();
if (this->is_baking)
if (ImGui::Button("Bake"))
{
if (ImGui::Button("X"))
{
this->is_baking = false;
}
this->is_baking = true;
ImGui::SameLine();
ImGui::Text("Cooking... %c", "|/-\\"[(int)(ImGui::GetTime() / 0.1f) & 3]);
ImGui::Text("Cooking delicious morph...");
}
ImGui::EndDisabled();
ImGui::BeginDisabled(!this->is_mesh_baked);
ImGui::SeparatorText("Morphing");
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment