mirror of
https://github.com/JannisX11/blockbench.git
synced 2025-01-30 15:42:42 +08:00
Fix mesh selection not updating correctly when copy pasting mesh selection
Fix face properties editor completely hidden when no cubes selected
This commit is contained in:
parent
38ca312697
commit
ba6075bb1d
@ -253,6 +253,8 @@ const Clipbench = {
|
||||
new_mesh = new Mesh({name: 'pasted', vertices: []});
|
||||
elements.push(new_mesh);
|
||||
}
|
||||
let selection_mode_before = BarItems.selection_mode.value;
|
||||
BarItems.selection_mode.change('vertex');
|
||||
elements.forEach(mesh => {
|
||||
let old_vertices = Object.keys(this.vertices);
|
||||
let vertices_positions = old_vertices.map(vkey => this.vertices[vkey]);
|
||||
@ -276,6 +278,9 @@ const Clipbench = {
|
||||
if (new_mesh) {
|
||||
new_mesh.init().select();
|
||||
}
|
||||
// Update vertex selection to appropriate selection mode
|
||||
BarItems.selection_mode.change(selection_mode_before);
|
||||
|
||||
Undo.finishEdit('Paste mesh selection');
|
||||
Canvas.updateView({elements: Mesh.selected, selection: true})
|
||||
},
|
||||
|
@ -438,7 +438,7 @@ BARS.defineActions(function() {
|
||||
}
|
||||
})
|
||||
}
|
||||
if (value == 'face' && ['edge', 'vertex'].includes(previous_selection_mode)) {
|
||||
if ((value == 'face' || value == 'cluster') && ['edge', 'vertex'].includes(previous_selection_mode)) {
|
||||
Mesh.selected.forEach(mesh => {
|
||||
let vertices = mesh.getSelectedVertices();
|
||||
let faces = mesh.getSelectedFaces(true);
|
||||
|
@ -3252,7 +3252,7 @@ Interface.definePanels(function() {
|
||||
</div>
|
||||
|
||||
|
||||
<div id="uv_face_properties" v-if="mode === 'face_properties' && mappable_elements[0] && mappable_elements[0].type == 'cube'">
|
||||
<div id="uv_face_properties" v-if="mode === 'face_properties'">
|
||||
<div class="bar" id="face_properties_header_bar">
|
||||
<li></li>
|
||||
<li @click="mode = 'uv'" class="tool face_properties_toggle">
|
||||
@ -3287,7 +3287,7 @@ Interface.definePanels(function() {
|
||||
</div>
|
||||
|
||||
|
||||
<ul>
|
||||
<ul v-if="mappable_elements[0] && mappable_elements[0].type == 'cube'">
|
||||
<li v-for="(face, key) in mappable_elements[0].faces" :face="key"
|
||||
class="uv_face_properties_line"
|
||||
:class="{selected: selected_faces.includes(key), disabled: mappable_elements[0].faces[key].texture === null}"
|
||||
|
Loading…
Reference in New Issue
Block a user