Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Commit c365e18

Browse files
Update OBJ Exporter
1 parent 274fb91 commit c365e18

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

viewers/static/jsm/exporters/OBJExporter.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -764,10 +764,6 @@ class OBJExporter {
764764
if ( ( mat.normalScale && ! ( mat.normalScale.x === 1 && mat.normalScale.y === 1 ) && ! mat.sheen ) || vertexTangents === true ) {
765765
mtlOutput += 'Pns ' + mat.normalScale.x + ' ' + ( vertexTangents === true ? mat.normalScale.y *= -1 : mat.normalScale.y ) + '\n';
766766
}
767-
if ( mat.displacementMap ) {
768-
if ( mat.displacementBias && mat.displacementBias > 0 ) mtlOutput += 'disp_b ' + mat.displacementBias + '\n';
769-
if ( mat.displacementScale && mat.displacementScale < 1 ) mtlOutput += 'disp_s ' + mat.displacementScale + '\n';
770-
}
771767
if ( mat.clearcoat && mat.clearcoat > 0 ) {
772768
mtlOutput += 'Pcc ' + mat.clearcoat + '\n';
773769
if ( mat.clearcoatRoughness ) mtlOutput += 'Pcr ' + mat.clearcoatRoughness + '\n';
@@ -1261,7 +1257,7 @@ class OBJExporter {
12611257
map_uuids.push( mat.displacementMap.uuid );
12621258
map_names[ mat.displacementMap.uuid ] = name;
12631259

1264-
mtlOutput += 'disp -r ' + rot + ' -c ' + xc + ' ' + yc + ' -s ' + xs + ' ' + ys + ' 1' + ' -o ' + xo + ' ' + yo + ' 0 ' + '-w ' + ws + ' ' + wt + ' ' + name + '.png' + '\n';
1260+
mtlOutput += 'disp -mm ' + mat.displacementBias + ' ' + mat.displacementScale + ' -r ' + rot + ' -c ' + xc + ' ' + yc + ' -s ' + xs + ' ' + ys + ' 1' + ' -o ' + xo + ' ' + yo + ' 0 ' + '-w ' + ws + ' ' + wt + ' ' + name + '.png' + '\n';
12651261

12661262
textures.push( {
12671263
name,
@@ -1271,7 +1267,7 @@ class OBJExporter {
12711267

12721268
} else {
12731269

1274-
mtlOutput += 'disp -r ' + rot + ' -c ' + xc + ' ' + yc + ' -s ' + xs + ' ' + ys + ' 1' + ' -o ' + xo + ' ' + yo + ' 0 ' + '-w ' + ws + ' ' + wt + ' ' + map_names[ mat.displacementMap.uuid ] + '.png' + '\n';
1270+
mtlOutput += 'disp -mm ' + mat.displacementBias + ' ' + mat.displacementScale + ' -r ' + rot + ' -c ' + xc + ' ' + yc + ' -s ' + xs + ' ' + ys + ' 1' + ' -o ' + xo + ' ' + yo + ' 0 ' + '-w ' + ws + ' ' + wt + ' ' + map_names[ mat.displacementMap.uuid ] + '.png' + '\n';
12751271

12761272
}
12771273

0 commit comments

Comments
 (0)