diff --git a/assets/locales/cs.json b/assets/locales/cs.json index ad5a50c04..8933c00fc 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 9f15c4899..3117b6b44 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 4ee9d6a50..258e427bd 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 9b22c4e7c..61b14e890 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 938aa72f6..366165d7f 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 27318a26c..79008268e 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 3af7f3cd2..39fc3c8c4 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 bd712ad81..9c56b3242 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 46e1ca73e..0e9039f4c 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 854570f34..5d18bc177 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 868a0d4e7..a089aa8eb 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 8a80675f7..b08c59f34 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 a299a44a8..ea47d78cd 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 cbb087dbb..a61476c96 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 ce10bfb73..4ca63d120 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 a50d42098..795332233 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 654e79cca..e62ec4590 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 eed32d1cd..bc45bb01d 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 ad7f24add..1190c7463 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 2879a141f..f4b549b4c 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 d7f2dacdd..c22a70c77 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 b85d4d3e0..389258bfe 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 2528f3417..938140f00 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 938f03cbd..8e25bf27d 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 704c44f07..9b1e36643 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 = 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 640abfccd..4f9e70be7 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 7b2a6d52d..3826e9484 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 69b83ca21..db7bbbc28 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 d9050e9ac..84e065204 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, /// 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() { - self.cam = to; + 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 8a1e11a09..753f8422c 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 c70b3e799..70a6d3ce3 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 349ccc4e8..5ec2d7348 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 b5d77a8e2..f0974003e 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 8b77ec164..eba5d7c2c 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 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 f5e62c1f9..23408069a 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 dbc0af57f..5e0170f30 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: