|
@@ -1,18 +1,14 @@
|
|
import * as React from "react";
|
|
import * as React from "react";
|
|
import { GlobalState } from '../globalState';
|
|
import { GlobalState } from '../globalState';
|
|
import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
|
|
import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
|
|
-import { NodeMaterialBlockConnectionPointTypes } from 'babylonjs/Materials/Node/Enums/nodeMaterialBlockConnectionPointTypes';
|
|
|
|
import { GraphNode } from './graphNode';
|
|
import { GraphNode } from './graphNode';
|
|
import * as dagre from 'dagre';
|
|
import * as dagre from 'dagre';
|
|
import { Nullable } from 'babylonjs/types';
|
|
import { Nullable } from 'babylonjs/types';
|
|
import { NodePort } from './nodePort';
|
|
import { NodePort } from './nodePort';
|
|
-import { NodeMaterialConnectionPoint, NodeMaterialConnectionPointDirection, NodeMaterialConnectionPointCompatibilityStates } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPoint';
|
|
|
|
-import { Vector2 } from 'babylonjs/Maths/math.vector';
|
|
|
|
-import { FragmentOutputBlock } from 'babylonjs/Materials/Node/Blocks/Fragment/fragmentOutputBlock';
|
|
|
|
-import { InputBlock } from 'babylonjs/Materials/Node/Blocks/Input/inputBlock';
|
|
|
|
|
|
+
|
|
import { DataStorage } from 'babylonjs/Misc/dataStorage';
|
|
import { DataStorage } from 'babylonjs/Misc/dataStorage';
|
|
-import { IEditorData, IFrameData } from '../nodeLocationInfo';
|
|
|
|
-import { FrameNodePort } from './frameNodePort';
|
|
|
|
|
|
+import { IEditorData} from '../nodeLocationInfo';
|
|
|
|
+
|
|
import { Button } from 'babylonjs-gui/2D/controls/button';
|
|
import { Button } from 'babylonjs-gui/2D/controls/button';
|
|
import { Engine } from 'babylonjs/Engines/engine';
|
|
import { Engine } from 'babylonjs/Engines/engine';
|
|
import { Scene } from 'babylonjs/scene';
|
|
import { Scene } from 'babylonjs/scene';
|
|
@@ -26,12 +22,11 @@ export interface IGraphCanvasComponentProps {
|
|
}
|
|
}
|
|
|
|
|
|
export type FramePortData = {
|
|
export type FramePortData = {
|
|
- port: FrameNodePort
|
|
|
|
}
|
|
}
|
|
|
|
|
|
export const isFramePortData = (variableToCheck: any): variableToCheck is FramePortData => {
|
|
export const isFramePortData = (variableToCheck: any): variableToCheck is FramePortData => {
|
|
if (variableToCheck) {
|
|
if (variableToCheck) {
|
|
- return (variableToCheck as FramePortData).port !== undefined;
|
|
|
|
|
|
+ return (variableToCheck as FramePortData) !== undefined;
|
|
}
|
|
}
|
|
else return false;
|
|
else return false;
|
|
}
|
|
}
|
|
@@ -61,7 +56,6 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
|
|
private _selectedNodes: GraphNode[] = [];
|
|
private _selectedNodes: GraphNode[] = [];
|
|
private _selectedGuiNodes: GraphNode[] = [];
|
|
private _selectedGuiNodes: GraphNode[] = [];
|
|
private _selectedPort: Nullable<NodePort> = null;
|
|
private _selectedPort: Nullable<NodePort> = null;
|
|
- private _candidatePort: Nullable<NodePort | FrameNodePort> = null;
|
|
|
|
private _gridSize = 20;
|
|
private _gridSize = 20;
|
|
private _selectionBox: Nullable<HTMLDivElement> = null;
|
|
private _selectionBox: Nullable<HTMLDivElement> = null;
|
|
private _frameCandidate: Nullable<HTMLDivElement> = null;
|
|
private _frameCandidate: Nullable<HTMLDivElement> = null;
|
|
@@ -191,9 +185,6 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
- props.globalState.onCandidatePortSelectedObservable.add(port => {
|
|
|
|
- this._candidatePort = port;
|
|
|
|
- });
|
|
|
|
|
|
|
|
props.globalState.onGridSizeChanged.add(() => {
|
|
props.globalState.onGridSizeChanged.add(() => {
|
|
this.gridSize = DataStorage.ReadNumber("GridSize", 20);
|
|
this.gridSize = DataStorage.ReadNumber("GridSize", 20);
|
|
@@ -273,13 +264,6 @@ export class GraphCanvasComponent extends React.Component<IGraphCanvasComponentP
|
|
this._svgCanvas.innerHTML = "";
|
|
this._svgCanvas.innerHTML = "";
|
|
}
|
|
}
|
|
|
|
|
|
- connectPorts(pointA: NodeMaterialConnectionPoint, pointB: NodeMaterialConnectionPoint) {
|
|
|
|
- var blockA = pointA.ownerBlock;
|
|
|
|
- var blockB = pointB.ownerBlock;
|
|
|
|
- var nodeA = this.findNodeFromBlock(blockA);
|
|
|
|
- var nodeB = this.findNodeFromBlock(blockB);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
appendBlock(block: NodeMaterialBlock) {
|
|
appendBlock(block: NodeMaterialBlock) {
|