提交 28ffc9e6 编写于 作者: M Mr.doob

Merge pull request #7220 from tschw/EditorMisc

Object3D: Let .toJSON serialize .metadata to root.
......@@ -596,6 +596,7 @@ THREE.Object3D.prototype = {
var isRootObject = ( meta === undefined );
var data = {};
var output = { object: data };
// meta is a hash used to collect geometries, materials.
// not providing it implies that this is the root object
......@@ -610,7 +611,7 @@ THREE.Object3D.prototype = {
images: {}
};
data.metadata = {
output.metadata = {
version: 4.4,
type: 'Object',
generator: 'Object3D.toJSON'
......@@ -641,8 +642,6 @@ THREE.Object3D.prototype = {
}
var output = {};
if ( isRootObject ) {
var geometries = extractFromCache( meta.geometries );
......@@ -657,8 +656,6 @@ THREE.Object3D.prototype = {
}
output.object = data;
return output;
// extract data from the cache hash
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册