diff --git a/js/io/formats/bedrock.js b/js/io/formats/bedrock.js index 5be55955..4d32bb0a 100644 --- a/js/io/formats/bedrock.js +++ b/js/io/formats/bedrock.js @@ -1275,6 +1275,7 @@ var block_format = new ModelFormat({ texture_meshes: true, cube_size_limiter: { rotation_affected: true, + box_marker_size: [30, 30, 30], updateBoxMarker() { let center = Format.cube_size_limiter.getModelCenter(); three_grid.size_limit_box.position.set(center[0] + center[3], center[1] + center[4], center[2] + center[5]).divideScalar(2); diff --git a/js/io/formats/java_block.js b/js/io/formats/java_block.js index 4617a814..80d40b7a 100644 --- a/js/io/formats/java_block.js +++ b/js/io/formats/java_block.js @@ -303,7 +303,7 @@ var codec = new Codec('java_block', { link = texture_arr[link.substring(1)]; } let texture = new Texture({id: key}).fromJavaLink(texture_arr[key], path_arr.slice()).add(); - texture_paths[texture_arr[key]] = texture_ids[key] = texture; + texture_paths[texture_arr[key].replace(/^minecraft:/, '')] = texture_ids[key] = texture; new_textures.push(texture); } } @@ -312,11 +312,11 @@ var codec = new Codec('java_block', { if (link.startsWith('#') && texture_arr[link.substring(1)]) { link = texture_arr[link.substring(1)]; } - if (texture_paths[link]) { - texture_paths[link].enableParticle() + if (texture_paths[link.replace(/^minecraft:/, '')]) { + texture_paths[link.replace(/^minecraft:/, '')].enableParticle() } else { let texture = new Texture({id: 'particle'}).fromJavaLink(link, path_arr.slice()).enableParticle().add(); - texture_paths[link] = texture_ids.particle = texture; + texture_paths[link.replace(/^minecraft:/, '')] = texture_ids.particle = texture; new_textures.push(texture); } } diff --git a/js/preview/canvas.js b/js/preview/canvas.js index 4de311e1..c5fe8e1b 100644 --- a/js/preview/canvas.js +++ b/js/preview/canvas.js @@ -524,7 +524,8 @@ const Canvas = { } } if (settings.large_box.value === true) { - var geometry_box = new THREE.EdgesGeometry(new THREE.BoxBufferGeometry(30, 30, 30)); + let size = Format.cube_size_limiter?.box_marker_size || [48, 48, 48]; + var geometry_box = new THREE.EdgesGeometry(new THREE.BoxBufferGeometry(...size)); var line_material = new THREE.LineBasicMaterial({color: gizmo_colors.grid}); var large_box = new THREE.LineSegments( geometry_box, line_material); diff --git a/js/texturing/painter.js b/js/texturing/painter.js index 67088e1a..f4fb0d09 100644 --- a/js/texturing/painter.js +++ b/js/texturing/painter.js @@ -666,8 +666,8 @@ const Painter = { if (!face) return; let source_uv = [ - even_brush_size ? x : x + 0.5, - even_brush_size ? y : y + 0.5 + (even_brush_size ? x : x + 0.5) * (Project.texture_width / texture.width), + (even_brush_size ? y : y + 0.5) * (Project.texture_height / texture.height) ]; let point_on_uv; @@ -699,6 +699,9 @@ const Painter = { mesh.mesh.worldToLocal(world_coord); point_on_uv = face.localToUV(world_coord); } + + point_on_uv[0] /= Project.texture_width / texture.width; + point_on_uv[1] /= Project.texture_height / texture.height; if (Condition(Toolbox.selected.brush?.floor_coordinates)) { if (even_brush_size) {