Remove camera animation: every view change and orbit applies at once (#4296)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
bherbruckandClaude Sonnet 5.5 authored and GitHub committed 2026-10-21 11:19:40 -04:00
1 parent 775e5155bb
commit cb3cabeda1
50 files changed
+94 -617

No files matched your search

-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1295,9 +1295,7 @@
"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",
@@ -1559,7 +1557,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1293,9 +1293,7 @@
"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",
@@ -1557,7 +1555,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1295,9 +1295,7 @@
"ui.angle": "角度",
"ui.angle_decimals": "角度の小数点以下の桁数",
"ui.animateJoint": "ジョイントをアニメート",
"ui.animate_view_changes": "視点変更をアニメーション表示",
"ui.animation": "アニメーション",
"ui.animation_speed": "アニメーション速度",
"ui.anti_aliasing": "アンチエイリアス",
"ui.apply": "適用",
"ui.arc": "円弧",
@@ -1559,7 +1557,6 @@
"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": "製造",
-3
View File
@@ -1287,9 +1287,7 @@
"ui.angle": "각도",
"ui.angle_decimals": "각도 소수점 자릿수",
"ui.animateJoint": "조인트 애니메이션",
"ui.animate_view_changes": "뷰 변경 애니메이션",
"ui.animation": "애니메이션",
"ui.animation_speed": "애니메이션 속도",
"ui.anti_aliasing": "안티앨리어싱",
"ui.apply": "적용",
"ui.arc": "호",
@@ -1551,7 +1549,6 @@
"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": "제조",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"ui.angle": "Угол",
"ui.angle_decimals": "Знаков после запятой (углы)",
"ui.animateJoint": "Анимировать сопряжение",
"ui.animate_view_changes": "Анимировать смену вида",
"ui.animation": "Анимация",
"ui.animation_speed": "Скорость анимации",
"ui.anti_aliasing": "Сглаживание",
"ui.apply": "Применить",
"ui.arc": "Дуга",
@@ -1551,7 +1549,6 @@
"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": "Производство",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"ui.angle": "Кут",
"ui.angle_decimals": "Знаки після коми для кутів",
"ui.animateJoint": "Анімувати з'єднання",
"ui.animate_view_changes": "Анімувати зміни виду",
"ui.animation": "Анімація",
"ui.animation_speed": "Швидкість анімації",
"ui.anti_aliasing": "Згладжування",
"ui.apply": "Застосувати",
"ui.arc": "Дуга",
@@ -1551,7 +1549,6 @@
"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": "Виготовлення",
-3
View File
@@ -1287,9 +1287,7 @@
"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",
@@ -1551,7 +1549,6 @@
"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",
-3
View File
@@ -1287,9 +1287,7 @@
"ui.angle": "角度",
"ui.angle_decimals": "角度小數位數",
"ui.animateJoint": "動畫接頭",
"ui.animate_view_changes": "檢視變化動畫",
"ui.animation": "動畫",
"ui.animation_speed": "動畫速度",
"ui.anti_aliasing": "抗鋸齒",
"ui.apply": "套用",
"ui.arc": "圓弧",
@@ -1551,7 +1549,6 @@
"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": "製造",
-3
View File
@@ -1295,9 +1295,7 @@
"ui.angle": "角度",
"ui.angle_decimals": "角度小数位",
"ui.animateJoint": "动画接头",
"ui.animate_view_changes": "视图变化动画",
"ui.animation": "动画",
"ui.animation_speed": "动画速度",
"ui.anti_aliasing": "抗锯齿",
"ui.apply": "应用",
"ui.arc": "圆弧",
@@ -1559,7 +1557,6 @@
"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": "制造",
+1 -112
View File
@@ -72,13 +72,6 @@ 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 {
@@ -151,36 +144,6 @@ 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)]
@@ -517,29 +480,13 @@ mod tests {
}
#[test]
fn view_animation_interpolates() {
fn orientation_round_trips_and_looks_from_a_corner() {
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);
@@ -574,64 +521,6 @@ 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]
+1 -1
View File
@@ -27,7 +27,7 @@ pub use backend::{
RenderMode, RenderOperation, RenderPolicy, RenderProfile, RenderRequest, ResolveError, ResolvedRequest, ScratchLayout, builtin_backend,
resolve_request,
};
pub use camera::{Camera, CameraAnim, Mat4, Quat, StandardView, UpAxis, ease_in_out};
pub use camera::{Camera, Mat4, Quat, StandardView, UpAxis};
pub use curve_display::{PixelCurveView, SampledPath, SamplingBudget, SamplingQuality, sample_segment, sample_segment_unclipped};
pub use gif::gif;
pub use product::{FaceAppearance, ProductMesh, ProductScene};
-26
View File
@@ -386,15 +386,7 @@ fn dispatch(app: &mut SolveApp, ctx: &egui::Context, method: &str, p: &Value) ->
}
"ui.view" => {
let v = s("view").unwrap_or("home");
app.viewport.orbit_snap = None;
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(),
@@ -887,7 +879,6 @@ fn camera(app: &mut SolveApp, p: &Value) -> Result<Value, String> {
return serde_json::to_value(app.cam).map_err(|e| e.to_string());
}
app.cancel_view_animation();
app.viewport.orbit_snap = None;
app.viewport.orbit_free = None;
app.cam = cam;
match fit {
@@ -1416,23 +1407,6 @@ 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}");
+2 -3
View File
@@ -2780,9 +2780,8 @@ 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 Some(mut to) = app.cam_anim.as_ref().map(|a| a.to)
{
if let Sel::Face { point, .. } = sel {
let mut to = app.cam;
to.target = *point;
app.animate_to(to);
}
-1
View File
@@ -119,7 +119,6 @@ fn swap_in(app: &mut SolveApp, slot: DocSlot) -> DocSlot {
app.design_properties = None;
app.bom = None;
app.cancel_view_animation();
app.viewport.orbit_snap = None;
app.viewport.orbit_free = None;
app.preview.reset();
app.viewport.hover = None;
-1
View File
@@ -642,7 +642,6 @@ pub fn show(app: &mut SolveApp, ctx: &egui::Context) {
app.viewport.boxsel = None;
app.viewport.axis_drag = None;
app.viewport.orbit_free = None;
app.viewport.orbit_snap = None;
crate::dim_view::drag_end();
crate::sketch3d::drag_end();
crate::drag_snap::clear();
+5 -40
View File
@@ -238,7 +238,7 @@ use std::sync::mpsc::Receiver;
use serde::{Deserialize, Serialize};
use serde_json::{Value, json};
use solidcraft_engine::Session;
use solidcraft_engine::render::{Camera, CameraAnim, StandardView};
use solidcraft_engine::render::{Camera, StandardView};
pub use control::{ControlRequest, ControlResponse};
@@ -353,8 +353,6 @@ 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).
@@ -524,7 +522,6 @@ 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,
@@ -1205,7 +1202,6 @@ 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();
@@ -1225,8 +1221,6 @@ impl SolveApp {
}
return;
}
self.cam_anim = None;
self.viewport.orbit_snap = None;
self.viewport.orbit_free = None;
let bounds = viewport::view_bounds(self);
self.pending_fit = Some((self.cam, bounds, false));
@@ -1236,7 +1230,6 @@ impl SolveApp {
/// Frame `bounds` at once, keeping the view direction (programmatic use).
pub fn fit_bounds(&mut self, bounds: solidcraft_engine::geom::Aabb3) {
self.cancel_view_animation();
self.viewport.orbit_snap = None;
self.viewport.orbit_free = None;
self.pending_fit = Some((self.cam, bounds, false));
self.cam = self.fitted_bounds(self.cam, &bounds);
@@ -1273,32 +1266,19 @@ impl SolveApp {
self.animate_to(to);
} else {
self.cam = to;
self.cam_anim = None;
}
ctx.request_repaint();
}
}
/// Move the camera to `to` over half a second (ease in-out, orientation slerped).
/// 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.
pub fn animate_to(&mut self, to: Camera) {
self.pending_fit = None;
self.viewport.orbit_snap = None;
self.viewport.orbit_free = None;
if !to.is_valid() {
return;
}
// Preferences › Navigation: animated (at a chosen speed) or immediate.
if !self.preferences.look_at_anim {
if to.is_valid() {
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).
@@ -1375,38 +1355,24 @@ impl SolveApp {
self.animate_to(to);
} else if to.is_valid() {
self.cancel_view_animation();
self.viewport.orbit_snap = None;
self.viewport.orbit_free = None;
self.cam = to;
}
}
/// Stop any view animation where it is (the user took over the camera).
/// Drop a pending refit (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
/// immediately taking it back on the next frame.
pub fn begin_external_navigation(&mut self) {
self.cancel_view_animation();
self.viewport.orbit_snap = None;
self.viewport.orbit_free = None;
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);
@@ -1436,7 +1402,6 @@ 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);
-2
View File
@@ -11,7 +11,6 @@ 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();
@@ -53,7 +52,6 @@ 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);
+2 -2
View File
@@ -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_anim.map(|a| a.to), Some(saved), "animates back to the saved camera");
assert_eq!(app.cam, saved, "goes back to the saved camera at once");
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!(app.cam_anim.is_some());
assert_ne!(app.cam, saved);
}
#[test]
+34 -113
View File
@@ -171,7 +171,6 @@ pub(crate) fn modifier_motion(
app.viewport.orbit_pivot = None;
app.viewport.orbit_from = None;
app.viewport.orbit_free = None;
app.viewport.orbit_snap = None;
}
app.viewport.modifier_nav = next;
next.map(|(mode, p)| {
@@ -237,10 +236,7 @@ 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 });
// 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}));
let _ = app.run("view.navigate", json!({"camera": app.cam, "action": action, "degrees": degrees}));
}
true
}
@@ -270,7 +266,6 @@ pub(crate) fn step_key_hold(app: &mut SolveApp, ctx: &egui::Context) {
&& cam.is_valid()
{
app.cancel_view_animation();
app.viewport.orbit_snap = None;
app.viewport.orbit_free = None;
app.cam = cam;
}
@@ -375,7 +370,6 @@ pub(crate) fn handle(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect, resp: &e
let pinch = ui.input(pinch_factor);
let h = rect.height().max(1.0) as f64;
if inside && pinch != 1.0 {
app.viewport.orbit_snap = None;
app.viewport.orbit_free = None;
// Spread zooms in: the camera distance shrinks by the pinch factor.
let f = f64::from(pinch).powf(-crate::prefs::zoom_sign(app));
@@ -392,7 +386,6 @@ pub(crate) fn handle(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect, resp: &e
}
}
if inside && scroll != 0.0 {
app.viewport.orbit_snap = None;
app.viewport.orbit_free = None;
let f = (-scroll as f64 * 0.0015 * crate::prefs::zoom_sign(app)).exp();
let anchor = zoom_anchor(app, rect, hover, caps.orbit);
@@ -409,7 +402,6 @@ pub(crate) fn handle(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect, resp: &e
}
// Two-finger scroll pans the model with the fingers.
if inside && pan != egui::Vec2::ZERO {
app.viewport.orbit_snap = None;
app.viewport.orbit_free = None;
if app.preferences.nav == crate::prefs::TOUCHPAD_NAV {
camera_motion(app, rect, json!({"motion":"pan","delta":[pan.x,pan.y]}));
@@ -522,9 +514,6 @@ pub(crate) fn handle(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect, resp: &e
};
orbit_drag(app, rect, f64::from(delta.x), f64::from(delta.y), press, snap, true);
} else {
if matches!(mode, Some(NavMode::Pan | NavMode::Zoom)) {
app.viewport.orbit_snap = None;
}
if app.viewport.axis_drag.is_none() {
app.viewport.orbit_free = None;
}
@@ -567,15 +556,9 @@ pub(crate) fn handle(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect, resp: &e
}
if !app.cam.is_valid() {
app.viewport.orbit_free = None;
app.viewport.orbit_snap = None;
app.cam = Camera::default();
app.fit_view();
}
step_orbit_snap(app, rect, ui.input(|i| f64::from(i.stable_dt)));
if app.viewport.orbit_snap.is_some() {
ui.ctx().request_repaint();
}
CameraInput { hover, scroll, mods, middle, secondary_down, primary_down, primary_pressed, delta, inside, axes, pinch, pan, primary_nav, mode }
}
@@ -631,19 +614,13 @@ pub(crate) fn snapped_axis_camera(cam: Camera) -> Camera {
to
}
pub(crate) struct OrbitSnap {
pub(crate) target: Camera,
pub(crate) yaw_velocity: f64,
pub(crate) pitch_velocity: f64,
/// The pivot and where it lies in the camera's frame ([`Camera::frame_coords`]).
pub(crate) pivot: Option<(Vec3, Vec3)>,
}
/// Pointer motion accumulates independently of the spring preview, so many small deltas
/// still cross snap boundaries. Keep a small angular margin to avoid boundary flicker.
/// Orbit by a pointer drag. With `snap` the displayed view is the nearest standard or diagonal
/// direction at once; the unsnapped orbit is kept in `orbit_free` so many small deltas still
/// cross snap boundaries. A small angular margin avoids flicker at a boundary.
pub(crate) fn orbit_drag(app: &mut SolveApp, rect: Rect, dx: f64, dy: f64, press: Option<Pos2>, snap: bool, around_cursor: bool) {
let displayed = app.cam;
if let Some(free) = app.viewport.orbit_free.take() {
let previous_free = app.viewport.orbit_free.take();
if let Some(free) = previous_free {
app.cam = free;
}
if around_cursor {
@@ -653,62 +630,31 @@ pub(crate) fn orbit_drag(app: &mut SolveApp, rect: Rect, dx: f64, dy: f64, press
}
let free = app.cam;
app.viewport.orbit_free = Some(free);
if snap || !around_cursor || app.viewport.orbit_snap.is_some() {
let mut target = if snap { snapped_axis_camera(free) } else { free };
if snap && let Some(previous) = app.viewport.orbit_snap.as_ref() {
let b = free.back();
if previous.target.back().dot(b) + 0.025 >= target.back().dot(b) {
target.yaw = previous.target.yaw;
target.pitch = previous.target.pitch;
}
if !snap {
return;
}
let mut target = snapped_axis_camera(free);
// Keep the direction already chosen unless the orbit has clearly left it.
if previous_free.is_some_and(|p| p != displayed) {
let b = free.back();
if displayed.back().dot(b) + 0.025 >= target.back().dot(b) {
target.yaw = displayed.yaw;
target.pitch = displayed.pitch;
}
// The cursor and origin pivots stay still while a snap eases in; the axis gizmo has no
// pivot (it orbits about the view centre, see `axis_view`).
let pivot = if around_cursor {
match app.preferences.orbit_around {
crate::prefs::OrbitAround::Origin => Some(Vec3::ZERO),
_ => app.viewport.orbit_pivot,
}
} else {
None
}
// The cursor and origin pivots stay still; the axis gizmo has no pivot (it orbits about the
// view centre, see `axis_view`).
let pivot = if around_cursor {
match app.preferences.orbit_around {
crate::prefs::OrbitAround::Origin => Some(Vec3::ZERO),
_ => app.viewport.orbit_pivot,
}
.map(|p| (p, displayed.frame_coords(p)));
let spring = app.viewport.orbit_snap.get_or_insert(OrbitSnap { target, yaw_velocity: 0.0, pitch_velocity: 0.0, pivot });
spring.target = target;
spring.pivot = pivot;
app.cam = displayed;
}
}
/// A lightly damped spring: mostly settled in about a third of a second, with a small
/// elastic finish. Bounded substeps keep the behavior consistent across frame rates.
pub(crate) fn step_orbit_snap(app: &mut SolveApp, _rect: Rect, dt: f64) {
let Some(mut spring) = app.viewport.orbit_snap.take() else { return };
let dt = if dt.is_finite() { dt.clamp(0.0, 0.05) } else { 1.0 / 60.0 };
let steps = (dt * 240.0).ceil().max(1.0) as usize;
let h = dt / steps as f64;
let omega = 16.0;
let damping = 0.82;
let yaw_error = |yaw: f64| (spring.target.yaw - yaw + std::f64::consts::PI).rem_euclid(std::f64::consts::TAU) - std::f64::consts::PI;
for _ in 0..steps.min(12) {
spring.yaw_velocity += (omega * omega * yaw_error(app.cam.yaw) - 2.0 * damping * omega * spring.yaw_velocity) * h;
spring.pitch_velocity += (omega * omega * (spring.target.pitch - app.cam.pitch) - 2.0 * damping * omega * spring.pitch_velocity) * h;
app.cam.yaw += spring.yaw_velocity * h;
app.cam.pitch = (app.cam.pitch + spring.pitch_velocity * h).clamp(-std::f64::consts::FRAC_PI_2, std::f64::consts::FRAC_PI_2);
}
app.cam.target = spring.target.target;
let done = yaw_error(app.cam.yaw).abs() < 1e-5
&& (spring.target.pitch - app.cam.pitch).abs() < 1e-5
&& spring.yaw_velocity.abs() < 1e-4
&& spring.pitch_velocity.abs() < 1e-4;
if done {
app.cam = spring.target;
}
if let Some((pivot, coords)) = spring.pivot {
app.cam.place(pivot, coords);
}
if !done {
app.viewport.orbit_snap = Some(spring);
} else {
None
};
app.cam = target;
if let Some(p) = pivot {
app.cam.place(p, displayed.frame_coords(p));
}
}
@@ -970,7 +916,6 @@ 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);
@@ -1013,22 +958,20 @@ 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:
/// one animation at most, never a second one fighting the first.
/// Holding an arrow turns the view steadily, by frame time, whatever the key repeat does.
#[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 {
@@ -1039,9 +982,8 @@ 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 stops or reverses while held: {deltas:?}");
assert!(deltas.iter().all(|d| *d >= 0.0), "the view never 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:?}");
@@ -1054,34 +996,14 @@ mod view_key_tests {
assert!((hold(false) - hold(true)).abs() < 1e-9, "OS key repeat changes nothing");
}
/// A tap is still one animated step of 15°, with one animation.
/// A tap is one step of 15°, applied in the frame of the press, and a second tap adds to it.
#[test]
fn a_tap_is_one_animated_step() {
fn a_tap_is_one_instant_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);
}
@@ -1090,7 +1012,6 @@ 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;
+18 -29
View File
@@ -272,7 +272,6 @@ 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"}));
@@ -509,43 +508,33 @@ 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 cube_navigation_eases_through_intermediate_views_and_can_be_interrupted() {
fn a_mouse_orbit_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"}));
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();
}
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 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}));
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);
let done = h.app.cam;
h.frames(30);
assert_eq!(h.app.cam, done, "nothing keeps easing after the pointer stops");
}
#[test]
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"}));
+6 -12
View File
@@ -287,7 +287,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 (look_at_speed).
// Accepted control-channel ranges may differ from slider ranges.
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)]
@@ -433,9 +433,6 @@ 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`).
@@ -1227,8 +1224,6 @@ 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);
for (axis, name) in SPACE_MOUSE_AXES.iter().enumerate() {
@@ -1732,8 +1727,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) || !accepted::look_at_speed(&new) {
return Err("`ui_scale` must be 0.5…2.5 and `look_at_speed` 0.25…4".into());
if !accepted::ui_scale(&new) {
return Err("`ui_scale` must be 0.5…2.5".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());
@@ -2052,7 +2047,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", "look_at_anim":false}));
h.call("ui.prefs", json!({"navigator_style":"axes"}));
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}));
@@ -2280,7 +2275,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", "look_at_anim": false})).unwrap();
control(&mut app, &json!({"open": "Navigation", "nav": "alias"})).unwrap();
control(&mut app, &json!({"button": "apply"})).unwrap();
control(&mut app, &json!({"nav": "tinkercad"})).unwrap();
control(&mut app, &json!({"button": "cancel"})).unwrap();
@@ -2291,12 +2286,11 @@ mod tests {
c
};
app.animate_to(to);
assert!(app.cam_anim.is_none() && app.cam == to, "no animation: the view jumps");
assert!(app.cam == to, "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);
@@ -588,7 +588,6 @@ 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);
+3 -44
View File
@@ -22,8 +22,7 @@
//! 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; `{"view_anim": "top",
//! "max_deg": 10}` animates to a view and fails if any frame turns the view more than that
//! - `{"camera": {"yaw": rad, "pitch": rad}}` puts the camera at an orbit
//! - 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)
@@ -269,7 +268,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() && self.app.cam_anim.is_none() && self.app.viewport.orbit_snap.is_none() {
if self.app.synthetic.is_empty() {
break;
}
self.frame();
@@ -378,36 +377,6 @@ 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() && self.app.viewport.orbit_snap.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() && self.app.viewport.orbit_snap.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);
@@ -515,13 +484,10 @@ 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(());
@@ -687,14 +653,7 @@ 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°),
// once any view animation has finished.
for _ in 0..240 {
if h.app.cam_anim.is_none() {
break;
}
h.frame();
}
// looks from (yaw and pitch in its up-axis frame, ±0.5°).
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"]) {
@@ -10,7 +10,6 @@ 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]]})),
@@ -8,7 +8,6 @@ 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();
@@ -73,7 +72,6 @@ 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;
+2 -6
View File
@@ -1450,12 +1450,8 @@ fn assistant_button(app: &mut SolveApp, ui: &mut egui::Ui, at: Rect) {
ui.painter().circle_filled(c, 4.0, color);
}
AssistantMark::Busy => {
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.ctx().request_repaint();
let phase = ui.input(|i| i.time) as f32 * 3.0;
ui.painter().circle_filled(c, 6.0, ring);
let points = (0..=24)
.map(|i| {
-1
View File
@@ -13,7 +13,6 @@ 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();
}
+14 -62
View File
@@ -12,7 +12,7 @@ use solidcraft_engine::view::{GridPlane, colors, grid_plane, grid_step, sketch_l
use std::hash::{Hash, Hasher};
use crate::gpu::{Frame, GpuScene, GpuTarget, SceneSlot, ViewportCallback};
use crate::navigation::{CameraInput, NavCaps, OrbitSnap, orbit_drag};
use crate::navigation::{CameraInput, NavCaps, orbit_drag};
use crate::selection::{BoxSel, origin_quads, origin_size, ray_quad};
use crate::theme::Tokens;
use crate::{SolveApp, icons};
@@ -132,8 +132,6 @@ pub struct ViewportState {
pub axis_drag: Option<Pos2>,
/// Unsnapped camera while Shift-orbit previews a standard or diagonal view.
pub orbit_free: Option<Camera>,
/// Spring toward the chosen orientation, including after the drag ends.
pub(crate) orbit_snap: Option<OrbitSnap>,
pub build_ms: f64,
/// Adaptive supersampling (#1288): the view drawn last (its view-projection and pixels) and
/// since when it has held still (app time, s).
@@ -2427,9 +2425,7 @@ 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.orbit_snap.is_some()
|| app.cam_anim.is_some();
|| app.viewport.spin;
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.
@@ -3751,14 +3747,7 @@ fn signed_axis_view(app: &mut SolveApp, ui: &mut egui::Ui, rect: Rect) {
if frame.z.abs() > 0.5 {
to.yaw = nearest_quarter_turn(app.cam.yaw);
}
if app.preferences.look_at_anim {
app.cancel_view_animation();
app.viewport.orbit_free = None;
app.viewport.orbit_snap = Some(OrbitSnap { target: to, yaw_velocity: 0.0, pitch_velocity: 0.0, pivot: None });
ui.ctx().request_repaint();
} else {
app.animate_to(to);
}
app.animate_to(to);
}
}
let home = Rect::from_center_size(pos2(c.x - 37.0, c.y - 37.0), vec2(18.0, 18.0));
@@ -5275,14 +5264,6 @@ 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
@@ -6255,17 +6236,13 @@ mod tests {
let before = h.app.cam;
for _ in 0..100 {
orbit_drag(&mut h.app, rect, 2.0, 0.0, None, true, false);
step_orbit_snap(&mut h.app, rect, 1.0 / 60.0);
}
for _ in 0..120 {
step_orbit_snap(&mut h.app, rect, 1.0 / 60.0);
}
assert!((h.app.cam.yaw - std::f64::consts::FRAC_PI_2).abs() < 1e-6);
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);
h.settle();
assert!((h.app.cam.yaw - 1.6).abs() < 1e-6);
h.frames(2);
assert!(h.app.viewport.orbit_free.is_none());
}
@@ -6286,49 +6263,33 @@ mod tests {
}
#[test]
fn camera_resets_cancel_pending_axis_motion() {
fn camera_resets_drop_the_unsnapped_orbit() {
for reset in 0..3 {
let mut h = crate::scenario::Harness::new();
h.app.run("solid.box", json!({"length":10,"width":10,"height":10})).unwrap();
let rect = h.app.viewport.rect.unwrap();
orbit_drag(&mut h.app, rect, 120.0, 40.0, None, true, false);
assert!(h.app.viewport.orbit_snap.is_some());
assert!(h.app.viewport.orbit_free.is_some());
match reset {
0 => h.app.fit_view(),
1 => h.app.set_up_axis(solidcraft_engine::render::UpAxis::Y),
_ => crate::documents::new_design(&mut h.app),
}
let before = h.app.cam;
step_orbit_snap(&mut h.app, rect, 1.0 / 60.0);
assert_eq!(h.app.cam.yaw, before.yaw);
assert_eq!(h.app.cam.pitch, before.pitch);
assert_eq!(h.app.cam.target, before.target);
assert!(h.app.viewport.orbit_snap.is_none());
assert!(h.app.viewport.orbit_free.is_none());
}
}
#[test]
fn axis_snap_spring_eases_in_and_settles_at_each_frame_rate() {
for fps in [30, 60, 120] {
let mut h = crate::scenario::Harness::new();
h.call("ui.view", json!({"view":"front"}));
let rect = h.app.viewport.rect.unwrap();
orbit_drag(&mut h.app, rect, 120.0, 0.0, None, true, false);
assert_eq!(h.app.cam.yaw, 0.0, "choosing a diagonal must not jump the camera");
step_orbit_snap(&mut h.app, rect, 1.0 / f64::from(fps));
assert!(h.app.cam.yaw > 0.0 && h.app.cam.yaw < std::f64::consts::FRAC_PI_4 * 0.25);
for _ in 0..fps * 2 {
step_orbit_snap(&mut h.app, rect, 1.0 / f64::from(fps));
assert!(h.app.cam.yaw <= std::f64::consts::FRAC_PI_4 + 0.03, "elastic finish stays small");
}
assert!((h.app.cam.yaw - std::f64::consts::FRAC_PI_4).abs() < 1e-6);
assert!(h.app.viewport.orbit_snap.is_none());
}
fn axis_snap_is_applied_at_once() {
let mut h = crate::scenario::Harness::new();
h.call("ui.view", json!({"view":"front"}));
let rect = h.app.viewport.rect.unwrap();
orbit_drag(&mut h.app, rect, 120.0, 0.0, None, true, false);
assert!((h.app.cam.yaw - std::f64::consts::FRAC_PI_4).abs() < 1e-6, "the snapped view shows in the same frame");
}
/// The origin pivot holds through a Shift drag that snaps to an axis: the spring eases the
/// view round without letting the origin slide on screen.
/// The origin pivot holds through a Shift drag that snaps to an axis: the snapped
/// view turns without letting the origin slide on screen.
#[test]
fn snapping_keeps_the_origin_still() {
let mut h = crate::scenario::Harness::new();
@@ -6338,15 +6299,9 @@ mod tests {
let rect = h.app.viewport.rect.unwrap();
let at = rect.center() + vec2(50.0, -20.0);
orbit_drag(&mut h.app, rect, 0.0, 0.0, Some(at), true, true);
assert_eq!(
h.app.viewport.orbit_snap.as_ref().and_then(|s| s.pivot).map(|(p, _)| p),
Some(Vec3::ZERO),
"the origin is the pivot while snapping"
);
let before = projection(&h.app, rect).to_screen(Vec3::ZERO).unwrap();
for _ in 0..30 {
orbit_drag(&mut h.app, rect, 4.0, 2.0, Some(at), true, true);
step_orbit_snap(&mut h.app, rect, 1.0 / 60.0);
let after = projection(&h.app, rect).to_screen(Vec3::ZERO).unwrap();
assert!(after.distance(before) < 2.0, "{before:?} -> {after:?}");
}
@@ -6444,7 +6399,6 @@ mod tests {
let before = projection(&h.app, rect).to_screen(pivot).unwrap();
for _ in 0..20 {
orbit_drag(&mut h.app, rect, 4.0, 2.0, Some(at), true, true);
step_orbit_snap(&mut h.app, rect, 1.0 / 60.0);
let after = projection(&h.app, rect).to_screen(pivot).unwrap();
assert!(after.distance(before) < 2.0);
}
@@ -6454,7 +6408,6 @@ mod tests {
let before = h.app.cam;
h.call("ui.drag", json!({"x0":800,"y0":500,"x1":1020,"y1":500,"button":"middle","shift":true,"steps":40}));
assert!((h.app.cam.yaw - 1.76).abs() < 1e-6, "before={before:?}, after={:?}", h.app.cam);
assert!(h.app.viewport.orbit_snap.is_none());
h.call("ui.view", json!({"view":"front"}));
h.call("ui.drag", json!({"x0":800,"y0":500,"x1":850,"y1":520,"button":"middle"}));
assert_eq!(h.app.cam.yaw, before.yaw);
@@ -6476,7 +6429,6 @@ mod tests {
assert!((h.app.cam.pitch - expected.pitch).abs() < 1e-6, "{preset}: {:?}", h.app.cam);
assert_eq!(h.app.cam.target, before.target);
assert_eq!(h.app.cam.distance, before.distance);
assert!(h.app.viewport.orbit_snap.is_none());
h.call("ui.view", json!({"view":"front"}));
h.call("ui.drag", json!({"x0":800,"y0":500,"x1":1020,"y1":500,"button":"right","shift":true,"steps":40}));
assert!((h.app.cam.yaw - std::f64::consts::FRAC_PI_2).abs() < 1e-6, "{preset}: {:?}", h.app.cam);
@@ -116,12 +116,10 @@ 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);
@@ -143,7 +141,6 @@ 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}));
@@ -24,7 +24,6 @@ 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));
@@ -1,74 +0,0 @@
[
{
"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"
}
]
@@ -1,5 +1,5 @@
[
{"call":"ui.prefs","params":{"look_at_anim":false}},
{"call":"ui.prefs","params":{}},
{"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]]}}},
+3 -2
View File
@@ -134,9 +134,10 @@ 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. It is independent of **Animate view
changes**, which controls axis views, Look At, Home and Fit. Re-enabling smoothing during
trackpad event immediately, with no smoothing tail. 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
+2 -2
View File
@@ -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`; `animate` (bool, default false: snap) | |
| `ui.view` | `view`: `front`, `back`, `top`, `bottom`, `left`, `right`, `iso`, `home`, `fit` | |
| `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), `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.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.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 |
-3
View File
@@ -56,9 +56,7 @@
| 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` |
@@ -86,7 +84,6 @@
| 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` |