Skip to content

Commit

Permalink
fix the inconsistency of using UV Overlay
Browse files Browse the repository at this point in the history
The UV Overlay is now renamed to UV Show All, as now it's only function is to show the UV from all objects.
     (it was its only function before, but it was confusing to use, so I made it more clear what it does).
The other UV options are shown normally when clicking with the Right Mouse Button in the UVEditor.
The settings option regarding the UV Mode is now an Enum, to properly represent what's happening

# Conflicts:
#	lang/vi.json
#	lang/zh.json
#	lang/zh_tw.json
  • Loading branch information
caioraphael1 committed Sep 29, 2024
1 parent 7ff7965 commit bfe956c
Show file tree
Hide file tree
Showing 17 changed files with 53 additions and 69 deletions.
7 changes: 6 additions & 1 deletion js/interface/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,12 @@ const Settings = {
new Setting('autouv', {category: 'defaults', value: true});
new Setting('inherit_parent_color', {category: 'defaults', value: false});
new Setting('create_rename', {category: 'defaults', value: false});
new Setting('show_only_selected_uv', {category: 'defaults', value: false});
new Setting('display_uv', {category: 'defaults', value: 'none', type: 'select', description: '', options: {
'selected_faces': tl('menu.uv.display_uv.selected_faces'),
'selected_elements': tl('menu.uv.display_uv.selected_elements'),
}, onChange(value) {
Project.display_uv = UVEditor.vue.display_uv = value;
}});
new Setting('default_path', {category: 'defaults', value: false, type: 'click', condition: isApp, icon: 'burst_mode', click: function() { openDefaultTexturePath() }});
new Setting('animation_snap', {category: 'defaults', value: 24, type: 'number'});
new Setting('uniform_keyframe', {category: 'defaults', value: true});
Expand Down
2 changes: 1 addition & 1 deletion js/io/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ModelProject {
this.mode = 'edit';
this.tool = '';
this.view_mode = 'textured';
this.display_uv = settings.show_only_selected_uv.value ? 'selected_faces' :'selected_elements';
this.display_uv = settings.display_uv.value;
this.exploded_view = false;
this.mirror_modeling_enabled = false;
this.previews = {};
Expand Down
15 changes: 4 additions & 11 deletions js/texturing/uv.js
Original file line number Diff line number Diff line change
Expand Up @@ -1404,16 +1404,15 @@ const UVEditor = {
'zoom_reset'
]},
{name: 'menu.uv.display_uv', id: 'display_uv', icon: 'visibility', condition: () => (!Format.image_editor), children: () => {
let options = ['selected_faces', 'selected_elements', 'all_elements'];
let options = ['selected_faces', 'selected_elements'];
return options.map(option => {return {
id: option,
name: `menu.uv.display_uv.${option}`,
icon: UVEditor.vue.display_uv == option ? 'far.fa-dot-circle' : 'far.fa-circle',
condition: !(option == 'selected_faces' && UVEditor.isBoxUV() && !Mesh.selected.length),
click() {
Project.display_uv = UVEditor.vue.display_uv = option;
if (option == 'selected_faces') settings.show_only_selected_uv.set(true);
if (option == 'selected_elements') settings.show_only_selected_uv.set(false);
settings.display_uv.set(option);
Settings.saveLocalStorages();
}
}})
Expand Down Expand Up @@ -2173,20 +2172,14 @@ BARS.defineActions(function() {
})
new Toggle('edit_mode_uv_overlay', {
name: 'action.paint_mode_uv_overlay',
description: 'action.edit_mode_uv_overlay.desc',
icon: 'stack',
category: 'uv',
condition: {modes: ['edit']},
onChange(value) {
if (value) {
Project.display_uv = UVEditor.vue.display_uv = 'all_elements';
settings.show_only_selected_uv.set(true);
} else {
if (settings.show_only_selected_uv.value) {
Project.display_uv = UVEditor.vue.display_uv = 'selected_faces';
} else {
Project.display_uv = UVEditor.vue.display_uv = 'selected_elements';
}
Project.display_uv = UVEditor.vue.display_uv = settings.display_uv.value;
}
}
})
Expand Down Expand Up @@ -2298,7 +2291,7 @@ Interface.definePanels(function() {
uv_resolution: [16, 16],
elements: [],
all_elements: [],
display_uv: 'selected_elements',
display_uv: settings.display_uv.value,
selection_outline: '',

face_names: {
Expand Down
7 changes: 3 additions & 4 deletions lang/cz.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@
"settings.preview_checkerboard.desc": "Přepnout šachovnicové pozadí za náhledem",
"settings.uv_checkerboard": "Šachovnice UV Editoru",
"settings.uv_checkerboard.desc": "Přepnout šachovnicové pozadí za UV editorem",
"settings.display_uv.desc": "What to display in the UV Editor",
"category.paint": "Malování",
"action.fill_mode.color_connected": "Připojené Barvy",
"action.draw_shape_type": "Typ Tvaru",
Expand Down Expand Up @@ -1350,8 +1351,7 @@
"message.merged_vertices": "Found and merged %0 vertices in %1 locations",
"settings.vertex_merge_distance": "Vertex Merge Distance",
"settings.vertex_merge_distance.desc": "Distance within which vertices are merged using merging by distance",
"settings.show_only_selected_uv": "Show Only Selected UV",
"settings.show_only_selected_uv.desc": "Only display the selected UV faces in the UV editor by default",
"settings.display_uv": "Display UV Mode",
"action.merge_vertices.merge_all": "Merge All",
"action.merge_vertices.merge_all_in_center": "Merge All in Center",
"action.merge_vertices.merge_by_distance": "Merge by Distance",
Expand Down Expand Up @@ -1405,7 +1405,7 @@
"action.new_window.desc": "Opens a new Blockbench window",
"action.export_collada": "Export Collada Model (dae)",
"action.export_collada.desc": "Export model and animations as dae file to use it in other 3D applications",
"action.paint_mode_uv_overlay": "UV Overlay",
"action.paint_mode_uv_overlay": "UV Show All",
"action.paint_mode_uv_overlay.desc": "Display the UV map as an overlay in paint mode",
"action.bake_animation_into_model": "Bake Animation into Model",
"action.bake_animation_into_model.desc": "Bake the currently displayed animation frame into the model. Only applies rotation and position, scale is ignored.",
Expand Down Expand Up @@ -2040,7 +2040,6 @@
"settings.final_newline": "Final Newline",
"settings.final_newline.desc": "Insert a newline character at the end of exported files",
"action.crop_layer_to_selection": "Crop Layer to Selection",
"action.edit_mode_uv_overlay.desc": "Display the UV map as an overlay in edit mode",
"action.animation_onion_skin_selective": "Selective Onion Skin",
"action.animation_onion_skin_selective.desc": "Only display onion skin for the selected part of the model",
"menu.image": "Image",
Expand Down
7 changes: 3 additions & 4 deletions lang/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@
"settings.preview_checkerboard.desc": "Aktiviert das Schachbrettmuster hinter der 3D-Vorschau",
"settings.uv_checkerboard": "UV-Fenster-Schachbrettmuster",
"settings.uv_checkerboard.desc": "Aktiviert das Schachbrettmuster hinter dem UV-Fenster",
"settings.display_uv.desc": "What to display in the UV Editor",
"category.paint": "Malen",
"action.fill_mode.color_connected": "Verbundene Farben",
"action.draw_shape_type": "Form",
Expand Down Expand Up @@ -1350,8 +1351,7 @@
"message.merged_vertices": "%0 Eckpunkte wurden gefunden und an %1 Stellen vereint",
"settings.vertex_merge_distance": "Abstand für Vereinen von Eckpunkten",
"settings.vertex_merge_distance.desc": "Abstand, in dem beieinander liegende Eckpunkte durch die Vereinen-Funktion vereint werden",
"settings.show_only_selected_uv": "Nur ausgewählte UV-Flächen anzeigen",
"settings.show_only_selected_uv.desc": "Zeige standardmäßig nur die aktuell ausgewählten UV-Flächen im UV-Editor an",
"settings.display_uv": "Display UV Mode",
"action.merge_vertices.merge_all": "Alle vereinen",
"action.merge_vertices.merge_all_in_center": "Alle in Mittelpunkt vereinen",
"action.merge_vertices.merge_by_distance": "Beieinander liegende vereinen",
Expand Down Expand Up @@ -1405,7 +1405,7 @@
"action.new_window.desc": "Öffnet ein neues Blockbench-Fenster",
"action.export_collada": "Collada-Modell (dae) exportieren",
"action.export_collada.desc": "Exportiert das Modell als dae-Datei zur Weiterverwendung in anderen 3D-Programmen",
"action.paint_mode_uv_overlay": "UV-Hilfslinien",
"action.paint_mode_uv_overlay": "UV Show All",
"action.paint_mode_uv_overlay.desc": "Überlagert die UV-Maps der Elemente im Malen-Modus",
"action.bake_animation_into_model": "Animationen auf Modell anwenden",
"action.bake_animation_into_model.desc": "Wendet die aktuell angezeigte Animation auf das Modell an. Nur Position und Drehung werden verwendet, Größe wird ignoriert",
Expand Down Expand Up @@ -2040,7 +2040,6 @@
"settings.final_newline": "Neue Zeile am Ende",
"settings.final_newline.desc": "Füge einen Zeilenumbruch am Ende von exportierten Dateien an",
"action.crop_layer_to_selection": "Ebene auf Auswahl zuschneiden",
"action.edit_mode_uv_overlay.desc": "Überlagert die UV-Maps der Elemente im Bearbeitungsmodus",
"action.animation_onion_skin_selective": "Zwiebelschalen nur für Auswahl",
"action.animation_onion_skin_selective.desc": "Zeige die Zwiebelschalenvorschau nur für den ausgewählten Teil des Modells an",
"menu.image": "Bild",
Expand Down
7 changes: 3 additions & 4 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -953,6 +953,7 @@
"settings.preview_checkerboard.desc": "Toggle the checkerboard background behind the preview",
"settings.uv_checkerboard": "UV Editor Checkerboard",
"settings.uv_checkerboard.desc": "Toggle the checkerboard background behind the UV editor",
"settings.display_uv.desc": "What to display in the UV Editor",
"settings.timecode_frame_number": "Display Timecodes as Frame Numbers",
"settings.timecode_frame_number.desc": "Display fraction timecodes in the timeline as frame number instead of centisecond",
"settings.only_selected_bezier_handles": "Show Only Selected Bézier Handles",
Expand Down Expand Up @@ -1019,8 +1020,7 @@
"settings.inherit_parent_color.desc": "Set the marker color of a newly created element to the color of the parent instead of a random color",
"settings.create_rename": "Rename New Element",
"settings.create_rename.desc": "Focus name field when creating new element or group",
"settings.show_only_selected_uv": "Show Only Selected UV",
"settings.show_only_selected_uv.desc": "Only display the selected UV faces in the UV editor by default",
"settings.display_uv": "Display UV Mode",
"settings.animation_snap": "Animation Snap",
"settings.animation_snap.desc": "Default snap interval for keyframes in the animation timeline in steps per second. This can also be changed per animation. The default value is 24.",
"settings.uniform_keyframe": "Uniform Scale Keyframes",
Expand Down Expand Up @@ -1798,10 +1798,9 @@
"action.uv_cycle.desc": "Cycle through the order of UV vertices without changing the UV positions",
"action.uv_cycle_invert": "Cycle Invert UV",
"action.uv_cycle_invert.desc": "Reverse the order of UV vertices without changing the UV positions",
"action.paint_mode_uv_overlay": "UV Overlay",
"action.paint_mode_uv_overlay": "UV Show All",
"action.paint_mode_uv_overlay.desc": "Display the UV map as an overlay in paint mode",
"action.snap_uv_to_image_bounds": "Snap UV to image bounds",
"action.edit_mode_uv_overlay.desc": "Display the UV map as an overlay in edit mode",
"action.remove_blank_faces": "Remove Blank Faces",
"action.remove_blank_faces.desc": "Deletes all untextured faces of the selection",
"action.auto_set_cullfaces": "Set Cullfaces Automatically",
Expand Down
7 changes: 3 additions & 4 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@
"settings.preview_checkerboard.desc": "Cambia el fondo de la cuadrícula detrás de la previsualización",
"settings.uv_checkerboard": "Cuadrícula del Editor de UV",
"settings.uv_checkerboard.desc": "Cambia el fondo de la cuadrícula detrás del editor de UV",
"settings.display_uv.desc": "What to display in the UV Editor",
"category.paint": "Pintar",
"action.fill_mode.color_connected": "Colores Conectados",
"action.draw_shape_type": "Tipo de Forma",
Expand Down Expand Up @@ -1350,8 +1351,7 @@
"message.merged_vertices": "Se encontraron y combinaron %0 vértices en %1 ubicaciones",
"settings.vertex_merge_distance": "Distancia de fusión de vértices",
"settings.vertex_merge_distance.desc": "Distancia dentro de la cual se fusionan los vértices mediante la fusión por distancia",
"settings.show_only_selected_uv": "Mostrar solo UV seleccionado",
"settings.show_only_selected_uv.desc": "Mostrar solo las caras UV seleccionadas en el editor UV de forma predeterminada",
"settings.display_uv": "Display UV Mode",
"action.merge_vertices.merge_all": "Unir todo",
"action.merge_vertices.merge_all_in_center": "Unir todo al centro",
"action.merge_vertices.merge_by_distance": "Unir distancia",
Expand Down Expand Up @@ -1405,7 +1405,7 @@
"action.new_window.desc": "Abrir una nueva ventana en Blockbench",
"action.export_collada": "Exportar modelo Collada (dae)",
"action.export_collada.desc": "Exportar modelo y animaciones como archivo dae para usarlo en otras aplicaciones 3D",
"action.paint_mode_uv_overlay": "Cubrir UV",
"action.paint_mode_uv_overlay": "UV Show All",
"action.paint_mode_uv_overlay.desc": "Muestra el mapa UV como una superposición en el modo de pintura",
"action.bake_animation_into_model": "Hornear animación en modelo",
"action.bake_animation_into_model.desc": "Hornea la animación mostrada actualmente al modelo. Solo aplica a la rotación y la posición, se ignora la escala.",
Expand Down Expand Up @@ -2040,7 +2040,6 @@
"settings.final_newline": "Final Newline",
"settings.final_newline.desc": "Insert a newline character at the end of exported files",
"action.crop_layer_to_selection": "Crop Layer to Selection",
"action.edit_mode_uv_overlay.desc": "Display the UV map as an overlay in edit mode",
"action.animation_onion_skin_selective": "Selective Onion Skin",
"action.animation_onion_skin_selective.desc": "Only display onion skin for the selected part of the model",
"menu.image": "Image",
Expand Down
7 changes: 3 additions & 4 deletions lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@
"settings.preview_checkerboard.desc": "Affiche/masque le damier d'arrière-plan de l'aperçu",
"settings.uv_checkerboard": "Damier de l'éditeur UV",
"settings.uv_checkerboard.desc": "Affiche/masque le damier d'arrière-plan de l'éditeur UV",
"settings.display_uv.desc": "What to display in the UV Editor",
"category.paint": "Peinture",
"action.fill_mode.color_connected": "Couleurs connectées",
"action.draw_shape_type": "Type d'ombre",
Expand Down Expand Up @@ -1350,8 +1351,7 @@
"message.merged_vertices": "%0 sommets ont été trouvés et fusionné depuis %1 emplacements",
"settings.vertex_merge_distance": "Distance de fusion des sommets",
"settings.vertex_merge_distance.desc": "Distance avant laquelle les sommets sont fusionnés en utilisant la fusion par distance",
"settings.show_only_selected_uv": "Afficher UV sélectionnés uniquement",
"settings.show_only_selected_uv.desc": "N'afficher que les faces UV sélectionnées dans l'éditeur UV par défaut",
"settings.display_uv": "Display UV Mode",
"action.merge_vertices.merge_all": "Tout fusionner",
"action.merge_vertices.merge_all_in_center": "Fusionne tout, au centre",
"action.merge_vertices.merge_by_distance": "Fusion par distnace",
Expand Down Expand Up @@ -1405,7 +1405,7 @@
"action.new_window.desc": "Ouvre une nouvelle fenêtre Blockbench",
"action.export_collada": "Exporter modèle Collada (dae)",
"action.export_collada.desc": "Exporte le modèle et les animations dans un fichier dae pour l'utiliser dans d'autres logiciels 3D",
"action.paint_mode_uv_overlay": "Overlay UV",
"action.paint_mode_uv_overlay": "UV Show All",
"action.paint_mode_uv_overlay.desc": "Affiche la carte UV sous forme d'overlay en mode Dessin",
"action.bake_animation_into_model": "Intégrer l'animation au modèle",
"action.bake_animation_into_model.desc": "Intègre l'image d'animation actuellement affichée au modèle. Seules la rotation et la position s'appliquent, la mise à l'échelle est ignorée.",
Expand Down Expand Up @@ -2040,7 +2040,6 @@
"settings.final_newline": "Final Newline",
"settings.final_newline.desc": "Insert a newline character at the end of exported files",
"action.crop_layer_to_selection": "Crop Layer to Selection",
"action.edit_mode_uv_overlay.desc": "Display the UV map as an overlay in edit mode",
"action.animation_onion_skin_selective": "Selective Onion Skin",
"action.animation_onion_skin_selective.desc": "Only display onion skin for the selected part of the model",
"menu.image": "Image",
Expand Down
7 changes: 3 additions & 4 deletions lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@
"settings.preview_checkerboard.desc": "Alterna lo sfondo a scacchiera dieto l'anteprima",
"settings.uv_checkerboard": "Scacchiera Editore UV",
"settings.uv_checkerboard.desc": "Alterna lo sfondo a scacchiera dietro l'editore UV",
"settings.display_uv.desc": "What to display in the UV Editor",
"category.paint": "Dipingi",
"action.fill_mode.color_connected": "Colori Connessi",
"action.draw_shape_type": "Tipo di forma",
Expand Down Expand Up @@ -1350,8 +1351,7 @@
"message.merged_vertices": "Found and merged %0 vertices in %1 locations",
"settings.vertex_merge_distance": "Vertex Merge Distance",
"settings.vertex_merge_distance.desc": "Distance within which vertices are merged using merging by distance",
"settings.show_only_selected_uv": "Show Only Selected UV",
"settings.show_only_selected_uv.desc": "Only display the selected UV faces in the UV editor by default",
"settings.display_uv": "Display UV Mode",
"action.merge_vertices.merge_all": "Merge All",
"action.merge_vertices.merge_all_in_center": "Merge All in Center",
"action.merge_vertices.merge_by_distance": "Merge by Distance",
Expand Down Expand Up @@ -1405,7 +1405,7 @@
"action.new_window.desc": "Opens a new Blockbench window",
"action.export_collada": "Export Collada Model (dae)",
"action.export_collada.desc": "Export model and animations as dae file to use it in other 3D applications",
"action.paint_mode_uv_overlay": "UV Overlay",
"action.paint_mode_uv_overlay": "UV Show All",
"action.paint_mode_uv_overlay.desc": "Display the UV map as an overlay in paint mode",
"action.bake_animation_into_model": "Bake Animation into Model",
"action.bake_animation_into_model.desc": "Bake the currently displayed animation frame into the model. Only applies rotation and position, scale is ignored.",
Expand Down Expand Up @@ -2040,7 +2040,6 @@
"settings.final_newline": "Final Newline",
"settings.final_newline.desc": "Insert a newline character at the end of exported files",
"action.crop_layer_to_selection": "Crop Layer to Selection",
"action.edit_mode_uv_overlay.desc": "Display the UV map as an overlay in edit mode",
"action.animation_onion_skin_selective": "Selective Onion Skin",
"action.animation_onion_skin_selective.desc": "Only display onion skin for the selected part of the model",
"menu.image": "Image",
Expand Down
7 changes: 3 additions & 4 deletions lang/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,7 @@
"settings.preview_checkerboard.desc": "チェッカーボードの背景を切り替えます",
"settings.uv_checkerboard": "UV エディタ",
"settings.uv_checkerboard.desc": "UV エディタの背景を切り替えます",
"settings.display_uv.desc": "What to display in the UV Editor",
"category.paint": "Paint",
"action.fill_mode.color_connected": "コネクトカラー",
"action.draw_shape_type": "シャープ",
Expand Down Expand Up @@ -1350,8 +1351,7 @@
"message.merged_vertices": "%1 で %0 の頂点が見つかりました",
"settings.vertex_merge_distance": "バーテクス",
"settings.vertex_merge_distance.desc": "頂点がマージされる距離を変更します",
"settings.show_only_selected_uv": "セレクト UV",
"settings.show_only_selected_uv.desc": "選択した UV フェイスのみを UV エディタに表示します",
"settings.display_uv": "Display UV Mode",
"action.merge_vertices.merge_all": "全てマージ",
"action.merge_vertices.merge_all_in_center": "中央に全てマージ",
"action.merge_vertices.merge_by_distance": "距離マージ",
Expand Down Expand Up @@ -1405,7 +1405,7 @@
"action.new_window.desc": "新しい Blockbench ウィンドウを開きます",
"action.export_collada": "Collada Model (dae)",
"action.export_collada.desc": "モデルとアニメーションを dae ファイルとして書き出します",
"action.paint_mode_uv_overlay": "UV オーバーレイ",
"action.paint_mode_uv_overlay": "UV Show All",
"action.paint_mode_uv_overlay.desc": "ペイントモードで UV マップをオーバーレイとして表示します",
"action.bake_animation_into_model": "アニメーションをモデルに焼き付ける",
"action.bake_animation_into_model.desc": "現在表示されているアニメーションフレームをモデルにベイク処理します。回転と位置のみを適用し、スケールは無視されます。",
Expand Down Expand Up @@ -2040,7 +2040,6 @@
"settings.final_newline": "改行を追加",
"settings.final_newline.desc": "ファイルの末尾に改行を挿入します",
"action.crop_layer_to_selection": "レイヤーを選択範囲にトリミング",
"action.edit_mode_uv_overlay.desc": "編集モードで UV マップをオーバーレイとして表示します",
"action.animation_onion_skin_selective": "トグルレイヤースキン",
"action.animation_onion_skin_selective.desc": "選択したレイヤースキンのみを表示します",
"menu.image": "Image",
Expand Down
Loading

0 comments on commit bfe956c

Please sign in to comment.