提交 8553c01e 编写于 作者: M Mr.doob

BufferGeometry.toJSON(): Support primitives. Fixes #6391.

上级 945cdd9e
......@@ -1090,8 +1090,22 @@ THREE.BufferGeometry.prototype = {
data.type = this.type;
data.uuid = this.uuid;
if ( this.name !== '' ) data.name = this.name;
data.data = {};
data.data.attributes = {};
if ( this.parameters !== undefined ) {
var parameters = this.parameters;
for ( var key in parameters ) {
if ( parameters[ key ] !== undefined ) data[ key ] = parameters[ key ];
}
return data;
}
data.data = { attributes: {} };
var attributes = this.attributes;
var offsets = this.offsets;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册