Przeglądaj źródła

working on importing

Pamela Wolf 5 lat temu
rodzic
commit
91ec3fafaa

Plik diff jest za duży
+ 1374 - 1373
dist/preview release/babylon.module.d.ts


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

@@ -1370,7 +1370,18 @@ export class GraphFrame {
         this.onExpandStateChanged.clear();
         this.onExpandStateChanged.clear();
     }
     }
 
 
+    private serializePortData(exposedPorts: NodePort[])
+    {
+        if(exposedPorts.length > 0) {
+            for(let i = 0; i < exposedPorts.length; ++i) {
+                //exposedPorts[i].exposedPortPosition = i;
+            }
+        }
+    }
+
     public serialize(): IFrameData {
     public serialize(): IFrameData {
+        //this.serializePortData(this._exposedInPorts);
+        //this.serializePortData(this._exposedOutPorts);
         return {
         return {
             x: this._x,
             x: this._x,
             y: this._y,
             y: this._y,
@@ -1406,7 +1417,7 @@ export class GraphFrame {
             for (var blockId of serializationData.blocks) {
             for (var blockId of serializationData.blocks) {
                 let actualId = map[blockId];
                 let actualId = map[blockId];
                 let node = canvas.nodes.filter(n => n.block.uniqueId === actualId);
                 let node = canvas.nodes.filter(n => n.block.uniqueId === actualId);
-
+                
                 if (node.length) {
                 if (node.length) {
                     newFrame.nodes.push(node[0]);
                     newFrame.nodes.push(node[0]);
                     node[0].enclosingFrameId = newFrame.id;
                     node[0].enclosingFrameId = newFrame.id;
@@ -1416,7 +1427,21 @@ export class GraphFrame {
             newFrame.refresh();
             newFrame.refresh();
         }
         }
 
 
-        newFrame.isCollapsed = isCollapsed;
+        /*for (var node of newFrame.nodes) {
+            for (var port of node.outputPorts) { // Output
+                if(port.exposedOnFrame) {
+                    port.isExposed = true;
+                    newFrame._exposedOutPorts[port.exposedPortPosition] = port;
+                }
+            }
+
+            for (var port of node.inputPorts) { // Inports
+                if(port.exposedOnFrame) {
+                    port.isExposed = true;
+                    newFrame._exposedInPorts[port.exposedPortPosition] = port;
+                }
+            }
+        } */       
 
 
         if (isCollapsed) {
         if (isCollapsed) {
             canvas._frameIsMoving = true;
             canvas._frameIsMoving = true;

+ 8 - 0
nodeEditor/src/diagram/nodePort.ts

@@ -79,6 +79,14 @@ export class NodePort {
         this.connectionPoint.isExposedOnFrame = value;
         this.connectionPoint.isExposedOnFrame = value;
     }
     }
     
     
+    /*public get exposedPortPosition()
+    {
+        return this.connectionPoint.exposedPortPosition;
+    }
+
+    public set exposedPortPosition(value: number) {
+        this.connectionPoint.exposedPortPosition = value;
+    }*/
     
     
     private _isConnectedToNodeOutsideOfFrame() {
     private _isConnectedToNodeOutsideOfFrame() {
         const link = this.node.getLinksForConnectionPoint(this.connectionPoint)
         const link = this.node.getLinksForConnectionPoint(this.connectionPoint)

+ 2 - 0
src/Materials/Node/nodeMaterialBlock.ts

@@ -741,6 +741,7 @@ export class NodeMaterialBlock {
                 }
                 }
                 if (port.isExposedOnFrame) {
                 if (port.isExposedOnFrame) {
                     this.inputs[i].isExposedOnFrame = port.isExposedOnFrame;
                     this.inputs[i].isExposedOnFrame = port.isExposedOnFrame;
+                   // this.inputs[i].exposedPortPosition = port.exposedPortPosition;
                 }
                 }
             });
             });
         }
         }
@@ -751,6 +752,7 @@ export class NodeMaterialBlock {
                 }
                 }
                 if (port.isExposedOnFrame) {
                 if (port.isExposedOnFrame) {
                     this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;
                     this.outputs[i].isExposedOnFrame = port.isExposedOnFrame;
+                   // this.outputs[i].exposedPortPosition = port.exposedPortPosition;
                 }
                 }
             });
             });
         }
         }

+ 4 - 0
src/Materials/Node/nodeMaterialBlockConnectionPoint.ts

@@ -151,6 +151,8 @@ export class NodeMaterialConnectionPoint {
      */
      */
     public isExposedOnFrame: boolean =  false;
     public isExposedOnFrame: boolean =  false;
 
 
+    //public exposedPortPosition: number = -1;
+
     /**
     /**
      * Gets or sets a string indicating that this uniform must be defined under a #ifdef
      * Gets or sets a string indicating that this uniform must be defined under a #ifdef
      */
      */
@@ -462,10 +464,12 @@ export class NodeMaterialConnectionPoint {
             serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;
             serializationObject.targetBlockId = this.connectedPoint.ownerBlock.uniqueId;
             serializationObject.targetConnectionName = this.connectedPoint.name;
             serializationObject.targetConnectionName = this.connectedPoint.name;
             serializationObject.isExposedOnFrame = true;
             serializationObject.isExposedOnFrame = true;
+            //serializationObject.exposedPortPosition = this.exposedPortPosition;
         }
         }
 
 
         if (this.isExposedOnFrame) {
         if (this.isExposedOnFrame) {
             serializationObject.isExposedOnFrame = this.isExposedOnFrame;
             serializationObject.isExposedOnFrame = this.isExposedOnFrame;
+            //serializationObject.exposedPortPosition = this.exposedPortPosition;
         }
         }
 
 
         return serializationObject;
         return serializationObject;