Skip to content

Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.

Generate 3D: the label column fits the longest translated label; quad count wraps; translated-panel test switches languages reliably at 1x

islandmedc3a287018382
diff --git a/src/app/App.cpp b/src/app/App.cpp
index c51813b0..4288a3b6 100644
--- a/src/app/App.cpp
+++ b/src/app/App.cpp
@@ -3839,7 +3839,11 @@ void App::drawImageTo3D() {
ImGui::TextWrapped("%s", text);
ImGui::PopStyleColor();
};
- const float labelW = ImGui::CalcTextSize("Resolution").x + ImGui::GetStyle().ItemInnerSpacing.x;
+ // The label column fits this language's longest label ("ID del modelo", "Token de HF"), at most 40% of the panel.
+ float labelW = 0;
+ for (const char* l : {"Resolution", "Remesh", "Model", "Model id", "HF token", "API key", "Thickness", "Detail", "Depth"})
+ labelW = std::max(labelW, ImGui::CalcTextSize(tr(l)).x);
+ labelW = std::min(labelW, ImGui::GetContentRegionAvail().x * 0.4f) + ImGui::GetStyle().ItemInnerSpacing.x;
ImGui::SeparatorText(tr(textMode_ ? "Text to 3D (AI)" : "Full 3D model (AI reconstruction)"));
hint(tr(textMode_ ? "Builds a whole model from the description with a generative 3D model, then makes it sculptable."
@@ -3942,8 +3946,12 @@ void App::drawImageTo3D() {
"level holding the detail. Voxel remesh: an even, watertight triangle surface. Off: the "
"model as the service made it."));
if (generatedRemesh_ != int(GeneratedRemesh::Off)) ImGui::SliderInt(tr("Resolution"), &remeshResolution_, 96, 400);
- if (generatedRemesh_ == int(GeneratedRemesh::Quad))
- ImGui::TextDisabled(tr("About %d quads, then 1 subdivision level"), generatedQuadTarget(remeshResolution_));
+ if (generatedRemesh_ == int(GeneratedRemesh::Quad)) {
+ char quads[160];
+ std::snprintf(quads, sizeof quads, tr("About %d quads, then 1 subdivision level"),
+ generatedQuadTarget(remeshResolution_));
+ hint(quads);
+ }
}
ImGui::PopItemWidth();
if (pendingGenerator_.valid()) {
diff --git a/tests/ui/generate_3d_translated.sfui b/tests/ui/generate_3d_translated.sfui
index 234e1ab2..5ae578cf 100644
--- a/tests/ui/generate_3d_translated.sfui
+++ b/tests/ui/generate_3d_translated.sfui
@@ -3,10 +3,12 @@
# model names stay English. The ImGui labels the panel shows are all translated: i18n_raw_labels fails on any that
# skips tr(); this is the screen check, at 1x.
run ui_look look=classic layout=classic
+ui_scale 100
click "Preferences##palette.preferences"
click "Interface##preferences.interface"
click "简体中文##language.zh-CN"
-click "偏好设置##palette.preferences"
+wait 0.2
+key escape
drop ../../assets/demo/teddy-sketch.png
wait_for "生成 3D 模型" 5
expect_text 从图片
@@ -26,10 +28,11 @@ expect_no_text Describe one object
shot zh-cn-generate-text
click "从图片"
+# Interface is still open from above: a second click would close it.
click "偏好设置##palette.preferences"
-click "界面##preferences.interface"
click "Español##language.es"
-click "Preferencias##palette.preferences"
+wait 0.2
+key escape
wait 0.2
expect_text Desde imagen
expect_text Generar modelo 3D
@@ -39,5 +42,7 @@ shot es-generate-image
# Back to English for the next test.
click "Preferencias##palette.preferences"
-click "Interfaz##preferences.interface"
click "English##language.en"
+wait 0.2
+key escape
+ui_scale auto