mirror of
https://github.com/JannisX11/blockbench.git
synced 2024-11-21 01:13:37 +08:00
Fix #2045 OBJ mtl export can have incorrect texture file name
This commit is contained in:
parent
2a2134c85c
commit
32bfa3273f
@ -375,11 +375,15 @@ var codec = new Codec('obj', {
|
||||
|
||||
var mtlOutput = '# Made in Blockbench '+appVersion+'\n';;
|
||||
|
||||
for (var key in materials) {
|
||||
for (let key in materials) {
|
||||
if (materials.hasOwnProperty(key) && materials[key]) {
|
||||
var tex = materials[key];
|
||||
let tex = materials[key];
|
||||
let name = tex.name;
|
||||
if (name.substr(-4) !== '.png') {
|
||||
name += '.png';
|
||||
}
|
||||
mtlOutput += 'newmtl m_' +key+ '\n'
|
||||
mtlOutput += `map_Kd ${tex.name}\n`;
|
||||
mtlOutput += `map_Kd ${name}\n`;
|
||||
}
|
||||
}
|
||||
mtlOutput += 'newmtl none'
|
||||
|
Loading…
Reference in New Issue
Block a user