Skip to content

Commit

Permalink
Merge pull request mrdoob#1 from perkma/3dmloader
Browse files Browse the repository at this point in the history
Read object name from .3dm file
  • Loading branch information
perkma authored Nov 13, 2020
2 parents 45b0103 + f6f8d93 commit 77bc8c8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/jsm/loaders/3DMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
var points = new Points( geometry, material );
points.userData[ 'attributes' ] = attributes;
points.userData[ 'objectType' ] = obj.objectType;
if( attributes.name ) {
points.name = attributes.name;
}
return points;

case 'Mesh':
Expand All @@ -468,6 +471,9 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
mesh.receiveShadow = attributes.receivesShadows;
mesh.userData[ 'attributes' ] = attributes;
mesh.userData[ 'objectType' ] = obj.objectType;
if( attributes.name ) {
mesh.name = attributes.name;
}

return mesh;

Expand All @@ -488,6 +494,9 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {

brepObject.userData[ 'attributes' ] = attributes;
brepObject.userData[ 'objectType' ] = obj.objectType;
if( attributes.name ) {
brepObject.name = attributes.name;
}

return brepObject;

Expand All @@ -504,6 +513,9 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {
var lines = new Line( geometry, material );
lines.userData[ 'attributes' ] = attributes;
lines.userData[ 'objectType' ] = obj.objectType;
if( attributes.name ) {
lines.name = attributes.name;
}

return lines;

Expand Down Expand Up @@ -546,6 +558,9 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {

sprite.userData[ 'attributes' ] = attributes;
sprite.userData[ 'objectType' ] = obj.objectType;
if( attributes.name ) {
sprite.name = attributes.name;
}

return sprite;

Expand Down

0 comments on commit 77bc8c8

Please sign in to comment.