浏览代码

Merge pull request #9264 from BabylonJS/msDestiny14/nme

Keeping frame state for node material saving
sebavan 4 年之前
父节点
当前提交
f0571ad771
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      nodeEditor/src/diagram/graphCanvas.tsx
  2. 2 2
      nodeEditor/src/diagram/graphFrame.ts

+ 2 - 2
nodeEditor/src/diagram/graphCanvas.tsx

@@ -235,13 +235,13 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
         this.props.globalState.storeEditorData = (editorData, graphFrame) => {
             editorData.frames = [];
             if (graphFrame) {
-                editorData.frames.push(graphFrame!.serialize());
+                editorData.frames.push(graphFrame!.serialize(false));
             } else {
                 editorData.x = this.x;
                 editorData.y = this.y;
                 editorData.zoom = this.zoom;
                 for (var frame of this._frames) {
-                    editorData.frames.push(frame.serialize());
+                    editorData.frames.push(frame.serialize(true));
                 }
             }
         }

+ 2 - 2
nodeEditor/src/diagram/graphFrame.ts

@@ -1415,7 +1415,7 @@ export class GraphFrame {
         }
     }
 
-    public serialize(): IFrameData {
+    public serialize(saveCollapsedState: boolean): IFrameData {
         this.serializePortData(this._exposedInPorts);
         this.serializePortData(this._exposedOutPorts);
         return {
@@ -1425,7 +1425,7 @@ export class GraphFrame {
             height: this._height,
             color: this._color.asArray(),
             name: this.name,
-            isCollapsed: true, //keeping closed to make reimporting cleaner
+            isCollapsed: saveCollapsedState ? this.isCollapsed: true, //keeping closed for stand along exporting.
             blocks: this.nodes.map(n => n.block.uniqueId),
             comments: this._comments
         }