Skip to content

Commit

Permalink
Merge pull request #13400 from fernandojsg/fixobj
Browse files Browse the repository at this point in the history
Fix OBJ loader with empty uvs or normals
  • Loading branch information
mrdoob authored Feb 23, 2018
2 parents 90cea0a + 171de9d commit a97575e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions examples/js/loaders/OBJLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,19 +286,17 @@ THREE.OBJLoader = ( function () {

this.addVertex( ia, ib, ic );

if ( ua !== undefined ) {
if ( ua !== undefined && ua !== '' ) {

var uvLen = this.uvs.length;

ia = this.parseUVIndex( ua, uvLen );
ib = this.parseUVIndex( ub, uvLen );
ic = this.parseUVIndex( uc, uvLen );

this.addUV( ia, ib, ic );

}

if ( na !== undefined ) {
if ( na !== undefined && na !== '' ) {

// Normals are many times the same. If so, skip function call and parseInt.
var nLen = this.normals.length;
Expand Down

0 comments on commit a97575e

Please sign in to comment.