Skip to content

Commit

Permalink
Add mesh editing tools to main toolbar
Browse files Browse the repository at this point in the history
Fix #1273 Mesh UVs mirrored
  • Loading branch information
JannisX11 committed Feb 15, 2022
1 parent 8959b3e commit 7800f13
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
22 changes: 16 additions & 6 deletions js/interface/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -1958,11 +1958,9 @@ const BARS = {
'pick_screen_color'
]
})
if (isApp) {
Blockbench.onUpdateTo('3.9', () => {
Toolbars.color_picker.add(BarItems.pick_screen_color);
})
}
Blockbench.onUpdateTo('4.2.0-beta.0', () => {
Toolbars.color_picker.add(BarItems.pick_screen_color);
})


Toolbars.display = new Toolbar({
Expand Down Expand Up @@ -2046,9 +2044,21 @@ const BARS = {
'transform_space',
'rotation_space',
'selection_mode',
'lock_motion_trail'
'lock_motion_trail',
'extrude_mesh_selection',
'inset_mesh_selection',
'loop_cut',
'create_face',
'invert_face',
]
})
Blockbench.onUpdateTo('4.2.0-beta.0', () => {
Toolbars.main_tools.add(BarItems.extrude_mesh_selection);
Toolbars.main_tools.add(BarItems.inset_mesh_selection);
Toolbars.main_tools.add(BarItems.loop_cut);
Toolbars.main_tools.add(BarItems.create_face);
Toolbars.main_tools.add(BarItems.invert_face);
})
if (Blockbench.isMobile) {
[Toolbars.element_position,
Toolbars.element_size,
Expand Down
3 changes: 2 additions & 1 deletion js/texturing/texture_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,8 @@ const TextureGenerator = {
vec2.fromArray(mesh.vertices[face_group.faces[0].vertices[0]])
)
let rot = cameraTargetToRotation([0, 0, 0], normal_vec.toArray());
let e = new THREE.Euler(Math.degToRad(-rot[1] - 90), Math.degToRad(rot[0]), 0);
console.log(face_group.normal, rot)
let e = new THREE.Euler(Math.degToRad(rot[1] - 90), Math.degToRad(rot[0] + 180), 0);
let vertex_uvs = {};
face_group.faces.forEach(face => {
face.vertices.forEach(vkey => {
Expand Down
2 changes: 1 addition & 1 deletion js/texturing/uv.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ const UVEditor = {
vec2.fromArray(obj.vertices[face.vertices[0]])
)
let rot = cameraTargetToRotation([0, 0, 0], normal_vec.toArray());
let e = new THREE.Euler(Math.degToRad(-rot[1] - 90), Math.degToRad(rot[0]), 0);
let e = new THREE.Euler(Math.degToRad(rot[1] - 90), Math.degToRad(rot[0] + 180), 0);
face.vertices.forEach(vkey => {
let coplanar_pos = plane.projectPoint(vec3.fromArray(obj.vertices[vkey]), vec4.set(0, 0, 0));
coplanar_pos.applyEuler(e);
Expand Down

0 comments on commit 7800f13

Please sign in to comment.