src/loaders/OBJLoader2.js
function () {
		var meshOutputGroupTemp = [];
		var meshOutputGroup;
		var absoluteVertexCount = 0;
		var absoluteIndexMappingsCount = 0;
		var absoluteIndexCount = 0;
		var absoluteColorCount = 0;
		var absoluteNormalCount = 0;
		var absoluteUvCount = 0;
		var indices;
		for ( var name in this.rawMesh.subGroups ) {

			meshOutputGroup = this.rawMesh.subGroups[ name ];
			if ( meshOutputGroup.vertices.length > 0 ) {

				indices = meshOutputGroup.indices;
				if ( indices.length > 0 && absoluteIndexMappingsCount > 0 ) {

					for ( var i in indices ) indices[ i ] = indices[ i ] + absoluteIndexMappingsCount;

				}
				meshOutputGroupTemp.push( meshOutputGroup );
				absoluteVertexCount += meshOutputGroup.vertices.length;
				absoluteIndexMappingsCount += meshOutputGroup.indexMappingsCount;
				absoluteIndexCount += meshOutputGroup.indices.length;
				absoluteColorCount += meshOutputGroup.colors.length;
				absoluteUvCount += meshOutputGroup.uvs.length;
				absoluteNormalCount += meshOutputGroup.normals.length;

			}
		}

		// do not continue if no result
		var result = null;
		if ( meshOutputGroupTemp.length > 0 ) {

			result = {
				name: this.rawMesh.groupName !== '' ? this.rawMesh.groupName : this.rawMesh.objectName,
				subGroups: meshOutputGroupTemp,
				absoluteVertexCount: absoluteVertexCount,
				absoluteIndexCount: absoluteIndexCount,
				absoluteColorCount: absoluteColorCount,
				absoluteNormalCount: absoluteNormalCount,
				absoluteUvCount: absoluteUvCount,
				faceCount: this.rawMesh.counts.faceCount,
				doubleIndicesCount: this.rawMesh.counts.doubleIndicesCount
			};

		}
		return result;
	}
function () {
		var meshOutputGroupTemp = [];
		var meshOutputGroup;
		var absoluteVertexCount = 0;
		var absoluteIndexMappingsCount = 0;
		var absoluteIndexCount = 0;
		var absoluteColorCount = 0;
		var absoluteNormalCount = 0;
		var absoluteUvCount = 0;
		var indices;
		for ( var name in this.rawMesh.subGroups ) {

			meshOutputGroup = this.rawMesh.subGroups[ name ];
			if ( meshOutputGroup.vertices.length > 0 ) {

				indices = meshOutputGroup.indices;
				if ( indices.length > 0 && absoluteIndexMappingsCount > 0 ) {

					for ( var i in indices ) indices[ i ] = indices[ i ] + absoluteIndexMappingsCount;

				}
				meshOutputGroupTemp.push( meshOutputGroup );
				absoluteVertexCount += meshOutputGroup.vertices.length;
				absoluteIndexMappingsCount += meshOutputGroup.indexMappingsCount;
				absoluteIndexCount += meshOutputGroup.indices.length;
				absoluteColorCount += meshOutputGroup.colors.length;
				absoluteUvCount += meshOutputGroup.uvs.length;
				absoluteNormalCount += meshOutputGroup.normals.length;

			}
		}

		// do not continue if no result
		var result = null;
		if ( meshOutputGroupTemp.length > 0 ) {

			result = {
				name: this.rawMesh.groupName !== '' ? this.rawMesh.groupName : this.rawMesh.objectName,
				subGroups: meshOutputGroupTemp,
				absoluteVertexCount: absoluteVertexCount,
				absoluteIndexCount: absoluteIndexCount,
				absoluteColorCount: absoluteColorCount,
				absoluteNormalCount: absoluteNormalCount,
				absoluteUvCount: absoluteUvCount,
				faceCount: this.rawMesh.counts.faceCount,
				doubleIndicesCount: this.rawMesh.counts.doubleIndicesCount
			};

		}
		return result;
	}
function ( ) { var meshOutputGroupTemp = [ ] ; var meshOutputGroup ; var absoluteVertexCount = 0 ; var absoluteIndexMappingsCount = 0 ; var absoluteIndexCount = 0 ; var absoluteColorCount = 0 ; var absoluteNormalCount = 0 ; var absoluteUvCount = 0 ; var indices ; for ( var name in this . rawMesh . subGroups ) { meshOutputGroup = this . rawMesh . subGroups [ name ] ; if ( meshOutputGroup . vertices . length > 0 ) { indices = meshOutputGroup . indices ; if ( indices . length > 0 && absoluteIndexMappingsCount > 0 ) { for ( var i in indices ) indices [ i ] = indices [ i ] + absoluteIndexMappingsCount ; } meshOutputGroupTemp . push ( meshOutputGroup ) ; absoluteVertexCount += meshOutputGroup . vertices . length ; absoluteIndexMappingsCount += meshOutputGroup . indexMappingsCount ; absoluteIndexCount += meshOutputGroup . indices . length ; absoluteColorCount += meshOutputGroup . colors . length ; absoluteUvCount += meshOutputGroup . uvs . length ; absoluteNormalCount += meshOutputGroup . normals . length ; } } // do not continue if no result var result = null ; if ( meshOutputGroupTemp . length > 0 ) { result = { name : this . rawMesh . groupName !== '' ? this . rawMesh . groupName : this . rawMesh . objectName , subGroups : meshOutputGroupTemp , absoluteVertexCount : absoluteVertexCount , absoluteIndexCount : absoluteIndexCount , absoluteColorCount : absoluteColorCount , absoluteNormalCount : absoluteNormalCount , absoluteUvCount : absoluteUvCount , faceCount : this . rawMesh . counts . faceCount , doubleIndicesCount : this . rawMesh . counts . doubleIndicesCount } ; } return result ; }
Clear any empty subGroup and calculate absolute vertex, normal and uv counts
Clear any empty subGroup and calculate absolute vertex normal and uv counts