mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-27 04:21:46 +08:00
Fix #1611 Issue with mirror painting on meshes
Fix block model texture import issue Fix cube size restriction box not updating between formats
This commit is contained in:
parent
5bd0ebbfc3
commit
d4f72bc6df
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
@ -700,6 +700,9 @@ const Painter = {
|
||||
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) {
|
||||
point_on_uv = point_on_uv.map(v => Math.round(v))
|
||||
|
Loading…
Reference in New Issue
Block a user