Skip to content

SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.

Bring back the view-change glide; orbit, pan and zoom stay instant (#4596)

bherbruck920398ac539d
diff --git a/assets/locales/cs.json b/assets/locales/cs.json
index ad5a50c047..8933c00fc9 100644
--- a/assets/locales/cs.json
+++ b/assets/locales/cs.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Úhel",
"ui.angle_decimals": "Desetinná místa úhlu",
"ui.animateJoint": "Animovat kloub",
+ "ui.animate_view_changes": "Animovat změny pohledu",
"ui.animation": "Animace",
+ "ui.animation_speed": "Rychlost animace",
"ui.anti_aliasing": "Vyhlazování hran",
"ui.apply": "Použít",
"ui.arc": "Oblouk",
@@ -1555,6 +1557,7 @@
"ui.lock": "Zamknout",
"ui.loft": "Spojení profilů",
"ui.look_at": "Pohled kolmo",
+ "ui.look_at_anim_desc": "Pohled podél osy, pohled kolmo, výchozí pohled a přizpůsobení",
"ui.manipulator_free_alt": "Volné tažení manipulátorem také s Alt/Option",
"ui.manipulator_free_alt_tip": "Zapnuto: Alt/Option nebo Ctrl/Cmd na šipkách vysunutí / manipulátoru vypne přichytávání hodnot. Vypnuto: pouze Ctrl/Cmd.",
"ui.manufacture": "Výroba",
diff --git a/assets/locales/da.json b/assets/locales/da.json
index 9f15c48990..3117b6b445 100644
--- a/assets/locales/da.json
+++ b/assets/locales/da.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Vinkel",
"ui.angle_decimals": "Vinkeldecimaler",
"ui.animateJoint": "Animér led",
+ "ui.animate_view_changes": "Animér visningsskift",
"ui.animation": "Animation",
+ "ui.animation_speed": "Animationshastighed",
"ui.anti_aliasing": "Kantudjævning",
"ui.apply": "Anvend",
"ui.arc": "Bue",
@@ -1555,6 +1557,7 @@
"ui.lock": "Lås",
"ui.loft": "Loft",
"ui.look_at": "Se på",
+ "ui.look_at_anim_desc": "Aksevisning, Se på, Hjem og Tilpas",
"ui.manipulator_free_alt": "Brug også Alt/Option til at trække frit",
"ui.manipulator_free_alt_tip": "Slået til: Hold Alt/Option eller Ctrl/Cmd nede, mens du trækker i pilene ved ekstrudering eller flytning, for at undgå faste værditrin. Slået fra: Kun Ctrl/Cmd.",
"ui.manufacture": "Fremstilling",
diff --git a/assets/locales/de.json b/assets/locales/de.json
index 4ee9d6a50a..258e427bda 100644
--- a/assets/locales/de.json
+++ b/assets/locales/de.json
@@ -1292,7 +1292,9 @@
"ui.angle": "Winkel",
"ui.angle_decimals": "Winkel-Dezimalstellen",
"ui.animateJoint": "Gelenk animieren",
+ "ui.animate_view_changes": "Ansichtsänderungen animieren",
"ui.animation": "Animation",
+ "ui.animation_speed": "Animationsgeschwindigkeit",
"ui.anti_aliasing": "Kantenglättung",
"ui.apply": "Anwenden",
"ui.arc": "Kreisbogen",
@@ -1559,6 +1561,7 @@
"ui.lock": "Sperren",
"ui.loft": "Loft",
"ui.look_at": "Ansehen",
+ "ui.look_at_anim_desc": "Achsenansicht, Ansehen, Home und Einpassen",
"ui.manipulator_free_alt": "Freies Ziehen des Manipulators auch mit Alt/Option",
"ui.manipulator_free_alt_tip": "An: Alt/Option oder Strg/Cmd auf Extrusions-/Gizmo-Pfeilen deaktiviert das Einrasten von Werten. Aus: nur Strg/Cmd.",
"ui.manufacture": "Fertigung",
diff --git a/assets/locales/en.json b/assets/locales/en.json
index 9b22c4e7ce..61b14e8907 100644
--- a/assets/locales/en.json
+++ b/assets/locales/en.json
@@ -1324,7 +1324,9 @@
"ui.angle": "Angle",
"ui.angle_decimals": "Angle decimals",
"ui.animateJoint": "Animate Joint",
+ "ui.animate_view_changes": "Animate view changes",
"ui.animation": "Animation",
+ "ui.animation_speed": "Animation speed",
"ui.anti_aliasing": "Anti-aliasing",
"ui.apply": "Apply",
"ui.arc": "Arc",
@@ -1598,6 +1600,7 @@
"ui.lock": "Lock",
"ui.loft": "Loft",
"ui.look_at": "Look At",
+ "ui.look_at_anim_desc": "Axis view, Look At, Home and Fit",
"ui.manipulator_free_alt": "Manipulator free drag also on Alt/Option",
"ui.manipulator_free_alt_tip": "On: Alt/Option or Ctrl/Cmd on extrude / gizmo arrows disables value snapping. Off: Ctrl/Cmd only.",
"ui.manufacture": "Manufacture",
diff --git a/assets/locales/es.json b/assets/locales/es.json
index 938aa72f62..366165d7f3 100644
--- a/assets/locales/es.json
+++ b/assets/locales/es.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Ángulo",
"ui.angle_decimals": "Decimales de ángulo",
"ui.animateJoint": "Animar unión",
+ "ui.animate_view_changes": "Animar cambios de vista",
"ui.animation": "Animación",
+ "ui.animation_speed": "Velocidad de animación",
"ui.anti_aliasing": "Suavizado de bordes",
"ui.apply": "Aplicar",
"ui.arc": "Arco",
@@ -1555,6 +1557,7 @@
"ui.lock": "Bloquear",
"ui.loft": "Solevación",
"ui.look_at": "Mirar hacia",
+ "ui.look_at_anim_desc": "Vista de eje, Mirar hacia, Inicio y Ajustar",
"ui.manipulator_free_alt": "Arrastre libre del manipulador también con Alt/Option",
"ui.manipulator_free_alt_tip": "Activado: Alt/Option o Ctrl/Cmd sobre las flechas de extrusión / manipulador desactiva el ajuste de valores. Desactivado: solo Ctrl/Cmd.",
"ui.manufacture": "Fabricación",
diff --git a/assets/locales/fr.json b/assets/locales/fr.json
index 27318a26c2..79008268e7 100644
--- a/assets/locales/fr.json
+++ b/assets/locales/fr.json
@@ -1294,7 +1294,9 @@
"ui.angle": "Angle",
"ui.angle_decimals": "Décimales des angles",
"ui.animateJoint": "Animer la liaison",
+ "ui.animate_view_changes": "Animer les changements de vue",
"ui.animation": "Animation",
+ "ui.animation_speed": "Vitesse d'animation",
"ui.anti_aliasing": "Anticrénelage",
"ui.apply": "Appliquer",
"ui.arc": "Arc",
@@ -1561,6 +1563,7 @@
"ui.lock": "Verrouiller",
"ui.loft": "Lissage",
"ui.look_at": "Vue normale",
+ "ui.look_at_anim_desc": "Vue d'axe, Vue normale, Accueil et Cadrer",
"ui.manipulator_free_alt": "Glissement libre du manipulateur aussi avec Alt/Option",
"ui.manipulator_free_alt_tip": "Activé : Alt/Option ou Ctrl/Cmd sur les flèches d’extrusion / du manipulateur désactive l’accrochage aux valeurs. Désactivé : Ctrl/Cmd uniquement.",
"ui.manufacture": "Fabrication",
diff --git a/assets/locales/gl.json b/assets/locales/gl.json
index 3af7f3cd22..39fc3c8c4e 100644
--- a/assets/locales/gl.json
+++ b/assets/locales/gl.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Ángulo",
"ui.angle_decimals": "Decimais dos ángulos",
"ui.animateJoint": "Animar a unión",
+ "ui.animate_view_changes": "Animar os cambios de vista",
"ui.animation": "Animación",
+ "ui.animation_speed": "Velocidade da animación",
"ui.anti_aliasing": "Antialiasing",
"ui.apply": "Aplicar",
"ui.arc": "Arco",
@@ -1555,6 +1557,7 @@
"ui.lock": "Bloquear",
"ui.loft": "Transición",
"ui.look_at": "Mirar cara a",
+ "ui.look_at_anim_desc": "Vista de eixe, Mirar cara a, Inicio e Axustar",
"ui.manipulator_free_alt": "Arrastre libre do manipulador tamén con Alt/Option",
"ui.manipulator_free_alt_tip": "Activado: Alt/Option ou Ctrl/Cmd nas frechas de extrusión / do gizmo desactiva o axuste de valores. Desactivado: só Ctrl/Cmd.",
"ui.manufacture": "Fabricación",
diff --git a/assets/locales/hu.json b/assets/locales/hu.json
index bd712ad811..9c56b32422 100644
--- a/assets/locales/hu.json
+++ b/assets/locales/hu.json
@@ -1287,7 +1287,9 @@
"ui.angle": "Szög",
"ui.angle_decimals": "Szög tizedesjegyei",
"ui.animateJoint": "Csukló animálása",
+ "ui.animate_view_changes": "Nézetváltozások animálása",
"ui.animation": "Animáció",
+ "ui.animation_speed": "Animáció sebessége",
"ui.anti_aliasing": "Élsimítás",
"ui.apply": "Alkalmaz",
"ui.arc": "Ív",
@@ -1554,6 +1556,7 @@
"ui.lock": "Zárolás",
"ui.loft": "Áthúzás",
"ui.look_at": "Ránézés",
+ "ui.look_at_anim_desc": "Tengelynézet, Ránézés, Kezdőlap és Illesztés",
"ui.manipulator_free_alt": "A manipulátor szabad húzása Alt/Option billentyűvel is",
"ui.manipulator_free_alt_tip": "Be: az Alt/Option vagy Ctrl/Cmd a kihúzás / gizmo nyilakon letiltja az értékillesztést. Ki: csak a Ctrl/Cmd.",
"ui.manufacture": "Gyártás",
diff --git a/assets/locales/id.json b/assets/locales/id.json
index 46e1ca73e4..0e9039f4c9 100644
--- a/assets/locales/id.json
+++ b/assets/locales/id.json
@@ -1287,7 +1287,9 @@
"ui.angle": "Sudut",
"ui.angle_decimals": "Desimal sudut",
"ui.animateJoint": "Animasikan Sambungan",
+ "ui.animate_view_changes": "Animasikan perubahan tampilan",
"ui.animation": "Animasi",
+ "ui.animation_speed": "Kecepatan animasi",
"ui.anti_aliasing": "Anti-aliasing",
"ui.apply": "Terapkan",
"ui.arc": "Busur",
@@ -1554,6 +1556,7 @@
"ui.lock": "Kunci",
"ui.loft": "Loft",
"ui.look_at": "Look At",
+ "ui.look_at_anim_desc": "Tampilan sumbu, Look At, Home, dan Fit",
"ui.manipulator_free_alt": "Seret bebas manipulator juga dengan Alt/Option",
"ui.manipulator_free_alt_tip": "Aktif: Alt/Option atau Ctrl/Cmd pada panah ekstrusi / gizmo menonaktifkan snap nilai. Mati: hanya Ctrl/Cmd.",
"ui.manufacture": "Manufaktur",
diff --git a/assets/locales/it.json b/assets/locales/it.json
index 854570f346..5d18bc1772 100644
--- a/assets/locales/it.json
+++ b/assets/locales/it.json
@@ -1291,7 +1291,9 @@
"ui.angle": "Angolo",
"ui.angle_decimals": "Decimali degli angoli",
"ui.animateJoint": "Anima giunto",
+ "ui.animate_view_changes": "Anima cambi di vista",
"ui.animation": "Animazione",
+ "ui.animation_speed": "Velocità dell'animazione",
"ui.anti_aliasing": "Antialiasing",
"ui.apply": "Applica",
"ui.arc": "Arco",
@@ -1558,6 +1560,7 @@
"ui.lock": "Blocca",
"ui.loft": "Loft",
"ui.look_at": "Vista normale",
+ "ui.look_at_anim_desc": "Viste degli assi, Vista normale, Vista iniziale e Adatta",
"ui.manipulator_free_alt": "Trascinamento libero del manipolatore anche con Alt/Option",
"ui.manipulator_free_alt_tip": "Attivo: Alt/Option o Ctrl/Cmd sulle frecce di estrusione / gizmo disattivano l'aggancio ai valori. Disattivo: solo Ctrl/Cmd.",
"ui.manufacture": "Produzione",
diff --git a/assets/locales/ja.json b/assets/locales/ja.json
index 868a0d4e7b..a089aa8ebb 100644
--- a/assets/locales/ja.json
+++ b/assets/locales/ja.json
@@ -1324,7 +1324,9 @@
"ui.angle": "角度",
"ui.angle_decimals": "角度の小数点以下の桁数",
"ui.animateJoint": "ジョイントをアニメート",
+ "ui.animate_view_changes": "視点変更をアニメーション表示",
"ui.animation": "アニメーション",
+ "ui.animation_speed": "アニメーション速度",
"ui.anti_aliasing": "アンチエイリアス",
"ui.apply": "適用",
"ui.arc": "円弧",
@@ -1598,6 +1600,7 @@
"ui.lock": "ロック",
"ui.loft": "ロフト",
"ui.look_at": "正面視",
+ "ui.look_at_anim_desc": "軸ビュー、正面視、ホーム、全体表示",
"ui.manipulator_free_alt": "マニピュレータのフリードラッグを Alt/Option でも有効",
"ui.manipulator_free_alt_tip": "オン: 押し出し/ギズモ矢印で Alt/Option または Ctrl/Cmd が値スナップを無効にします。オフ: Ctrl/Cmd のみ。",
"ui.manufacture": "製造",
diff --git a/assets/locales/ko.json b/assets/locales/ko.json
index 8a80675f7c..b08c59f345 100644
--- a/assets/locales/ko.json
+++ b/assets/locales/ko.json
@@ -1292,7 +1292,9 @@
"ui.angle": "각도",
"ui.angle_decimals": "각도 소수점 자릿수",
"ui.animateJoint": "조인트 애니메이션",
+ "ui.animate_view_changes": "뷰 변경 애니메이션",
"ui.animation": "애니메이션",
+ "ui.animation_speed": "애니메이션 속도",
"ui.anti_aliasing": "안티앨리어싱",
"ui.apply": "적용",
"ui.arc": "호",
@@ -1559,6 +1561,7 @@
"ui.lock": "잠금",
"ui.loft": "로프트",
"ui.look_at": "바라보기",
+ "ui.look_at_anim_desc": "축 뷰, 보기, 홈 및 맞춤",
"ui.manipulator_free_alt": "Alt/Option으로도 매니퓰레이터 자유 드래그",
"ui.manipulator_free_alt_tip": "켬: 돌출 / 기즈모 화살표에서 Alt/Option 또는 Ctrl/Cmd를 누르면 값 스냅이 해제됩니다. 끔: Ctrl/Cmd만 해당.",
"ui.manufacture": "제조",
diff --git a/assets/locales/ms.json b/assets/locales/ms.json
index a299a44a84..ea47d78cdf 100644
--- a/assets/locales/ms.json
+++ b/assets/locales/ms.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Sudut",
"ui.angle_decimals": "Perpuluhan sudut",
"ui.animateJoint": "Animasikan Sendi",
+ "ui.animate_view_changes": "Animasikan perubahan pandangan",
"ui.animation": "Animasi",
+ "ui.animation_speed": "Kelajuan animasi",
"ui.anti_aliasing": "Antialias",
"ui.apply": "Gunakan",
"ui.arc": "Lengkok",
@@ -1555,6 +1557,7 @@
"ui.lock": "Kunci",
"ui.loft": "Loft",
"ui.look_at": "Pandang Tepat",
+ "ui.look_at_anim_desc": "Pandangan paksi, Pandang Tepat, Utama dan Muatkan",
"ui.manipulator_free_alt": "Seret bebas manipulator juga dengan Alt/Option",
"ui.manipulator_free_alt_tip": "Hidup: Alt/Option atau Ctrl/Cmd pada anak panah ekstrud / gizmo mematikan pelekapan nilai. Mati: Ctrl/Cmd sahaja.",
"ui.manufacture": "Pembuatan",
diff --git a/assets/locales/nl.json b/assets/locales/nl.json
index cbb087dbbb..a61476c96f 100644
--- a/assets/locales/nl.json
+++ b/assets/locales/nl.json
@@ -1287,7 +1287,9 @@
"ui.angle": "Hoek",
"ui.angle_decimals": "Hoekdecimalen",
"ui.animateJoint": "Verbinding animeren",
+ "ui.animate_view_changes": "Weergavewijzigingen animeren",
"ui.animation": "Animatie",
+ "ui.animation_speed": "Animatiesnelheid",
"ui.anti_aliasing": "Anti-aliasing",
"ui.apply": "Toepassen",
"ui.arc": "Boog",
@@ -1554,6 +1556,7 @@
"ui.lock": "Vergrendelen",
"ui.loft": "Loft",
"ui.look_at": "Kijken naar",
+ "ui.look_at_anim_desc": "Aanzicht op as, Kijken naar, Home en Passend",
"ui.manipulator_free_alt": "Manipulator vrij slepen ook met Alt/Option",
"ui.manipulator_free_alt_tip": "Aan: Alt/Option of Ctrl/Cmd op extrusie-/gizmopijlen schakelt waardesnap uit. Uit: alleen Ctrl/Cmd.",
"ui.manufacture": "Fabricage",
diff --git a/assets/locales/pl.json b/assets/locales/pl.json
index ce10bfb735..4ca63d1205 100644
--- a/assets/locales/pl.json
+++ b/assets/locales/pl.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Kąt",
"ui.angle_decimals": "Miejsca dziesiętne kąta",
"ui.animateJoint": "Animuj złącze",
+ "ui.animate_view_changes": "Animuj zmiany widoku",
"ui.animation": "Animacja",
+ "ui.animation_speed": "Szybkość animacji",
"ui.anti_aliasing": "Wygładzanie krawędzi",
"ui.apply": "Zastosuj",
"ui.arc": "Łuk",
@@ -1555,6 +1557,7 @@
"ui.lock": "Zablokuj",
"ui.loft": "Wyciągnięcie złożone",
"ui.look_at": "Patrz na",
+ "ui.look_at_anim_desc": "Widok osi, Patrz na, Widok główny i Dopasuj",
"ui.manipulator_free_alt": "Swobodne przeciąganie manipulatora także z Alt/Option",
"ui.manipulator_free_alt_tip": "Wł.: Alt/Option lub Ctrl/Cmd na strzałkach wyciągnięcia / uchwytu wyłącza przyciąganie wartości. Wył.: tylko Ctrl/Cmd.",
"ui.manufacture": "Wytwarzanie",
diff --git a/assets/locales/pt-BR.json b/assets/locales/pt-BR.json
index a50d420984..7953322334 100644
--- a/assets/locales/pt-BR.json
+++ b/assets/locales/pt-BR.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Ângulo",
"ui.angle_decimals": "Casas decimais de ângulo",
"ui.animateJoint": "Animar junta",
+ "ui.animate_view_changes": "Animar mudanças de vista",
"ui.animation": "Animação",
+ "ui.animation_speed": "Velocidade da animação",
"ui.anti_aliasing": "Antisserrilhamento",
"ui.apply": "Aplicar",
"ui.arc": "Arco",
@@ -1555,6 +1557,7 @@
"ui.lock": "Bloquear",
"ui.loft": "Loft",
"ui.look_at": "Olhar para",
+ "ui.look_at_anim_desc": "Vista do eixo, Olhar para, Início e Ajustar",
"ui.manipulator_free_alt": "Arrasto livre do manipulador também com Alt/Option",
"ui.manipulator_free_alt_tip": "Ativado: Alt/Option ou Ctrl/Cmd nas setas de extrusão / gizmo desativa o ajuste de valores. Desativado: somente Ctrl/Cmd.",
"ui.manufacture": "Fabricação",
diff --git a/assets/locales/ro.json b/assets/locales/ro.json
index 654e79cca6..e62ec4590c 100644
--- a/assets/locales/ro.json
+++ b/assets/locales/ro.json
@@ -1287,7 +1287,9 @@
"ui.angle": "Unghi",
"ui.angle_decimals": "Zecimale unghi",
"ui.animateJoint": "Animă îmbinarea",
+ "ui.animate_view_changes": "Animă schimbările de vizualizare",
"ui.animation": "Animație",
+ "ui.animation_speed": "Viteza animației",
"ui.anti_aliasing": "Anti-aliasing",
"ui.apply": "Aplică",
"ui.arc": "Arc",
@@ -1554,6 +1556,7 @@
"ui.lock": "Blochează",
"ui.loft": "Loft",
"ui.look_at": "Privește spre",
+ "ui.look_at_anim_desc": "Vizualizare pe axă, Privește spre, Acasă și Potrivire",
"ui.manipulator_free_alt": "Tragere liberă a manipulatorului și cu Alt/Option",
"ui.manipulator_free_alt_tip": "Activat: Alt/Option sau Ctrl/Cmd pe săgețile de extrudare / manipulator dezactivează agățarea la valori. Dezactivat: doar Ctrl/Cmd.",
"ui.manufacture": "Fabricație",
diff --git a/assets/locales/ru.json b/assets/locales/ru.json
index eed32d1cd1..bc45bb01d0 100644
--- a/assets/locales/ru.json
+++ b/assets/locales/ru.json
@@ -1287,7 +1287,9 @@
"ui.angle": "Угол",
"ui.angle_decimals": "Знаков после запятой (углы)",
"ui.animateJoint": "Анимировать сопряжение",
+ "ui.animate_view_changes": "Анимировать смену вида",
"ui.animation": "Анимация",
+ "ui.animation_speed": "Скорость анимации",
"ui.anti_aliasing": "Сглаживание",
"ui.apply": "Применить",
"ui.arc": "Дуга",
@@ -1554,6 +1556,7 @@
"ui.lock": "Заблокировать",
"ui.loft": "Лофт",
"ui.look_at": "Взгляд на",
+ "ui.look_at_anim_desc": "Осевые виды, «Взгляд на», «Главная» и «Вписать»",
"ui.manipulator_free_alt": "Свободное перетаскивание манипулятора также по Alt/Option",
"ui.manipulator_free_alt_tip": "Вкл.: Alt/Option или Ctrl/Cmd на стрелках выдавливания / гизмо отключают привязку значений. Выкл.: только Ctrl/Cmd.",
"ui.manufacture": "Производство",
diff --git a/assets/locales/sv.json b/assets/locales/sv.json
index ad7f24add5..1190c74632 100644
--- a/assets/locales/sv.json
+++ b/assets/locales/sv.json
@@ -1287,7 +1287,9 @@
"ui.angle": "Vinkel",
"ui.angle_decimals": "Vinkeldecimaler",
"ui.animateJoint": "Animera led",
+ "ui.animate_view_changes": "Animera vyändringar",
"ui.animation": "Animation",
+ "ui.animation_speed": "Animationshastighet",
"ui.anti_aliasing": "Kantutjämning",
"ui.apply": "Tillämpa",
"ui.arc": "Båge",
@@ -1554,6 +1556,7 @@
"ui.lock": "Lås",
"ui.loft": "Loftning",
"ui.look_at": "Titta på",
+ "ui.look_at_anim_desc": "Axelvy, Titta på, Hem och Anpassa",
"ui.manipulator_free_alt": "Fri manipulatordragning även med Alt/Option",
"ui.manipulator_free_alt_tip": "På: Alt/Option eller Ctrl/Cmd på extruderings-/gizmopilar inaktiverar värdesnappning. Av: endast Ctrl/Cmd.",
"ui.manufacture": "Tillverkning",
diff --git a/assets/locales/tr.json b/assets/locales/tr.json
index 2879a141ff..f4b549b4c8 100644
--- a/assets/locales/tr.json
+++ b/assets/locales/tr.json
@@ -1287,7 +1287,9 @@
"ui.angle": "Açı",
"ui.angle_decimals": "Açı ondalık basamakları",
"ui.animateJoint": "Bağlantıyı canlandır",
+ "ui.animate_view_changes": "Görünüm değişikliklerini animasyonla göster",
"ui.animation": "Animasyon",
+ "ui.animation_speed": "Animasyon hızı",
"ui.anti_aliasing": "Kenar yumuşatma",
"ui.apply": "Uygula",
"ui.arc": "Yay",
@@ -1554,6 +1556,7 @@
"ui.lock": "Kilitle",
"ui.loft": "Loft",
"ui.look_at": "Bak",
+ "ui.look_at_anim_desc": "Eksen görünümü, Bak, Başlangıç ve Sığdır",
"ui.manipulator_free_alt": "Manipülatör serbest sürükleme Alt/Option ile de",
"ui.manipulator_free_alt_tip": "Açık: ekstrüzyon / gizmo oklarında Alt/Option veya Ctrl/Cmd değer yakalamayı devre dışı bırakır. Kapalı: yalnızca Ctrl/Cmd.",
"ui.manufacture": "Üretim",
diff --git a/assets/locales/uk.json b/assets/locales/uk.json
index d7f2dacdd4..c22a70c772 100644
--- a/assets/locales/uk.json
+++ b/assets/locales/uk.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Кут",
"ui.angle_decimals": "Знаки після коми для кутів",
"ui.animateJoint": "Анімувати з'єднання",
+ "ui.animate_view_changes": "Анімувати зміни виду",
"ui.animation": "Анімація",
+ "ui.animation_speed": "Швидкість анімації",
"ui.anti_aliasing": "Згладжування",
"ui.apply": "Застосувати",
"ui.arc": "Дуга",
@@ -1555,6 +1557,7 @@
"ui.lock": "Заблокувати",
"ui.loft": "Лофт",
"ui.look_at": "Наведення",
+ "ui.look_at_anim_desc": "Вид осі, наведення, головний і вписування",
"ui.manipulator_free_alt": "Вільне перетягування маніпулятора також з Alt/Option",
"ui.manipulator_free_alt_tip": "Увімк.: Alt/Option або Ctrl/Cmd на стрілках видавлювання / гізмо вимикає прив'язку до значень. Вимк.: лише Ctrl/Cmd.",
"ui.manufacture": "Виготовлення",
diff --git a/assets/locales/vi.json b/assets/locales/vi.json
index b85d4d3e06..389258bfed 100644
--- a/assets/locales/vi.json
+++ b/assets/locales/vi.json
@@ -1288,7 +1288,9 @@
"ui.angle": "Góc",
"ui.angle_decimals": "Số chữ số thập phân cho góc",
"ui.animateJoint": "Mô phỏng chuyển động khớp nối",
+ "ui.animate_view_changes": "Hiệu ứng chuyển góc nhìn",
"ui.animation": "Hoạt họa",
+ "ui.animation_speed": "Tốc độ chuyển động",
"ui.anti_aliasing": "Khử răng cưa",
"ui.apply": "Áp dụng",
"ui.arc": "Cung tròn",
@@ -1555,6 +1557,7 @@
"ui.lock": "Khóa",
"ui.loft": "Vuốt nối biên dạng (Loft)",
"ui.look_at": "Nhìn trực diện",
+ "ui.look_at_anim_desc": "Góc nhìn theo trục, Nhìn thẳng, Chuẩn và Vừa vặn",
"ui.manipulator_free_alt": "Kéo tự do bộ thao tác cũng bằng Alt/Option",
"ui.manipulator_free_alt_tip": "Bật: Alt/Option hoặc Ctrl/Cmd trên các mũi tên đùn / gizmo sẽ tắt bước nhảy giá trị. Tắt: chỉ Ctrl/Cmd.",
"ui.manufacture": "Gia công chế tạo",
diff --git a/assets/locales/zh-TW.json b/assets/locales/zh-TW.json
index 2528f34172..938140f00a 100644
--- a/assets/locales/zh-TW.json
+++ b/assets/locales/zh-TW.json
@@ -1287,7 +1287,9 @@
"ui.angle": "角度",
"ui.angle_decimals": "角度小數位數",
"ui.animateJoint": "動畫接頭",
+ "ui.animate_view_changes": "檢視變化動畫",
"ui.animation": "動畫",
+ "ui.animation_speed": "動畫速度",
"ui.anti_aliasing": "抗鋸齒",
"ui.apply": "套用",
"ui.arc": "圓弧",
@@ -1554,6 +1556,7 @@
"ui.lock": "鎖定",
"ui.loft": "放樣",
"ui.look_at": "注視",
+ "ui.look_at_anim_desc": "軸檢視、注視、主檢視與適合視窗",
"ui.manipulator_free_alt": "操縱器自由拖曳也適用於 Alt/Option",
"ui.manipulator_free_alt_tip": "開:在擠出/小工具箭頭上按 Alt/Option 或 Ctrl/Cmd 可停用數值鎖點。關:僅 Ctrl/Cmd。",
"ui.manufacture": "製造",
diff --git a/assets/locales/zh.json b/assets/locales/zh.json
index 938f03cbd8..8e25bf27d2 100644
--- a/assets/locales/zh.json
+++ b/assets/locales/zh.json
@@ -1324,7 +1324,9 @@
"ui.angle": "角度",
"ui.angle_decimals": "角度小数位",
"ui.animateJoint": "动画接头",
+ "ui.animate_view_changes": "视图变化动画",
"ui.animation": "动画",
+ "ui.animation_speed": "动画速度",
"ui.anti_aliasing": "抗锯齿",
"ui.apply": "应用",
"ui.arc": "圆弧",
@@ -1598,6 +1600,7 @@
"ui.lock": "锁定",
"ui.loft": "放样",
"ui.look_at": "朝向",
+ "ui.look_at_anim_desc": "轴视图、注视、主视图与适合窗口",
"ui.manipulator_free_alt": "操纵器自由拖动也适用于 Alt/Option",
"ui.manipulator_free_alt_tip": "开:在拉伸/小控件箭头上按 Alt/Option 或 Ctrl/Cmd 可关闭数值捕捉。关:仅 Ctrl/Cmd。",
"ui.manufacture": "制造",
diff --git a/crates/render/src/camera.rs b/crates/render/src/camera.rs
index 704c44f070..9b1e366438 100644
--- a/crates/render/src/camera.rs
+++ b/crates/render/src/camera.rs
@@ -72,6 +72,13 @@ impl StandardView {
}
}
+/// Smooth ease-in-out on [0, 1] (smoothstep: at its fastest, mid-way, 1.5 times the average
+/// speed, so long turns stay gentle).
+pub fn ease_in_out(t: f64) -> f64 {
+ let t = if t.is_finite() { t.clamp(0.0, 1.0) } else { 1.0 };
+ t * t * (3.0 - 2.0 * t)
+}
+
/// A unit quaternion (w, x, y, z).
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Quat {
@@ -144,6 +151,36 @@ impl Quat {
}
}
+/// A camera move in progress: from one camera to another over `duration` seconds.
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct CameraAnim {
+ pub from: Camera,
+ pub to: Camera,
+ pub start: f64,
+ pub duration: f64,
+}
+
+impl CameraAnim {
+ /// The usual length of a view change, in seconds.
+ pub const DURATION: f64 = 0.5;
+ /// A view change: half a second, longer for turns past a quarter turn (so a big turn, such
+ /// as from the home view to the bottom, never sweeps more than about 9 degrees a frame).
+ pub fn new(from: Camera, to: Camera, now: f64) -> CameraAnim {
+ let dy = (to.yaw - from.yaw + std::f64::consts::PI).rem_euclid(std::f64::consts::TAU) - std::f64::consts::PI;
+ let turn = dy.abs().max((to.pitch - from.pitch).abs());
+ let k = if turn.is_finite() { (turn / std::f64::consts::FRAC_PI_2).clamp(1.0, 2.0) } else { 1.0 };
+ CameraAnim { from, to, start: now, duration: CameraAnim::DURATION * k }
+ }
+ /// The camera at time `now`, and whether the move has finished.
+ pub fn sample(&self, now: f64) -> (Camera, bool) {
+ let t = if self.duration > 0.0 { (now - self.start) / self.duration } else { 1.0 };
+ if !(t < 1.0) {
+ return (self.to, true);
+ }
+ (Camera::interpolate(&self.from, &self.to, ease_in_out(t)), false)
+ }
+}
+
/// Which world axis points up in the view (#3): Z (the default) or Y, as most STEP files from
/// other systems are modelled.
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
@@ -549,13 +586,29 @@ mod tests {
}
#[test]
- fn orientation_round_trips_and_looks_from_a_corner() {
+ fn view_animation_interpolates() {
let mut a = Camera { target: Vec3::new(1.0, 2.0, 3.0), distance: 80.0, ..Default::default() };
a.set_view(StandardView::Iso);
+ let mut b = Camera { target: Vec3::new(-5.0, 0.0, 10.0), distance: 120.0, ..Default::default() };
+ b.set_view(StandardView::Top);
+ let anim = CameraAnim::new(a, b, 10.0);
+ // Endpoints are exact.
+ assert_eq!(anim.sample(10.0).0, a);
+ assert_eq!(anim.sample(10.0 + anim.duration), (b, true));
+ assert_eq!(anim.sample(99.0), (b, true));
+ // Midpoint: half way in heading, elevation, target and distance.
+ let (m, done) = anim.sample(10.0 + anim.duration / 2.0);
+ assert!(!done && m.is_valid());
+ let dy = (b.yaw - a.yaw + std::f64::consts::PI).rem_euclid(std::f64::consts::TAU) - std::f64::consts::PI;
+ assert!((m.yaw - (a.yaw + dy / 2.0)).abs() < 1e-12 && (m.pitch - (a.pitch + b.pitch) / 2.0).abs() < 1e-12);
+ assert!(m.target.dist(Vec3::new(-2.0, 1.0, 6.5)) < 1e-9 && (m.distance - 100.0).abs() < 1e-9);
// Quaternion round trip of a basis.
let (r, u, bk) = a.basis();
let (r2, u2, b2) = a.orientation().basis();
assert!(r.dist(r2) < 1e-12 && u.dist(u2) < 1e-12 && bk.dist(b2) < 1e-12);
+ // Ease: fixed ends, symmetric, monotonic.
+ assert_eq!((ease_in_out(0.0), ease_in_out(1.0), ease_in_out(0.5)), (0.0, 1.0, 0.5));
+ assert!(ease_in_out(0.25) < 0.25 && ease_in_out(0.75) > 0.75);
// Looking from a corner direction.
let c = a.looking_from(Vec3::new(1.0, -1.0, 1.0));
assert!(c.back().dist(Vec3::new(1.0, -1.0, 1.0).normalized().unwrap()) < 1e-9);
@@ -590,6 +643,64 @@ mod tests {
assert!(c.is_valid());
}
+ /// A view change sampled every frame (60 fps) moves smoothly to the very end: no frame
+ /// turns the view, moves the target or changes the distance by much more than the average
+ /// step, and the last frame lands exactly on the target camera.
+ #[test]
+ fn view_animations_have_no_jumps() {
+ let base = Camera { target: Vec3::new(5.0, -3.0, 2.0), distance: 150.0, ..Default::default() };
+ let views = [
+ StandardView::Iso,
+ StandardView::Top,
+ StandardView::Front,
+ StandardView::Right,
+ StandardView::Bottom,
+ StandardView::Back,
+ StandardView::Left,
+ ];
+ let mut cams: Vec<Camera> = views
+ .iter()
+ .map(|v| {
+ let mut c = base;
+ c.set_view(*v);
+ c
+ })
+ .collect();
+ // Corners and edges of the axis view, and a fit (new target and distance).
+ cams.push(base.looking_from(Vec3::new(1.0, -1.0, 1.0)));
+ cams.push(base.looking_from(Vec3::new(-1.0, 0.0, 1.0)));
+ cams.push(base.looking_from(Vec3::new(0.0, 0.0, 1.0)));
+ cams.push(Camera { target: Vec3::new(-40.0, 10.0, 0.0), distance: 60.0, ..base });
+ for a in &cams {
+ for b in &cams {
+ let anim = CameraAnim::new(*a, *b, 0.0);
+ let frames = (anim.duration * 60.0).round() as usize;
+ let mut prev = anim.sample(0.0).0;
+ let (mut steps, mut done_at) = (Vec::new(), None);
+ for f in 1..=frames + 2 {
+ let (c, done) = anim.sample(f as f64 / 60.0);
+ let turn = c.back().dist(prev.back()) + c.basis().0.dist(prev.basis().0);
+ let moved =
+ c.target.dist(prev.target) / a.distance.max(b.distance) + (c.distance - prev.distance).abs() / a.distance.max(b.distance);
+ steps.push((f, turn, moved));
+ prev = c;
+ if done && done_at.is_none() {
+ done_at = Some(f);
+ assert_eq!(c, *b);
+ }
+ }
+ assert!(done_at.is_some_and(|f| f >= frames), "ended early at {done_at:?}");
+ let total_turn: f64 = steps.iter().map(|s| s.1).sum();
+ let total_move: f64 = steps.iter().map(|s| s.2).sum();
+ for (f, turn, moved) in &steps {
+ // The eased curve's fastest frame is 1.5x the average: allow 2x.
+ assert!(*turn <= 2.0 * total_turn / frames as f64 + 1e-9, "turn jump at frame {f}: {turn} of {total_turn} ({a:?} -> {b:?})");
+ assert!(*moved <= 2.0 * total_move / frames as f64 + 1e-9, "move jump at frame {f}: {moved} of {total_move}");
+ }
+ }
+ }
+ }
+
/// With Y up: the front view looks along −Z (eye on +Z), the top view looks down −Y with X
/// to the right, orbiting turns about Y, and the picture's up is the world's up.
#[test]
diff --git a/crates/render/src/lib.rs b/crates/render/src/lib.rs
index 640abfccd8..4f9e70be79 100644
--- a/crates/render/src/lib.rs
+++ b/crates/render/src/lib.rs
@@ -27,7 +27,7 @@ pub use backend::{
RenderMode, RenderOperation, RenderPolicy, RenderProfile, RenderRequest, ResolveError, ResolvedRequest, ScratchLayout, builtin_backend,
resolve_request,
};
-pub use camera::{Camera, Mat4, Quat, StandardView, UpAxis};
+pub use camera::{Camera, CameraAnim, Mat4, Quat, StandardView, UpAxis, ease_in_out};
pub use curve_display::{PixelCurveView, SampledPath, SamplingBudget, SamplingQuality, sample_segment, sample_segment_unclipped};
pub use gif::gif;
pub use product::{FaceAppearance, ProductMesh, ProductScene};
diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rs
index 7b2a6d52d0..3826e94845 100644
--- a/crates/ui-egui/src/control.rs
+++ b/crates/ui-egui/src/control.rs
@@ -387,6 +387,13 @@ fn dispatch(app: &mut SolveApp, ctx: &egui::Context, method: &str, p: &Value) ->
"ui.view" => {
let v = s("view").unwrap_or("home");
app.viewport.orbit_free = None;
+ if p.get("animate").and_then(Value::as_bool).unwrap_or(false) {
+ if v != "fit" && v != "home" && StandardView::parse(v).is_none() {
+ return err(format!("unknown view `{v}`"));
+ }
+ app.animate_view(v);
+ return ok(json!({ "animating": true, "to": app.cam_anim.map(|a| a.to) }));
+ }
app.cancel_view_animation();
match v {
"fit" => app.fit_view(),
@@ -1407,6 +1414,23 @@ mod tests {
let mut h = crate::scenario::Harness::new();
h.app = SolveApp::new(s, Services::default());
h.frames(2);
+ let before = h.app.cam;
+ // Reading during an animated view change leaves it running (no frames run between).
+ fn raw(h: &mut crate::scenario::Harness, method: &str, params: Value) -> Value {
+ let (req, _rx) = ControlRequest::new(method, params);
+ match handle(&mut h.app, &h.ctx, &req) {
+ Outcome::Done(v) => v,
+ Outcome::Screenshot { .. } => Value::Null,
+ }
+ }
+ raw(&mut h, "ui.view", json!({"view": "top", "animate": true}));
+ let r = raw(&mut h, "ui.camera", Value::Null);
+ assert!(r["ok"] == true && h.app.cam_anim.is_some(), "{r}");
+ // Setting it, even to where it is now, ends the animation there.
+ let yaw = h.app.cam.yaw;
+ let r = raw(&mut h, "ui.camera", json!({ "yaw": yaw }));
+ assert!(r["ok"] == true && h.app.cam_anim.is_none(), "{r}");
+ h.app.cam = before;
let mut cam = |p: Value| {
let r = h.call("ui.camera", p);
assert_eq!(r["ok"], true, "{r}");
diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs
index 69b83ca214..db7bbbc288 100644
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@ -2789,8 +2789,9 @@ pub fn start_sketch(app: &mut SolveApp, sel: &Sel) -> Result<(), String> {
look_at_sketch(app);
// On a face: look at the picked point, not the plane's origin (a corner of the face),
// which left the face filling the view off-centre like a big square.
- if let Sel::Face { point, .. } = sel {
- let mut to = app.cam;
+ if let Sel::Face { point, .. } = sel
+ && let Some(mut to) = app.cam_anim.as_ref().map(|a| a.to)
+ {
to.target = *point;
app.animate_to(to);
}
diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rs
index d9050e9ac2..84e0652048 100644
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@ -248,7 +248,7 @@ use std::sync::mpsc::Receiver;
use serde::{Deserialize, Serialize};
use serde_json::{Value, json};
use solidcraft_engine::Session;
-use solidcraft_engine::render::{Camera, StandardView};
+use solidcraft_engine::render::{Camera, CameraAnim, StandardView};
pub use control::{ControlRequest, ControlResponse};
@@ -363,6 +363,8 @@ pub struct SolveApp {
pub ui: UiState,
pub(crate) shell: shell::State,
pub cam: Camera,
+ /// A view change in progress (axis view, Home, Fit); any mouse navigation cancels it.
+ pub cam_anim: Option<CameraAnim>,
/// Seconds since start, as of this frame.
pub now: f64,
/// The view before the current sketch started (Finish Sketch returns to it).
@@ -531,6 +533,7 @@ impl SolveApp {
ui: UiState::default(),
shell: Default::default(),
cam: Camera::default(),
+ cam_anim: None,
now: 0.0,
pre_sketch_cam: None,
pre_sketch_marker: None,
@@ -1241,6 +1244,7 @@ impl SolveApp {
/// (home) and frames the model.
pub fn set_up_axis(&mut self, up: solidcraft_engine::render::UpAxis) {
self.ui.up_axis = up;
+ self.cam_anim = None;
self.cam.up = up;
self.cam.set_view(StandardView::Iso);
self.fit_view();
@@ -1260,6 +1264,7 @@ impl SolveApp {
}
return;
}
+ self.cam_anim = None;
self.viewport.orbit_free = None;
let bounds = viewport::view_bounds(self);
self.pending_fit = Some((self.cam, bounds, false));
@@ -1305,19 +1310,31 @@ impl SolveApp {
self.animate_to(to);
} else {
self.cam = to;
+ self.cam_anim = None;
}
ctx.request_repaint();
}
}
- /// Move the camera to `to` at once. Views never animate: nothing is left running that a
- /// later mouse orbit, pan or zoom could lag behind.
+ /// Move the camera to `to` over half a second (ease in-out, orientation slerped).
pub fn animate_to(&mut self, to: Camera) {
self.pending_fit = None;
self.viewport.orbit_free = None;
- if to.is_valid() {
+ if !to.is_valid() {
+ return;
+ }
+ // Preferences › Navigation: animated (at a chosen speed) or immediate.
+ if !self.preferences.look_at_anim {
self.cam = to;
+ self.cam_anim = None;
+ return;
}
+ let mut anim = CameraAnim::new(self.cam, to, self.now);
+ let speed = f64::from(self.preferences.look_at_speed);
+ if speed.is_finite() && speed > 0.0 {
+ anim.duration /= speed;
+ }
+ self.cam_anim = Some(anim);
}
/// Frame everything shown, keeping the orientation (animated; the selection is ignored).
@@ -1399,9 +1416,10 @@ impl SolveApp {
}
}
- /// Drop a pending refit (the user took over the camera).
+ /// Stop any view animation where it is (the user took over the camera).
pub fn cancel_view_animation(&mut self) {
self.pending_fit = None;
+ self.cam_anim = None;
}
/// Hand the view to an external navigation device without a pending mouse orbit or spin
@@ -1412,6 +1430,17 @@ impl SolveApp {
self.viewport.spin = false;
}
+ fn step_view_animation(&mut self, ctx: &egui::Context) {
+ let Some(anim) = self.cam_anim else { return };
+ let (cam, done) = anim.sample(self.now);
+ self.cam = if cam.is_valid() { cam } else { anim.to };
+ if done {
+ self.cam_anim = None;
+ } else {
+ ctx.request_repaint();
+ }
+ }
+
/// Per-frame logic before layout.
pub fn logic(&mut self, ctx: &egui::Context) {
frame_watch::begin(self);
@@ -1441,6 +1470,7 @@ impl SolveApp {
if self.cam.up != self.ui.up_axis {
self.set_up_axis(self.ui.up_axis);
}
+ self.step_view_animation(ctx);
self.poll_control_jobs(ctx);
self.drain_control(ctx);
self.follow_view_request(true);
diff --git a/crates/ui-egui/src/look_at_tests.rs b/crates/ui-egui/src/look_at_tests.rs
index 8a1e11a09c..753f8422c6 100644
--- a/crates/ui-egui/src/look_at_tests.rs
+++ b/crates/ui-egui/src/look_at_tests.rs
@@ -11,6 +11,7 @@ use crate::scenario::Harness;
fn far_sketch() -> (Harness, u64) {
let mut h = Harness::new();
h.app.home.open = false;
+ h.app.preferences.look_at_anim = false;
h.app.run("sketch.create", json!({"plane": "XY", "offset": 8, "name": "Far"})).unwrap();
h.app.run("sketch.rectangle.two_point", json!({"p0": [330, 475], "p1": [350, 505]})).unwrap();
h.app.run("sketch.finish", json!({})).unwrap();
@@ -52,6 +53,7 @@ fn look_at_on_the_active_sketch_keeps_a_wider_zoom() {
fn an_empty_sketch_keeps_its_planes_origin() {
let mut h = Harness::new();
h.app.home.open = false;
+ h.app.preferences.look_at_anim = false;
h.app.run("sketch.create", json!({"plane": "XY", "offset": 8})).unwrap();
h.app.cam.distance = 123.0;
crate::dialogs::look_at_sketch(&mut h.app);
diff --git a/crates/ui-egui/src/menu_tests.rs b/crates/ui-egui/src/menu_tests.rs
index c70b3e7996..70a6d3ce3e 100644
--- a/crates/ui-egui/src/menu_tests.rs
+++ b/crates/ui-egui/src/menu_tests.rs
@@ -575,7 +575,7 @@ fn named_views_save_restore_rename_and_delete() {
app.cam.set_view(solidcraft_engine::render::StandardView::Top);
let t = Target::NamedView { name: "Named View1".into() };
act(&mut app, &t, "Restore");
- assert_eq!(app.cam, saved, "goes back to the saved camera at once");
+ assert_eq!(app.cam_anim.map(|a| a.to), Some(saved), "animates back to the saved camera");
act(&mut app, &t, "Rename");
assert!(context_menu::finish_rename(&mut app, Some("Front detail"), true));
let t = Target::NamedView { name: "Front detail".into() };
@@ -585,7 +585,7 @@ fn named_views_save_restore_rename_and_delete() {
let top = context_menu::items(&app, &Target::NamedView { name: "Top".into() });
assert!(!find(&top, "Delete").enabled);
context_menu::run_item(&mut app, &find(&top, "Restore"), pos2(0.0, 0.0));
- assert_ne!(app.cam, saved);
+ assert!(app.cam_anim.is_some());
}
#[test]
diff --git a/crates/ui-egui/src/navigation.rs b/crates/ui-egui/src/navigation.rs
index 349ccc4e8e..5ec2d73485 100644
--- a/crates/ui-egui/src/navigation.rs
+++ b/crates/ui-egui/src/navigation.rs
@@ -236,7 +236,10 @@ pub(crate) fn view_key(app: &mut SolveApp, ctx: &egui::Context, key: egui::Key,
} else if !repeat {
let degrees = if mods.shift { 90.0 } else { 15.0 };
app.viewport.key_hold = Some(KeyHold { key, action, shift: mods.shift, since: app.now });
- let _ = app.run("view.navigate", json!({"camera": app.cam, "action": action, "degrees": degrees}));
+ // Turn from where a step in flight is going, so taps add up and the one animation is
+ // retargeted rather than a second started.
+ let from = app.cam_anim.map_or(app.cam, |a| a.to);
+ let _ = app.run("view.navigate", json!({"camera": from, "action": action, "degrees": degrees}));
}
true
}
@@ -1216,6 +1219,7 @@ mod view_key_tests {
#[test]
fn arrow_keys_turn_and_pan_the_view() {
let mut h = Harness::new();
+ h.app.preferences.look_at_anim = false;
h.app.run("solid.box", json!({"length": 10, "width": 10, "height": 10})).unwrap();
h.step(&json!({"call": "ui.view", "params": {"view": "front"}})).unwrap();
h.frames(3);
@@ -1258,20 +1262,22 @@ mod view_key_tests {
fn front_view() -> Harness {
let mut h = Harness::new();
+ h.app.preferences.look_at_anim = true;
h.app.run("solid.box", json!({"length": 10, "width": 10, "height": 10})).unwrap();
h.step(&json!({"call": "ui.view", "params": {"view": "front"}})).unwrap();
h.settle();
h
}
- /// Holding an arrow turns the view steadily, by frame time, whatever the key repeat does.
+ /// Holding an arrow turns the view steadily, by frame time, whatever the key repeat does:
+ /// one animation at most, never a second one fighting the first.
#[test]
fn a_held_arrow_turns_the_view_steadily_and_ignores_key_repeat() {
let hold = |repeats: bool| {
let mut h = front_view();
+ let mut last = h.app.cam.yaw;
h.app.synthetic.push(arrow(true, false));
h.frame();
- let mut last = h.app.cam.yaw;
let log = h.app.session.log.len();
let mut deltas = Vec::new();
for frame in 0..60 {
@@ -1282,8 +1288,9 @@ mod view_key_tests {
deltas.push(turn(last, h.app.cam.yaw));
last = h.app.cam.yaw;
}
+ assert!(h.app.cam_anim.is_none(), "the held turn runs on key state, not on a tween");
assert_eq!(h.app.session.log.len(), log, "turn frames do not flood the command log");
- assert!(deltas.iter().all(|d| *d >= 0.0), "the view never reverses while held: {deltas:?}");
+ assert!(deltas.iter().all(|d| *d > 0.0), "the view never stops or reverses while held: {deltas:?}");
let steady = &deltas[20..];
let per_frame = 90f64.to_radians() / 60.0;
assert!(steady.iter().all(|d| (d - per_frame).abs() < 1e-3), "{steady:?}");
@@ -1296,14 +1303,34 @@ mod view_key_tests {
assert!((hold(false) - hold(true)).abs() < 1e-9, "OS key repeat changes nothing");
}
- /// A tap is one step of 15°, applied in the frame of the press, and a second tap adds to it.
+ /// A tap is still one animated step of 15°, with one animation.
#[test]
- fn a_tap_is_one_instant_step() {
+ fn a_tap_is_one_animated_step() {
let mut h = front_view();
let before = h.app.cam.yaw;
tap(&mut h);
+ h.frames(2);
+ assert!(h.app.cam_anim.is_some(), "the step animates");
+ h.settle();
+ assert!(h.app.cam_anim.is_none());
assert!((turn(before, h.app.cam.yaw).abs() - 15f64.to_radians()).abs() < 1e-6);
+ }
+
+ /// A tap while a step is in flight retargets that animation: the turns add up and only one
+ /// animation exists, starting where the camera is.
+ #[test]
+ fn a_tap_during_a_step_retargets_the_one_animation() {
+ let mut h = front_view();
+ let before = h.app.cam.yaw;
tap(&mut h);
+ h.frames(5);
+ let mid = h.app.cam;
+ tap(&mut h);
+ h.frames(1);
+ let anim = h.app.cam_anim.expect("one animation");
+ assert!((turn(before, anim.to.yaw).abs() - 30f64.to_radians()).abs() < 1e-6, "retargeted past the first step");
+ assert!(turn(mid.yaw, anim.from.yaw).abs() < 15f64.to_radians(), "continues from the camera as it is");
+ h.settle();
assert!((turn(before, h.app.cam.yaw).abs() - 30f64.to_radians()).abs() < 1e-6);
}
@@ -1312,6 +1339,7 @@ mod view_key_tests {
#[test]
fn ctrl_8_again_looks_from_the_other_side() {
let mut h = Harness::new();
+ h.app.preferences.look_at_anim = false;
h.app.run("sketch.create", json!({"plane": "XY"})).unwrap();
h.frames(2);
let back_z = |h: &Harness| h.app.cam.back().z;
diff --git a/crates/ui-egui/src/navigation_cube.rs b/crates/ui-egui/src/navigation_cube.rs
index b5d77a8e2b..f0974003e9 100644
--- a/crates/ui-egui/src/navigation_cube.rs
+++ b/crates/ui-egui/src/navigation_cube.rs
@@ -272,6 +272,7 @@ mod tests {
let mut h = crate::scenario::Harness::new();
h.call("ui.prefs", json!({"navigator_style":"cube"}));
let ctx = crate::fonts::test_context();
+ h.app.preferences.look_at_anim = false;
for up in ["z", "y"] {
h.call("ui.prefs", json!({"up_axis":up}));
h.call("ui.view", json!({"view":"front"}));
@@ -508,24 +509,57 @@ mod tests {
assert_eq!(h.app.cam.distance, cam.distance);
}
- /// A view-cube click puts the camera at the view at once and leaves nothing running: the
- /// mouse orbit that follows moves the camera exactly as far as the pointer, in the same frame.
#[test]
- fn a_mouse_orbit_after_a_cube_click_follows_the_pointer_one_to_one() {
+ fn cube_navigation_eases_through_intermediate_views_and_can_be_interrupted() {
+ let mut h = crate::scenario::Harness::new();
+ h.call("ui.prefs", json!({"navigator_style":"cube"}));
+ assert!(h.app.preferences.look_at_anim);
+ for (action, direction) in [(None, Some(Vec3::Z)), (Some("right"), None), (Some("clockwise"), None), (Some("home"), None)] {
+ let from = h.app.cam;
+ navigate(&mut h.app, action, direction);
+ let anim = h.app.cam_anim.expect("cube navigation must animate");
+ assert_eq!(h.app.cam, from, "starting a transition must not jump the camera");
+ let mut previous = from;
+ for frame in 1..=60 {
+ let now = anim.start + anim.duration * f64::from(frame) / 60.0 + if frame == 60 { 1e-9 } else { 0.0 };
+ let (cam, done) = anim.sample(now);
+ let angle = |a: Vec3, b: Vec3| a.dot(b).clamp(-1.0, 1.0).acos().to_degrees();
+ assert!(angle(previous.back(), cam.back()).max(angle(previous.basis().0, cam.basis().0)) < 10.0);
+ assert_eq!(done, frame == 60);
+ if frame == 30 {
+ assert_ne!(cam.basis(), from.basis());
+ assert_ne!(cam.basis(), anim.to.basis());
+ }
+ previous = cam;
+ }
+ h.app.cam = anim.sample(anim.start + anim.duration / 2.0).0;
+ let intermediate = h.app.cam;
+ navigate(&mut h.app, Some("left"), None);
+ assert_eq!(h.app.cam_anim.unwrap().from, intermediate, "another click starts where the camera is");
+ h.app.cam = anim.to;
+ h.app.cancel_view_animation();
+ }
+ }
+
+ /// A view-cube click glides, but a mouse orbit started at once cancels the glide: the camera
+ /// then follows the pointer one to one, and nothing keeps easing after the pointer stops.
+ #[test]
+ fn a_mouse_orbit_right_after_a_cube_click_follows_the_pointer_one_to_one() {
let mut h = crate::scenario::Harness::new();
h.call("ui.prefs", json!({"navigator_style":"cube"}));
h.app.run("solid.box", json!({"length":20,"width":20,"height":20})).unwrap();
h.frames(4);
let p = crate::scenario::handle_at("navigation_cube:top").unwrap();
- h.call("ui.click", json!({"x":p.x,"y":p.y}));
- assert!(h.app.cam.back().dist(Vec3::Z) < 1e-6, "the click shows the top view in its own frame");
- assert!(h.app.viewport.orbit_free.is_none());
+ let button = |pressed| egui::Event::PointerButton { pos: p, button: egui::PointerButton::Primary, pressed, modifiers: egui::Modifiers::NONE };
+ h.app.synthetic.extend([egui::Event::PointerMoved(p), button(true), button(false)]);
+ h.frames(3);
+ assert!(h.app.cam_anim.is_some(), "the click glides");
let mut expected = h.app.cam;
- let from = h.app.cam;
h.call("ui.drag", json!({"x0":800,"y0":500,"x1":850,"y1":520,"button":"middle","shift":true,"steps":20}));
+ assert!(h.app.cam_anim.is_none(), "the orbit cancels the glide");
expected.orbit(50.0, 20.0);
- assert_ne!(h.app.cam, from);
- assert!((h.app.cam.yaw - expected.yaw).abs() < 1e-9 && (h.app.cam.pitch - expected.pitch).abs() < 1e-9, "{:?}", h.app.cam);
+ // The glide may step once, in the frame the orbit starts and cancels it.
+ assert!((h.app.cam.yaw - expected.yaw).abs() < 0.03 && (h.app.cam.pitch - expected.pitch).abs() < 0.03, "{:?} vs {:?}", h.app.cam, expected);
let done = h.app.cam;
h.frames(30);
assert_eq!(h.app.cam, done, "nothing keeps easing after the pointer stops");
@@ -535,6 +569,7 @@ mod tests {
fn cube_faces_corners_roll_and_home_drive_the_shared_command() {
let mut h = crate::scenario::Harness::new();
h.call("ui.prefs", json!({"navigator_style":"cube"}));
+ h.app.preferences.look_at_anim = false;
let before = h.app.session.doc.to_json();
for (name, direction) in [("top", Vec3::Z), ("front", -Vec3::Y), ("right", Vec3::X), ("top_front_right", Vec3::Z - Vec3::Y + Vec3::X)] {
h.call("ui.view", json!({"view":"iso"}));
diff --git a/crates/ui-egui/src/prefs.rs b/crates/ui-egui/src/prefs.rs
index 8b77ec164e..eba5d7c2c4 100644
--- a/crates/ui-egui/src/prefs.rs
+++ b/crates/ui-egui/src/prefs.rs
@@ -314,7 +314,7 @@ pub const DEFAULT_BROWSER_WIDTH: f32 = 250.0;
// The stored fields, their defaults, page resets and simple form controls share this table.
// Omitted pages keep fields such as grid_follows_view and added agents when restoring defaults.
-// Accepted control-channel ranges may differ from slider ranges.
+// Accepted control-channel ranges may differ from slider ranges (look_at_speed).
macro_rules! preference_settings {
($( $(#[$doc:meta])* $field:ident: $ty:ty = $default:expr $(, $page:expr)? $(, accept($accepted:expr))? $(=> $control:ident($($args:tt)*))? ;)*) => {
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
@@ -473,6 +473,9 @@ preference_settings! {
trackpad_pan: bool = true, 1;
/// Horizontal trackpad and thumb-wheel scrolling pans the view the other way (#2007).
pan_reverse_x: bool = false, 1 => check("Reverse horizontal pan direction", "Horizontal two-finger scrolling and the thumb wheel pan the other way");
+ /// View changes (axis view, Look At, Home) animate; `look_at_speed` scales how fast.
+ look_at_anim: bool = true, 1 => check("Animate view changes", "Axis view, Look At, Home and Fit");
+ look_at_speed: f32 = 1.0, 1, accept(0.25..=4.0) => enabled_slider(look_at_anim, "Animation speed", 0.5..=3.0, 0.25, |v| format!("{v:.2}×"));
/// Default modelling orientation: `z` (Z up) or `y` (Y up) (#3).
up_axis: String = "z".into(), PAGE_DESIGN;
/// After a STEP or IGES file opens, offer to stand a Y-up part up (`stand_up`).
@@ -1278,6 +1281,8 @@ fn page(app: &mut SolveApp, ui: &mut egui::Ui, t: &Tokens) {
for (m, id, label) in MiddleDoubleClick::ALL { if ui_kit::list_picker(ui, id, crate::i18n::tr_label(label), current == m).clicked() { app.preferences.middle_double_click = id.into(); } }
}).on_hover_text(crate::i18n::tr_label("Double-clicking the middle button in the view: Home (the home view, framing what is shown), Fit (frame what is shown, keeping the orientation) or nothing"));
});
+ setting::look_at_anim(app, ui);
+ setting::look_at_speed(app, ui);
setting::space_mouse_enabled(app, ui);
setting::space_mouse_speed(app, ui);
// Rows say what they do to the view, through the mapping navigation uses; the choices
@@ -1861,8 +1866,8 @@ pub fn set(app: &mut SolveApp, p: &serde_json::Value) -> Result<serde_json::Valu
if new.disabled_plugins.len() > crate::plugins::MAX_DISABLED || new.disabled_plugins.iter().any(|id| !crate::plugins::valid_id(id)) {
return Err(format!("`disabled_plugins` must be at most {} ids of lowercase letters, digits and hyphens", crate::plugins::MAX_DISABLED));
}
- if !accepted::ui_scale(&new) {
- return Err("`ui_scale` must be 0.5…2.5".into());
+ if !accepted::ui_scale(&new) || !accepted::look_at_speed(&new) {
+ return Err("`ui_scale` must be 0.5…2.5 and `look_at_speed` 0.25…4".into());
}
if solidcraft_engine::doc::display_quality::DisplayQuality::parse(&new.display_quality).is_none() {
return Err("`display_quality` must be coarse, normal, fine or ultra".into());
@@ -2181,7 +2186,7 @@ mod tests {
assert_eq!(h.app.preferences.navigator_style, NavigatorStyle::Axes);
h.call("ui.prefs", json!({"button":"cancel"}));
assert_eq!(h.app.preferences.navigator_style, NavigatorStyle::Cube);
- h.call("ui.prefs", json!({"navigator_style":"axes"}));
+ h.call("ui.prefs", json!({"navigator_style":"axes", "look_at_anim":false}));
h.call("ui.view", json!({"view":"front"}));
let axis = crate::scenario::handle_at("axis_view:-y").unwrap();
h.call("ui.click", json!({"x":axis.x,"y":axis.y}));
@@ -2429,7 +2434,7 @@ mod tests {
assert!(app.ui.dark && app.preferences.theme == "dark" && app.preferences.ui_scale == 1.0 && app.preferences.zoom_to_cursor);
assert!(app.keymap.custom.is_empty(), "a rebinding made while the dialog was open is undone too");
- control(&mut app, &json!({"open": "Navigation", "nav": "alias"})).unwrap();
+ control(&mut app, &json!({"open": "Navigation", "nav": "alias", "look_at_anim": false})).unwrap();
control(&mut app, &json!({"button": "apply"})).unwrap();
control(&mut app, &json!({"nav": "tinkercad"})).unwrap();
control(&mut app, &json!({"button": "cancel"})).unwrap();
@@ -2440,11 +2445,12 @@ mod tests {
c
};
app.animate_to(to);
- assert!(app.cam == to, "the view jumps");
+ assert!(app.cam_anim.is_none() && app.cam == to, "no animation: the view jumps");
control(&mut app, &json!({"open": "Navigation"})).unwrap();
control(&mut app, &json!({"button": "defaults"})).unwrap();
assert_eq!(app.preferences.nav, "fusion");
+ assert!(app.preferences.look_at_anim);
control(&mut app, &json!({"button": "ok"})).unwrap();
assert!(!app.prefs_window.open);
diff --git a/crates/ui-egui/src/render_workspace_tests.rs b/crates/ui-egui/src/render_workspace_tests.rs
index f5e62c1f95..23408069ad 100644
--- a/crates/ui-egui/src/render_workspace_tests.rs
+++ b/crates/ui-egui/src/render_workspace_tests.rs
@@ -588,6 +588,7 @@ fn render_workspace_view_keys_double_middle_click_and_navigators_work() {
for style in [crate::prefs::NavigatorStyle::Axes, crate::prefs::NavigatorStyle::Cube] {
let mut h = Harness::new();
h.app.preferences.navigator_style = style;
+ h.app.preferences.look_at_anim = false;
h.app.run("solid.box", json!({"length":40,"width":30,"height":20,"body_name":"Product"})).unwrap();
enter(&mut h.app, true).unwrap();
h.frames(3);
diff --git a/crates/ui-egui/src/scenario.rs b/crates/ui-egui/src/scenario.rs
index dbc0af57f8..5e0170f30c 100644
--- a/crates/ui-egui/src/scenario.rs
+++ b/crates/ui-egui/src/scenario.rs
@@ -22,7 +22,8 @@
//! into `$SOLIDCRAFT_SCENARIO_SHOTS` when that is set; `{"debug": 1}`
//! prints the UI state (`"widgets"`: also every widget's text; `"handles"`: every published
//! handle, browser rows as `row:<label>` and their fold arrows as `fold:<label>`)
-//! - `{"camera": {"yaw": rad, "pitch": rad}}` puts the camera at an orbit
+//! - `{"camera": {"yaw": rad, "pitch": rad}}` puts the camera at an orbit; `{"view_anim": "top",
+//! "max_deg": 10}` animates to a view and fails if any frame turns the view more than that
//! - AT may also be `{"plane": "XY"}` (the middle of an origin plane's square), `{"axis": "Z"}`,
//! `{"dimension": "d1"}`, `{"handle": "arrow"}` (a manipulator handle: see [`publish_handle`]),
//! `{"browser": "Bodies"}` (a browser row by its label) or `{"chevron": "Bodies"}` (its fold arrow)
@@ -268,7 +269,7 @@ impl Harness {
pub fn settle(&mut self) {
for _ in 0..2000 {
// Queued input used up and the view no longer moving.
- if self.app.synthetic.is_empty() {
+ if self.app.synthetic.is_empty() && self.app.cam_anim.is_none() {
break;
}
self.frame();
@@ -377,6 +378,36 @@ impl Harness {
}
}
+ /// Animate the view to `v` (as the axis view does), sampling the camera every frame: no
+ /// frame may turn the view (its right or back vector) by more than `max_deg`, the last
+ /// included, so the move ends without a jump.
+ fn view_anim(&mut self, v: &str, max_deg: f64) -> Result<(), String> {
+ let basis = |c: &solidcraft_engine::render::Camera| c.basis();
+ let mut prev = basis(&self.app.cam);
+ self.app.animate_view(v);
+ if self.app.cam_anim.is_none() {
+ return Err(format!("view_anim {v}: no animation started"));
+ }
+ let mut worst = (0.0f64, 0usize);
+ for i in 0..240 {
+ self.frame();
+ let now = basis(&self.app.cam);
+ let ang = |a: solidcraft_engine::geom::Vec3, b: solidcraft_engine::geom::Vec3| a.dot(b).clamp(-1.0, 1.0).acos().to_degrees();
+ let d = ang(prev.0, now.0).max(ang(prev.2, now.2));
+ if d > worst.0 {
+ worst = (d, i);
+ }
+ prev = now;
+ if self.app.cam_anim.is_none() {
+ if worst.0 > max_deg {
+ return Err(format!("view_anim {v}: frame {} of {} turns the view {:.1}° (limit {max_deg}°)", worst.1 + 1, i + 1, worst.0));
+ }
+ return Ok(());
+ }
+ }
+ Err(format!("view_anim {v}: still animating after 240 frames"))
+ }
+
/// Run one step.
pub fn step(&mut self, s: &Value) -> Result<(), String> {
let flag = |k: &str| s.get(k).and_then(Value::as_bool).unwrap_or(false);
@@ -484,10 +515,13 @@ impl Harness {
if let Some(p) = c.get("pitch").and_then(Value::as_f64) {
self.app.cam.pitch = p;
}
+ self.app.cam_anim = None;
self.frames(2);
// Where `camera.panned` and `camera.zoomed` checks measure from.
self.cam_mark = Some(self.app.cam);
return Ok(());
+ } else if let Some(v) = s.get("view_anim").and_then(Value::as_str) {
+ return self.view_anim(v, s.get("max_deg").and_then(Value::as_f64).unwrap_or(10.0));
} else if s.get("autosave").is_some() {
self.start_autosave();
return Ok(());
@@ -653,7 +687,14 @@ pub fn check(h: &mut Harness, e: &Value) -> Result<(), String> {
}
"camera" => {
// {"camera": {"yaw_deg": y, "pitch_deg": p, "back"?: [x,y,z]}}: where the camera
- // looks from (yaw and pitch in its up-axis frame, ±0.5°).
+ // looks from (yaw and pitch in its up-axis frame, ±0.5°),
+ // once any view animation has finished.
+ for _ in 0..240 {
+ if h.app.cam_anim.is_none() {
+ break;
+ }
+ h.frame();
+ }
let (yaw, pitch) = (h.app.cam.yaw.to_degrees(), h.app.cam.pitch.to_degrees());
let near = |got: f64, want: &Value| want.as_f64().is_none_or(|w| ((got - w + 540.0).rem_euclid(360.0) - 180.0).abs() < 0.5);
if !near(yaw, &v["yaw_deg"]) || !near(pitch, &v["pitch_deg"]) {
diff --git a/crates/ui-egui/src/sketch_guidance_ui_tests.rs b/crates/ui-egui/src/sketch_guidance_ui_tests.rs
index 9ab5a03061..6512ee6d59 100644
--- a/crates/ui-egui/src/sketch_guidance_ui_tests.rs
+++ b/crates/ui-egui/src/sketch_guidance_ui_tests.rs
@@ -10,6 +10,7 @@ fn step(h: &mut Harness, value: Value) {
}
fn fixture() -> Harness {
let mut h = Harness::new();
+ h.app.preferences.look_at_anim = false;
for (command, params) in [
("sketch.create", json!({"plane":"XY"})),
("sketch.line", json!({"points":[[-30,10],[-15,10]]})),
diff --git a/crates/ui-egui/src/sketch_side_ui_tests.rs b/crates/ui-egui/src/sketch_side_ui_tests.rs
index 03f208042b..bb62fa6147 100644
--- a/crates/ui-egui/src/sketch_side_ui_tests.rs
+++ b/crates/ui-egui/src/sketch_side_ui_tests.rs
@@ -8,6 +8,7 @@ use solidcraft_engine::geom::{Plane, Vec3};
fn sketch_from(yaw: f64, pitch: f64, name: &str) -> (Harness, Vec3, Plane) {
let mut h = Harness::new();
+ h.app.preferences.look_at_anim = false;
h.app.cam.yaw = yaw;
h.app.cam.pitch = pitch;
let eye = h.app.cam.eye();
@@ -72,6 +73,7 @@ fn a_flipped_sketch_extrudes_toward_the_viewer_and_reopens_the_same() {
#[test]
fn a_construction_plane_seen_from_below_gets_a_sketch_facing_down() {
let mut h = Harness::new();
+ h.app.preferences.look_at_anim = false;
h.app.run("construct.plane.offset", json!({"base":"XY","offset":"5 mm","name":"P"})).unwrap();
h.app.cam.yaw = -0.6;
h.app.cam.pitch = -0.5;
diff --git a/crates/ui-egui/src/toolbar.rs b/crates/ui-egui/src/toolbar.rs
index 94466c060a..dd985f75be 100644
--- a/crates/ui-egui/src/toolbar.rs
+++ b/crates/ui-egui/src/toolbar.rs
@@ -1450,8 +1450,12 @@ fn assistant_button(app: &mut SolveApp, ui: &mut egui::Ui, at: Rect) {
ui.painter().circle_filled(c, 4.0, color);
}
AssistantMark::Busy => {
- ui.ctx().request_repaint();
- let phase = ui.input(|i| i.time) as f32 * 3.0;
+ let phase = if app.preferences.look_at_anim {
+ ui.ctx().request_repaint();
+ ui.input(|i| i.time) as f32 * 3.0
+ } else {
+ 0.0
+ };
ui.painter().circle_filled(c, 6.0, ring);
let points = (0..=24)
.map(|i| {
diff --git a/crates/ui-egui/src/view_home_tests.rs b/crates/ui-egui/src/view_home_tests.rs
index 460c4f9e04..fe8bb6c863 100644
--- a/crates/ui-egui/src/view_home_tests.rs
+++ b/crates/ui-egui/src/view_home_tests.rs
@@ -13,6 +13,7 @@ fn moved_block(h: &mut Harness) {
h.app.run("solid.extrude", json!({"distance": 5})).unwrap();
let body = h.app.session.world_state().bodies[0].name.clone();
h.app.run("solid.move", json!({"bodies": [body], "translate": [500, 0, 0]})).unwrap();
+ h.app.preferences.look_at_anim = false;
h.settle();
}
diff --git a/crates/ui-egui/src/viewport.rs b/crates/ui-egui/src/viewport.rs
index d3a9fc77d6..464e89bece 100644
--- a/crates/ui-egui/src/viewport.rs
+++ b/crates/ui-egui/src/viewport.rs
@@ -2425,7 +2425,8 @@ pub fn show(app: &mut SolveApp, ui: &mut egui::Ui) {
|| (primary_nav.is_some() && primary_down)
|| mode.is_some()
|| app.viewport.axis_drag.is_some()
- || app.viewport.spin;
+ || app.viewport.spin
+ || app.cam_anim.is_some();
let hits = hover.filter(|_| inside && app.viewport.boxsel.is_none() && !navigating).map(|p| pick_cached(app, &proj, p)).unwrap_or_default();
// The Fillet and Chamfer window resolves its own corners: the nearest sketch point to a
// corner drawn from the origin is the fixed origin, which ends no two curves.
@@ -5263,6 +5264,14 @@ mod tests {
app.viewport.spin = false;
hover_frame(&mut app, &ctx, vec![]);
assert!(app.viewport.hover.is_some());
+ app.cam_anim = Some(solidcraft_engine::render::CameraAnim::new(app.cam, app.cam, 0.0));
+ for _ in 0..3 {
+ hover_frame(&mut app, &ctx, vec![]);
+ assert!(app.viewport.hover.is_none());
+ }
+ app.cam_anim = None;
+ hover_frame(&mut app, &ctx, vec![]);
+ assert!(app.viewport.hover.is_some());
}
/// After a close-up refines a body (#1320), the model draws it from the refined plan (on the
@@ -6240,8 +6249,8 @@ mod tests {
assert_eq!(h.app.cam.target, before.target);
assert_eq!(h.app.cam.distance, before.distance);
orbit_drag(&mut h.app, rect, 0.0, 0.0, None, false, false);
- assert!((h.app.cam.yaw - 1.6).abs() < 1e-6);
h.frames(2);
+ assert!((h.app.cam.yaw - 1.6).abs() < 1e-6);
assert!(h.app.viewport.orbit_free.is_none());
}
diff --git a/crates/ui-egui/src/viewport_layout_tests.rs b/crates/ui-egui/src/viewport_layout_tests.rs
index 27228d1305..7372feffa5 100644
--- a/crates/ui-egui/src/viewport_layout_tests.rs
+++ b/crates/ui-egui/src/viewport_layout_tests.rs
@@ -116,10 +116,12 @@ fn fit_home_animation_and_manual_takeover_use_one_layout_solution() {
h.app.run("sketch.circle.center", json!({"center":[0,0],"radius":1})).unwrap();
h.settle();
for view in ["fit", "home"] {
+ h.app.preferences.look_at_anim = false;
h.app.animate_view(view);
h.settle();
let immediate = h.app.cam;
h.app.cam.pan(50.0, 10.0, 400.0);
+ h.app.preferences.look_at_anim = true;
h.app.animate_view(view);
h.settle();
assert_eq!(h.app.cam, immediate);
@@ -141,6 +143,7 @@ fn measured_navigator_targets_home_and_drag_work_beside_the_palette_at_hidpi() {
let mut h = Harness::new();
h.call("ui.set", json!({"layout":mode}));
h.call("ui.prefs", json!({"navigator_style":style}));
+ h.app.preferences.look_at_anim = false;
h.app.run("sketch.create", json!({"plane":"XY"})).unwrap();
h.app.run("sketch.circle.center", json!({"center":[0,0],"radius":1})).unwrap();
h.call("ui.prefs", json!({"ui_scale":scale}));
diff --git a/crates/ui-egui/src/viewport_overlays_tests.rs b/crates/ui-egui/src/viewport_overlays_tests.rs
index c29b39363a..0d371637e0 100644
--- a/crates/ui-egui/src/viewport_overlays_tests.rs
+++ b/crates/ui-egui/src/viewport_overlays_tests.rs
@@ -24,6 +24,7 @@ fn compass_keeps_signed_targets_hover_and_clicks_at_both_scales() {
let mut h = Harness::new();
h.call("ui.set", json!({"layout": mode}));
h.call("ui.prefs", json!({"ui_scale": scale}));
+ h.app.preferences.look_at_anim = false;
h.settle();
let outer = crate::scenario::rect_of("axis_view:outer").unwrap();
assert_eq!(outer.size(), vec2(116.0, 116.0));
diff --git a/crates/ui-egui/tests/scenarios/s38_view_anim_no_jump.json b/crates/ui-egui/tests/scenarios/s38_view_anim_no_jump.json
new file mode 100644
index 0000000000..d753182958
--- /dev/null
+++ b/crates/ui-egui/tests/scenarios/s38_view_anim_no_jump.json
@@ -0,0 +1,74 @@
+[
+ {
+ "note": "Animating to Top or Bottom from iso, front or any orbit turns the view smoothly to the end: no frame (the last included) turns it more than 10 degrees."
+ },
+ {
+ "start": "solid.box"
+ },
+ {
+ "key": "Escape"
+ },
+ {
+ "view_anim": "top"
+ },
+ {
+ "view_anim": "home"
+ },
+ {
+ "view_anim": "bottom"
+ },
+ {
+ "call": "ui.view",
+ "params": {
+ "view": "front"
+ }
+ },
+ {
+ "view_anim": "top"
+ },
+ {
+ "call": "ui.view",
+ "params": {
+ "view": "front"
+ }
+ },
+ {
+ "view_anim": "bottom"
+ },
+ {
+ "camera": {
+ "yaw": 2.3,
+ "pitch": 0.35
+ }
+ },
+ {
+ "view_anim": "top"
+ },
+ {
+ "camera": {
+ "yaw": -1.1,
+ "pitch": -0.4
+ }
+ },
+ {
+ "view_anim": "top"
+ },
+ {
+ "camera": {
+ "yaw": 2.3,
+ "pitch": 0.35
+ }
+ },
+ {
+ "view_anim": "bottom"
+ },
+ {
+ "camera": {
+ "yaw": 0.4,
+ "pitch": 1.2
+ }
+ },
+ {
+ "view_anim": "front"
+ }
+]
diff --git a/crates/ui-egui/tests/scenarios/sketch_mirror_dialog.json b/crates/ui-egui/tests/scenarios/sketch_mirror_dialog.json
index 9f2788231d..ae729b9f19 100644
--- a/crates/ui-egui/tests/scenarios/sketch_mirror_dialog.json
+++ b/crates/ui-egui/tests/scenarios/sketch_mirror_dialog.json
@@ -1,5 +1,5 @@
[
- {"call":"ui.prefs","params":{}},
+ {"call":"ui.prefs","params":{"look_at_anim":false}},
{"call":"engine.execute","params":{"command":"sketch.create","params":{"plane":"XY"}}},
{"call":"engine.execute","params":{"command":"sketch.line","params":{"points":[[-30,10],[-15,10]]}}},
{"call":"engine.execute","params":{"command":"sketch.line","params":{"points":[[-15,10],[-15,25]]}}},
diff --git a/docs/book/src/guide/ui-tour.md b/docs/book/src/guide/ui-tour.md
index 24d64f3ea2..0847c8536a 100644
--- a/docs/book/src/guide/ui-tour.md
+++ b/docs/book/src/guide/ui-tour.md
@@ -143,10 +143,9 @@ Imported themes are kept with your preferences, so they work in the browser app
vision modes still apply on top of any theme.
Navigation › **Smooth wheel zoom** is on by default. Turn it off to apply each wheel or
-trackpad event immediately, with no smoothing tail. Re-enabling smoothing during
+trackpad event immediately, with no smoothing tail. It is independent of **Animate view
+changes**, which controls axis views, Look At, Home and Fit. Re-enabling smoothing during
a wheel gesture takes effect after that gesture ends, avoiding leftover zoom being replayed.
-Every other view change (axis view, view cube, Look At, Home, Fit, named views, arrow keys)
-and every orbit, pan and zoom drag applies at once, with no animation.
Navigation › **Alias** uses Alias's camera keys: Shift+Alt+left drag orbits, Shift+Alt+middle
drag pans and Shift+Alt+right drag zooms (drag down to move away, up to move closer). Without
diff --git a/docs/control-protocol.md b/docs/control-protocol.md
index 50609e6d77..0e85807c6d 100644
--- a/docs/control-protocol.md
+++ b/docs/control-protocol.md
@@ -174,7 +174,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
|---|---|---|
| `ui.inspect` | — | UI state, pending file picker (`file_picker_busy`; compatibility alias `file_dialog_open`, no path), what is hidden (`visibility`: bodies, origin and construction items, sketches, joints (`hidden_joints`, joint ids); set it with the `browser.visibility` command), viewport rect, camera, active tool/dialog, the status line (`status`: text and whether it is an error), hover, renderer, timings, live preview (`active`, `busy`, `error`, `ms`, bodies it stands in for) |
| `ui.set` | any `UiState` field (`tab`, `perspective`, `showGrid`, `dark`, `layout`, …), and `hiddenBodies`, `hiddenOrigin`, `hiddenSketches`, `shownSketches`, `hiddenJoints`, `hiddenFolders` (whole lists; `browser.visibility` changes single items) | `dark: false` switches to the light theme; `layout: "floating"` (default) or `"docked"` selects the transient shell layout without saving a preference. Scenarios use `{"call":"ui.set","params":{"layout":"docked"}}` |
-| `ui.view` | `view`: `front`, `back`, `top`, `bottom`, `left`, `right`, `iso`, `home`, `fit` | |
+| `ui.view` | `view`: `front`, `back`, `top`, `bottom`, `left`, `right`, `iso`, `home`, `fit`; `animate` (bool, default false: snap) | |
| `ui.camera` | `target?`: `[x, y, z]` (mm), `yaw?`, `pitch?`, `roll?` (radians), `distance?` (mm), `fov?`, `up?`; `fit?`: `true`, `false` or `[occurrence id or name…]` (`root`: the bodies outside every component) | the viewport's orbit camera: it looks at `target` from `distance` away; `yaw` 0 looks along +Y (from the front), `pitch` is the elevation (±π/2: straight down or up), `roll` turns the image. Fields given are set first (the others keep their values), then `fit` frames the listed occurrences (or everything), keeping the direction. The reply, passed back, sets the same view again, so a framing can be stored and replayed. `fov` and `up` follow the perspective setting (`ui.set`) and the up axis preference (`ui.prefs`) and can't change here; a refused field changes nothing |
| `ui.start` | `command`, `params?` | like a toolbar click: starts the sketch tool or dialog for the command. `params` sets what the dialog opens on, and nothing runs until OK: `joint.drive` takes `joint` (id or name; without it, the joint picked in the browser, else the first joint that moves) and `values` (numbers in degrees or millimetres, or expressions); `motion.study` takes `study` (id or name), which opens that study to edit and chart. A command that takes no params is refused before it starts; a param the dialog doesn't take is refused and the dialog closes |
| `ui.click` | `x`, `y` (screen points), `button?`: left/right/middle, `shift?`, `ctrl?`, `double?` | real pointer input |
@@ -205,7 +205,7 @@ labels; `prefs:measure_axis_distances` identifies the checkbox.
| `ui.home` | `open?`: bool; `sample?`: index | the start page: show or hide it, open a built-in sample (once built); returns `open` and the recent designs |
| `ui.shortcut` | `command`, `key?`, `replace?` | a command's key, or rebinds it (`""` clears; a key another command uses is refused unless `replace`) |
| `ui.help` | `item?`: `about`, `shortcuts` (read only), `report` (opens a report draft for review), `crashes` (the Crash Reports window) | the version, commit, build date and diagnostic text |
-| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner; the view redraws every frame while it is on), `length_decimals`, `angle_decimals`, `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ja`, `de`, `fr`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `offer_stand_up`, `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `check_updates` (default true; [updates](book/src/guide/updates.md)); `open` (a page: General, Navigation, Keyboard Shortcuts, Design, Graphics, Sketch, Selection, AI) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark` and `stand_up_offer` |
+| `ui.prefs` | any of `default_units`, `nav` (`fusion`, `solidworks`, `inventor`, `alias`, `blender`, `tinkercad`, `openscad`, `touchpad`), `zoom_reverse`, `pan_reverse_x` (default false: horizontal scrolling pans the other way), `zoom_to_cursor`, `smooth_wheel_zoom` (default true), `trackpad_pan` (default true: two-finger scroll pans, except Touchpad always zooms; pinch zooms), `orbit_around` (`view_centre` (default: what Pan moves and Fit frames), `origin` (the world origin stays still on screen), `cursor` (the model point under the pointer when the drag began); the older `orbit_cursor` boolean still sets `cursor` when true), `look_at_anim`, `look_at_speed`, `middle_double_click` (`home` (default), `fit`, `off`), `msaa`, `show_frame_rate` (default false: frames per second in the view's bottom-right corner; the view redraws every frame while it is on), `length_decimals`, `angle_decimals`, `theme` (`dark`, `light`, `system` or a theme file's id: a built-in one such as `gruvbox-dark`, or an imported one; the reply's `theme_ids` lists them), `theme_import` (a `solidcraft-theme/1` file's JSON or text: adds the theme and turns it on; the reply's `theme_imported` is its id), `theme_remove` (an imported theme's id), `theme_export: true` (the reply's `theme_file` is the theme on now as a complete file; see [colour themes](book/src/guide/ui-tour.md#colour-themes)), `language` (`en`, `ja`, `de`, `fr`, `ko`, `ms`, `ru`, `uk`, `zh`; see [localization](localization.md)), `ui_scale`, `ui_font` (an installed font family or a font file for the interface; empty for the built-in font), `up_axis` (`z`, `y`), `offer_stand_up`, `color_vision` (`off` (default), `protan`, `deutan`, `tritan`: colour vision modes, #778), `check_updates` (default true; [updates](book/src/guide/updates.md)); `open` (a page: General, Navigation, Keyboard Shortcuts, Design, Graphics, Sketch, Selection, AI) opens the Preferences dialog there; `button`: `ok`, `cancel`, `apply`, `defaults`; `stand_up: true` stands up a just-opened Y-up file, `stand_up: false` leaves it as it is ("Leave it": the offer closes and `offer_stand_up` stays on); the offer's buttons are the handles `stand_up:stand`, `stand_up:leave` and `stand_up:never` | sets preferences (kept between runs), returns them all plus `dialog` (the open page or null), `dark` and `stand_up_offer` |
| `ui.capture` | `action?`: `capture`, `revert`, `cancel` | answers the Capture Position question (asked when a command starts or the design is saved while components were moved without capturing); without `action`, what waits |
| `ui.window` | `action`: minimize, maximize, restore, toggle, close | what the title bar's caption buttons do (on Windows and Linux the application bar is the title bar); close asks about unsaved designs first |
| `ui.agent_cursor` | `show` (bool), `speed`: a number from 1 to 5 (times the normal speed) or `"instant"` (no animation: the command runs at once and the pointer jumps to where it acted), `follow_camera` (bool); all optional | the settings. While the cursor is shown, `engine.execute` first glides to the command's toolbar button and to each pick, then runs and replies; later requests wait their turn. `"animate": false` on a call skips it |
diff --git a/docs/i18n_catalog_ja.md b/docs/i18n_catalog_ja.md
index 930b85a6cf..002d3286f4 100644
--- a/docs/i18n_catalog_ja.md
+++ b/docs/i18n_catalog_ja.md
@@ -56,7 +56,9 @@
| Angle decimals | 角度の小数点以下の桁数 | `ui.angle_decimals` |
| angle, height | 角度, 高さ | `angle, height` |
| Animate | アニメーション | `Animate` |
+| Animate view changes | 視点変更をアニメーション表示 | `ui.animate_view_changes` |
| Animation | アニメーション | `ui.animation` |
+| Animation speed | アニメーション速度 | `ui.animation_speed` |
| Anti-aliasing | アンチエイリアス | `ui.anti_aliasing` |
| Anti-aliasing applies the next time SolidCraft starts | アンチエイリアスは次回 SolidCraft を起動したときに適用されます | `settings.msaa_applies_on_restart` |
| Appearance | 外観 | `cmd.appearance_assign` |
@@ -84,6 +86,7 @@
| Axis Through Edge | エッジを通る軸 | `cmd.construct_axis_edge` |
| Axis Through Two Planes | 2平面を通る軸 | `cmd.construct_axis_two_planes` |
| Axis Through Two Points | 2点を通る軸 | `cmd.construct_axis_two_points` |
+| Axis view, Look At, Home and Fit | 軸ビュー、正面視、ホーム、全体表示 | `ui.look_at_anim_desc` |
| Base point | 基点 | `ui.base_point` |
| Bend Line Position | 曲げ線位置 | `Bend Line Position` |
| Bend Position | 曲げ位置 | `Bend Position` |