mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-12-03 04:40:46 +08:00
Improve seam tool
Add uv combine angle thresholds Change order of seam tool
This commit is contained in:
parent
f675ce3a49
commit
a82bde0219
@ -1442,8 +1442,8 @@ BARS.defineActions(function() {
|
||||
new BarSelect('select_seam', {
|
||||
options: {
|
||||
auto: true,
|
||||
join: true,
|
||||
divide: true,
|
||||
join: true,
|
||||
},
|
||||
condition: () => Modes.edit && Mesh.all.length,
|
||||
onChange({value}) {
|
||||
|
@ -49,6 +49,8 @@ const TextureGenerator = {
|
||||
power: {label: 'dialog.create_texture.power', description: 'dialog.create_texture.power.desc', type: 'checkbox', value: true, condition: (form) => (form.type !== 'blank' && (form.rearrange_uv || form.type == 'color_map'))},
|
||||
double_use: {label: 'dialog.create_texture.double_use', description: 'dialog.create_texture.double_use.desc', type: 'checkbox', value: true, condition: (form) => (form.type == 'template' && Project.box_uv && form.rearrange_uv)},
|
||||
combine_polys: {label: 'dialog.create_texture.combine_polys', description: 'dialog.create_texture.combine_polys.desc', type: 'checkbox', value: true, condition: (form) => (form.type == 'template' && form.rearrange_uv && Mesh.selected.length)},
|
||||
max_edge_angle: {label: 'dialog.create_texture.max_edge_angle', description: 'dialog.create_texture.max_edge_angle.desc', type: 'number', value: 36, condition: (form) => (form.type == 'template' && form.rearrange_uv && Mesh.selected.length)},
|
||||
max_island_angle: {label: 'dialog.create_texture.max_island_angle', description: 'dialog.create_texture.max_island_angle.desc', type: 'number', value: 45, condition: (form) => (form.type == 'template' && form.rearrange_uv && Mesh.selected.length)},
|
||||
padding: {label: 'dialog.create_texture.padding', description: 'dialog.create_texture.padding.desc', type: 'checkbox', value: false, condition: (form) => (form.type == 'template' && form.rearrange_uv)},
|
||||
|
||||
},
|
||||
@ -86,6 +88,8 @@ const TextureGenerator = {
|
||||
power: {label: 'dialog.create_texture.power', description: 'dialog.create_texture.power.desc', type: 'checkbox', value: Math.isPowerOfTwo(texture.width)},
|
||||
double_use: {label: 'dialog.create_texture.double_use', description: 'dialog.create_texture.double_use.desc', type: 'checkbox', value: true, condition: (form) => Project.box_uv},
|
||||
combine_polys: {label: 'dialog.create_texture.combine_polys', description: 'dialog.create_texture.combine_polys.desc', type: 'checkbox', value: true, condition: (form) => (form.rearrange_uv && Mesh.selected.length)},
|
||||
max_edge_angle: {label: 'dialog.create_texture.max_edge_angle', description: 'dialog.create_texture.max_edge_angle.desc', type: 'number', value: 45, condition: (form) => (form.type == 'template' && form.rearrange_uv && Mesh.selected.length)},
|
||||
max_island_angle: {label: 'dialog.create_texture.max_island_angle', description: 'dialog.create_texture.max_island_angle.desc', type: 'number', value: 45, condition: (form) => (form.type == 'template' && form.rearrange_uv && Mesh.selected.length)},
|
||||
padding: {label: 'dialog.create_texture.padding', description: 'dialog.create_texture.padding.desc', type: 'checkbox', value: false, condition: (form) => (form.rearrange_uv)},
|
||||
},
|
||||
onFormChange(form) {
|
||||
@ -865,9 +869,9 @@ const TextureGenerator = {
|
||||
if (seam === 'divide') return;
|
||||
if (seam !== 'join') {
|
||||
let angle = face.getAngleTo(other_face);
|
||||
if (angle > 38) return;
|
||||
if (angle > (options.max_edge_angle||36)) return;
|
||||
let angle_total = face_group.faces[0].getAngleTo(other_face);
|
||||
if (angle_total > 45) return;
|
||||
if (angle_total > (options.max_island_angle||45)) return;
|
||||
let edge_length = getEdgeLength(other_face_match.edge);
|
||||
if (edge_length < 2.2) return;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
@ -440,8 +440,12 @@
|
||||
"dialog.create_texture.double_use.desc": "If two elements already have the same UV space assigned, keep it that way in the new map",
|
||||
"dialog.create_texture.padding": "Padding",
|
||||
"dialog.create_texture.padding.desc": "Add a small padding between the individual parts of the template",
|
||||
"dialog.create_texture.combine_polys": "Combine Faces",
|
||||
"dialog.create_texture.combine_polys.desc": "Combine connected coplanar faces into one UV section",
|
||||
"dialog.create_texture.combine_polys": "Combine Islands",
|
||||
"dialog.create_texture.combine_polys.desc": "Combine faces into connected UV islands",
|
||||
"dialog.create_texture.max_edge_angle": "Edge Angle Threshold",
|
||||
"dialog.create_texture.max_edge_angle.desc": "The maximum angle between two faces at which they will still be combined",
|
||||
"dialog.create_texture.max_island_angle": "Island Angle Threshold",
|
||||
"dialog.create_texture.max_island_angle.desc": "The maximum angle that can be combined into the same UV island",
|
||||
"dialog.create_texture.resolution": "Resolution",
|
||||
"dialog.create_texture.resolution.desc": "The height and width of the texture",
|
||||
"dialog.create_texture.pixel_density": "Pixel Density",
|
||||
|
Loading…
Reference in New Issue
Block a user