gltf_baker now has an export modal.

This commit is contained in:
Philip Rideout
2019-05-23 13:07:57 -07:00
parent d3753ca463
commit 5bdbf63ff6

View File

@@ -93,6 +93,7 @@ struct App {
AppState pushedState;
gltfio::AssetPipeline* pipeline;
uint32_t bakeResolution = 1024;
bool preserveMaterialsForExport = true;
// Secondary threads might write to the following fields.
std::shared_ptr<std::string> statusText;
@@ -626,8 +627,8 @@ int main(int argc, char** argv) {
// Export action
const bool canExport = app.state == BAKED;
ImGui::PushStyleColor(ImGuiCol_Text, canExport ? enabled : disabled);
if (ImGui::Button("Export", ImVec2(100, 50)) && canExport) {
exportAsset(app);
if (ImGui::Button("Export...", ImVec2(100, 50)) && canExport) {
ImGui::OpenPopup("Export options");
}
if (ImGui::IsItemHovered()) {
ImGui::SetTooltip("Saves the baked result to disk.");
@@ -678,6 +679,16 @@ int main(int argc, char** argv) {
}
ImGui::PopStyleVar();
}
if (ImGui::BeginPopupModal("Export options", nullptr,
ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar)) {
ImGui::Checkbox("Preserve materials", &app.preserveMaterialsForExport);
if (ImGui::Button("OK", ImVec2(120,0))) {
ImGui::CloseCurrentPopup();
exportAsset(app);
}
ImGui::EndPopup();
}
});
// Leave FXAA enabled but we also enable MSAA for a nice result. The wireframe looks