Skip to content

Commit 12e7e07

Browse files
authored
Merge pull request #13840 from WestLangley/dev-matrixAutoUpdate
Honor matrixAutoUpdate flag in serialization
2 parents 4a655d0 + 451bcf3 commit 12e7e07

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/core/Object3D.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,8 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
661661

662662
object.matrix = this.matrix.toArray();
663663

664+
if ( this.matrixAutoUpdate === false ) object.matrixAutoUpdate = false;
665+
664666
//
665667

666668
function serialize( library, element ) {

src/loaders/ObjectLoader.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,10 +795,13 @@ Object.assign( ObjectLoader.prototype, {
795795
object.uuid = data.uuid;
796796

797797
if ( data.name !== undefined ) object.name = data.name;
798+
798799
if ( data.matrix !== undefined ) {
799800

800801
object.matrix.fromArray( data.matrix );
801-
object.matrix.decompose( object.position, object.quaternion, object.scale );
802+
803+
if ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate;
804+
if ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale );
802805

803806
} else {
804807

0 commit comments

Comments
 (0)