Add warning message about box UV face dimensions

This commit is contained in:
JannisX11 2020-10-16 14:37:08 +02:00
parent 8b940fae21
commit a0c748e198
2 changed files with 15 additions and 0 deletions

View File

@ -374,6 +374,17 @@ const TextureGenerator = {
uv_only: true,
uv_mode: true
})
// Warning
if (cubes.find(cube => {
let size = cube.size();
return (size[0] > 0.001 && size[0] < 0.999) || (size[1] > 0.001 && size[1] < 0.999) || (size[2] > 0.001 && size[2] < 0.999)
})) {
Blockbench.showMessageBox({
title: 'message.small_face_dimensions.title',
message: tl('message.small_face_dimensions.message') + (Format.optional_box_uv ? '\n\n' + tl('message.small_face_dimensions.face_uv') : ''),
icon: 'warning',
})
}
},
boxUVdrawTemplateRectangle(border_color, color, face, coords, texture, canvas) {
if (typeof background_color === 'string') {

View File

@ -228,6 +228,10 @@
"message.duplicate_groups.title": "Bone Name Duplicate",
"message.duplicate_groups.message": "The name of this bone exists on multiple bones. This can cause problems.",
"message.small_face_dimensions.title": "Incompatible Face Dimensions",
"message.small_face_dimensions.message": "The selection contains faces that are smaller than 1 unit in one direction. The Box UV mapping system considers any faces below that threshold as 0 pixels wide. The texture on those faces therefore may not work correctly.",
"message.small_face_dimensions.face_uv": "The current format supports per-face UV maps which can handle small face dimensions. Go to \"File\" > \"Project...\" and uncheck \"Box UV\".",
"message.import_palette.replace_palette": "Replace old palette",
"message.import_palette.threshold": "Merge Threshold",