|
@@ -1,127 +1,4 @@
|
|
|
/// <reference types="react" />
|
|
|
-declare module "babylonjs-node-editor/components/diagram/generic/genericPortModel" {
|
|
|
- import { LinkModel, PortModel } from "storm-react-diagrams";
|
|
|
- import { Nullable } from 'babylonjs/types';
|
|
|
- import { NodeMaterialConnectionPoint } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPoint';
|
|
|
- import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
|
- /**
|
|
|
- * Port model for the generic node
|
|
|
- */
|
|
|
- export class GenericPortModel extends PortModel {
|
|
|
- /**
|
|
|
- * If the port is input or output
|
|
|
- */
|
|
|
- position: string | "input" | "output";
|
|
|
- /**
|
|
|
- * What the port is connected to
|
|
|
- */
|
|
|
- connection: Nullable<NodeMaterialConnectionPoint>;
|
|
|
- static idCounter: number;
|
|
|
- constructor(name: string, type?: string);
|
|
|
- syncWithNodeMaterialConnectionPoint(connection: NodeMaterialConnectionPoint): void;
|
|
|
- getNodeModel(): GenericNodeModel;
|
|
|
- link(outPort: GenericPortModel): LinkModel<import("storm-react-diagrams").LinkModelListener>;
|
|
|
- getInputFromBlock(): void;
|
|
|
- createLinkModel(): LinkModel;
|
|
|
- getValue: Function;
|
|
|
- static SortInputOutput(a: Nullable<GenericPortModel>, b: Nullable<GenericPortModel>): {
|
|
|
- input: GenericPortModel;
|
|
|
- output: GenericPortModel;
|
|
|
- } | null;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor/components/diagram/generic/genericNodeModel" {
|
|
|
- import { NodeModel } from "storm-react-diagrams";
|
|
|
- import { Nullable } from 'babylonjs/types';
|
|
|
- import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
|
|
|
- import { Texture } from 'babylonjs/Materials/Textures/texture';
|
|
|
- import { Vector2, Vector3, Vector4, Matrix } from 'babylonjs/Maths/math';
|
|
|
- import { GenericPortModel } from "babylonjs-node-editor/components/diagram/generic/genericPortModel";
|
|
|
- /**
|
|
|
- * Generic node model which stores information about a node editor block
|
|
|
- */
|
|
|
- export class GenericNodeModel extends NodeModel {
|
|
|
- /**
|
|
|
- * The babylon block this node represents
|
|
|
- */
|
|
|
- block: Nullable<NodeMaterialBlock>;
|
|
|
- /**
|
|
|
- * Labels for the block
|
|
|
- */
|
|
|
- headerLabels: Array<{
|
|
|
- text: string;
|
|
|
- }>;
|
|
|
- /**
|
|
|
- * Texture for the node if it exists
|
|
|
- */
|
|
|
- texture: Nullable<Texture>;
|
|
|
- /**
|
|
|
- * Vector2 for the node if it exists
|
|
|
- */
|
|
|
- vector2: Nullable<Vector2>;
|
|
|
- /**
|
|
|
- * Vector3 for the node if it exists
|
|
|
- */
|
|
|
- vector3: Nullable<Vector3>;
|
|
|
- /**
|
|
|
- * Vector4 for the node if it exists
|
|
|
- */
|
|
|
- vector4: Nullable<Vector4>;
|
|
|
- /**
|
|
|
- * Matrix for the node if it exists
|
|
|
- */
|
|
|
- matrix: Nullable<Matrix>;
|
|
|
- ports: {
|
|
|
- [s: string]: GenericPortModel;
|
|
|
- };
|
|
|
- /**
|
|
|
- * Constructs the node model
|
|
|
- */
|
|
|
- constructor();
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor/globalState" {
|
|
|
- import { NodeMaterial } from "babylonjs/Materials/Node/nodeMaterial";
|
|
|
- import { Nullable } from "babylonjs/types";
|
|
|
- import { Observable } from 'babylonjs/Misc/observable';
|
|
|
- import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
|
- export class GlobalState {
|
|
|
- nodeMaterial?: NodeMaterial;
|
|
|
- hostDocument?: Nullable<Document>;
|
|
|
- onSelectionChangedObservable: Observable<Nullable<GenericNodeModel>>;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor/sharedComponents/textureLineComponent" {
|
|
|
- import * as React from "react";
|
|
|
- import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
|
- interface ITextureLineComponentProps {
|
|
|
- texture: BaseTexture;
|
|
|
- width: number;
|
|
|
- height: number;
|
|
|
- globalState?: any;
|
|
|
- hideChannelSelect?: boolean;
|
|
|
- }
|
|
|
- export class TextureLineComponent extends React.Component<ITextureLineComponentProps, {
|
|
|
- displayRed: boolean;
|
|
|
- displayGreen: boolean;
|
|
|
- displayBlue: boolean;
|
|
|
- displayAlpha: boolean;
|
|
|
- face: number;
|
|
|
- }> {
|
|
|
- constructor(props: ITextureLineComponentProps);
|
|
|
- shouldComponentUpdate(nextProps: ITextureLineComponentProps, nextState: {
|
|
|
- displayRed: boolean;
|
|
|
- displayGreen: boolean;
|
|
|
- displayBlue: boolean;
|
|
|
- displayAlpha: boolean;
|
|
|
- face: number;
|
|
|
- }): boolean;
|
|
|
- componentDidMount(): void;
|
|
|
- componentDidUpdate(): void;
|
|
|
- updatePreview(): void;
|
|
|
- render(): JSX.Element;
|
|
|
- }
|
|
|
-}
|
|
|
declare module "babylonjs-node-editor/components/diagram/generic/genericNodeWidget" {
|
|
|
import * as React from "react";
|
|
|
import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
@@ -219,6 +96,32 @@ declare module "babylonjs-node-editor/components/nodeList/nodeListComponent" {
|
|
|
render(): JSX.Element;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs-node-editor/components/propertyTab/propertyTabComponent" {
|
|
|
+ import * as React from "react";
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+ import { Nullable } from 'babylonjs/types';
|
|
|
+ import { DefaultNodeModel } from "babylonjs-node-editor/components/diagram/defaultNodeModel";
|
|
|
+ interface IPropertyTabComponentProps {
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ export class PropertyTabComponent extends React.Component<IPropertyTabComponentProps, {
|
|
|
+ currentNode: Nullable<DefaultNodeModel>;
|
|
|
+ }> {
|
|
|
+ constructor(props: IPropertyTabComponentProps);
|
|
|
+ componentWillMount(): void;
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor/portal" {
|
|
|
+ import * as React from "react";
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+ interface IPortalProps {
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ export class Portal extends React.Component<IPortalProps> {
|
|
|
+ render(): React.ReactPortal;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs-node-editor/sharedComponents/fileButtonLineComponent" {
|
|
|
import * as React from "react";
|
|
|
interface IFileButtonLineComponentProps {
|
|
@@ -235,10 +138,10 @@ declare module "babylonjs-node-editor/sharedComponents/fileButtonLineComponent"
|
|
|
declare module "babylonjs-node-editor/components/propertyTab/properties/texturePropertyTabComponent" {
|
|
|
import * as React from "react";
|
|
|
import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
- import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
|
+ import { TextureNodeModel } from "babylonjs-node-editor/components/diagram/texture/textureNodeModel";
|
|
|
interface ITexturePropertyTabComponentProps {
|
|
|
globalState: GlobalState;
|
|
|
- node: GenericNodeModel;
|
|
|
+ node: TextureNodeModel;
|
|
|
}
|
|
|
export class TexturePropertyTabComponent extends React.Component<ITexturePropertyTabComponentProps> {
|
|
|
/**
|
|
@@ -249,6 +152,144 @@ declare module "babylonjs-node-editor/components/propertyTab/properties/textureP
|
|
|
render(): JSX.Element;
|
|
|
}
|
|
|
}
|
|
|
+declare module "babylonjs-node-editor/components/diagram/texture/textureNodeModel" {
|
|
|
+ import { Nullable } from 'babylonjs/types';
|
|
|
+ import { Texture } from 'babylonjs/Materials/Textures/texture';
|
|
|
+ import { DefaultNodeModel } from "babylonjs-node-editor/components/diagram/defaultNodeModel";
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+ /**
|
|
|
+ * Texture node model which stores information about a node editor block
|
|
|
+ */
|
|
|
+ export class TextureNodeModel extends DefaultNodeModel {
|
|
|
+ /**
|
|
|
+ * Texture for the node if it exists
|
|
|
+ */
|
|
|
+ texture: Nullable<Texture>;
|
|
|
+ /**
|
|
|
+ * Constructs the node model
|
|
|
+ */
|
|
|
+ constructor();
|
|
|
+ renderProperties(globalState: GlobalState): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor/sharedComponents/textureLineComponent" {
|
|
|
+ import * as React from "react";
|
|
|
+ import { BaseTexture } from "babylonjs/Materials/Textures/baseTexture";
|
|
|
+ interface ITextureLineComponentProps {
|
|
|
+ texture: BaseTexture;
|
|
|
+ width: number;
|
|
|
+ height: number;
|
|
|
+ globalState?: any;
|
|
|
+ hideChannelSelect?: boolean;
|
|
|
+ }
|
|
|
+ export class TextureLineComponent extends React.Component<ITextureLineComponentProps, {
|
|
|
+ displayRed: boolean;
|
|
|
+ displayGreen: boolean;
|
|
|
+ displayBlue: boolean;
|
|
|
+ displayAlpha: boolean;
|
|
|
+ face: number;
|
|
|
+ }> {
|
|
|
+ constructor(props: ITextureLineComponentProps);
|
|
|
+ shouldComponentUpdate(nextProps: ITextureLineComponentProps, nextState: {
|
|
|
+ displayRed: boolean;
|
|
|
+ displayGreen: boolean;
|
|
|
+ displayBlue: boolean;
|
|
|
+ displayAlpha: boolean;
|
|
|
+ face: number;
|
|
|
+ }): boolean;
|
|
|
+ componentDidMount(): void;
|
|
|
+ componentDidUpdate(): void;
|
|
|
+ updatePreview(): void;
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor/components/diagram/texture/textureNodeWidget" {
|
|
|
+ import * as React from "react";
|
|
|
+ import { TextureNodeModel } from "babylonjs-node-editor/components/diagram/texture/textureNodeModel";
|
|
|
+ import { Nullable } from 'babylonjs/types';
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+ /**
|
|
|
+ * GenericNodeWidgetProps
|
|
|
+ */
|
|
|
+ export interface TextureNodeWidgetProps {
|
|
|
+ node: Nullable<TextureNodeModel>;
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Used to display a node block for the node editor
|
|
|
+ */
|
|
|
+ export class TextureNodeWidget extends React.Component<TextureNodeWidgetProps> {
|
|
|
+ /**
|
|
|
+ * Creates a GenericNodeWidget
|
|
|
+ * @param props
|
|
|
+ */
|
|
|
+ constructor(props: TextureNodeWidgetProps);
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor/components/diagram/texture/textureNodeFactory" {
|
|
|
+ import * as SRD from "storm-react-diagrams";
|
|
|
+ import { TextureNodeModel } from "babylonjs-node-editor/components/diagram/texture/textureNodeModel";
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+ /**
|
|
|
+ * Node factory which creates editor nodes
|
|
|
+ */
|
|
|
+ export class TextureNodeFactory extends SRD.AbstractNodeFactory {
|
|
|
+ private _globalState;
|
|
|
+ /**
|
|
|
+ * Constructs a TextureNodeFactory
|
|
|
+ */
|
|
|
+ constructor(globalState: GlobalState);
|
|
|
+ /**
|
|
|
+ * Generates a node widget
|
|
|
+ * @param diagramEngine diagram engine
|
|
|
+ * @param node node to generate
|
|
|
+ * @returns node widget jsx
|
|
|
+ */
|
|
|
+ generateReactWidget(diagramEngine: SRD.DiagramEngine, node: TextureNodeModel): JSX.Element;
|
|
|
+ /**
|
|
|
+ * Gets a new instance of a node model
|
|
|
+ * @returns texture node model
|
|
|
+ */
|
|
|
+ getNewInstance(): TextureNodeModel;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor/graphEditor" {
|
|
|
+ import * as React from "react";
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+ import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
|
+ import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
|
|
|
+ import { NodeMaterialConnectionPoint } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPoint';
|
|
|
+ import { TextureNodeModel } from "babylonjs-node-editor/components/diagram/texture/textureNodeModel";
|
|
|
+ interface IGraphEditorProps {
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ export class NodeCreationOptions {
|
|
|
+ column: number;
|
|
|
+ nodeMaterialBlock?: NodeMaterialBlock;
|
|
|
+ type?: string;
|
|
|
+ }
|
|
|
+ export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
|
+ private _engine;
|
|
|
+ private _model;
|
|
|
+ private _nodes;
|
|
|
+ /**
|
|
|
+ * Current row/column position used when adding new nodes
|
|
|
+ */
|
|
|
+ private _rowPos;
|
|
|
+ /**
|
|
|
+ * Creates a node and recursivly creates its parent nodes from it's input
|
|
|
+ * @param nodeMaterialBlock
|
|
|
+ */
|
|
|
+ createNodeFromObject(options: NodeCreationOptions): GenericNodeModel | TextureNodeModel;
|
|
|
+ componentDidMount(): void;
|
|
|
+ componentWillUnmount(): void;
|
|
|
+ constructor(props: IGraphEditorProps);
|
|
|
+ addNodeFromClass(ObjectClass: typeof NodeMaterialBlock): GenericNodeModel | TextureNodeModel;
|
|
|
+ addValueNode(type: string, column?: number, connection?: NodeMaterialConnectionPoint): GenericNodeModel | TextureNodeModel | null;
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
declare module "babylonjs-node-editor/sharedComponents/numericInputComponent" {
|
|
|
import * as React from "react";
|
|
|
interface INumericInputComponentProps {
|
|
@@ -372,95 +413,55 @@ declare module "babylonjs-node-editor/components/propertyTab/properties/vector3P
|
|
|
render(): JSX.Element;
|
|
|
}
|
|
|
}
|
|
|
-declare module "babylonjs-node-editor/components/propertyTab/propertyTabComponent" {
|
|
|
- import * as React from "react";
|
|
|
- import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+declare module "babylonjs-node-editor/components/diagram/generic/genericNodeModel" {
|
|
|
import { Nullable } from 'babylonjs/types';
|
|
|
- import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
|
- interface IPropertyTabComponentProps {
|
|
|
- globalState: GlobalState;
|
|
|
- }
|
|
|
- export class PropertyTabComponent extends React.Component<IPropertyTabComponentProps, {
|
|
|
- currentNode: Nullable<GenericNodeModel>;
|
|
|
- }> {
|
|
|
- constructor(props: IPropertyTabComponentProps);
|
|
|
- componentWillMount(): void;
|
|
|
- render(): JSX.Element;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor/components/graphEditor" {
|
|
|
- import * as React from "react";
|
|
|
- import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
- import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
|
- import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
|
|
|
+ import { Vector2, Vector3, Vector4, Matrix } from 'babylonjs/Maths/math';
|
|
|
+ import { DefaultNodeModel } from "babylonjs-node-editor/components/diagram/defaultNodeModel";
|
|
|
+ import { DiagramModel } from 'storm-react-diagrams/dist/@types/src/models/DiagramModel';
|
|
|
+ import { GraphEditor, NodeCreationOptions } from "babylonjs-node-editor/graphEditor";
|
|
|
+ import { GenericPortModel } from "babylonjs-node-editor/components/diagram/generic/genericPortModel";
|
|
|
import { NodeMaterialConnectionPoint } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPoint';
|
|
|
- interface IGraphEditorProps {
|
|
|
- globalState: GlobalState;
|
|
|
- }
|
|
|
- export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
|
- private _engine;
|
|
|
- private _model;
|
|
|
- private _nodes;
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
+ /**
|
|
|
+ * Generic node model which stores information about a node editor block
|
|
|
+ */
|
|
|
+ export class GenericNodeModel extends DefaultNodeModel {
|
|
|
/**
|
|
|
- * Current row/column position used when adding new nodes
|
|
|
+ * Labels for the block
|
|
|
*/
|
|
|
- private _rowPos;
|
|
|
+ headerLabels: Array<{
|
|
|
+ text: string;
|
|
|
+ }>;
|
|
|
/**
|
|
|
- * Creates a node and recursivly creates its parent nodes from it's input
|
|
|
- * @param nodeMaterialBlock
|
|
|
+ * Vector2 for the node if it exists
|
|
|
*/
|
|
|
- createNodeFromObject(options: {
|
|
|
- column: number;
|
|
|
- nodeMaterialBlock?: NodeMaterialBlock;
|
|
|
- }): GenericNodeModel;
|
|
|
- componentDidMount(): void;
|
|
|
- componentWillUnmount(): void;
|
|
|
- constructor(props: IGraphEditorProps);
|
|
|
- addNodeFromClass(ObjectClass: typeof NodeMaterialBlock): GenericNodeModel;
|
|
|
- addValueNode(type: string, column?: number, connection?: NodeMaterialConnectionPoint): GenericNodeModel;
|
|
|
- render(): JSX.Element;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor/sharedComponents/popup" {
|
|
|
- export class Popup {
|
|
|
- static CreatePopup(title: string, windowVariableName: string, width?: number, height?: number): HTMLDivElement | null;
|
|
|
- private static _CopyStyles;
|
|
|
- }
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor/nodeEditor" {
|
|
|
- import { NodeMaterial } from "babylonjs/Materials/Node/nodeMaterial";
|
|
|
- /**
|
|
|
- * Interface used to specify creation options for the node editor
|
|
|
- */
|
|
|
- export interface INodeEditorOptions {
|
|
|
+ vector2: Nullable<Vector2>;
|
|
|
/**
|
|
|
- * Defines the DOM element that will host the node editor
|
|
|
+ * Vector3 for the node if it exists
|
|
|
*/
|
|
|
- hostElement?: HTMLDivElement;
|
|
|
- nodeMaterial?: NodeMaterial;
|
|
|
- }
|
|
|
- /**
|
|
|
- * Class used to create a node editor
|
|
|
- */
|
|
|
- export class NodeEditor {
|
|
|
+ vector3: Nullable<Vector3>;
|
|
|
/**
|
|
|
- * Show the node editor
|
|
|
- * @param options defines the options to use to configure the node editor
|
|
|
+ * Vector4 for the node if it exists
|
|
|
*/
|
|
|
- static Show(options: INodeEditorOptions): void;
|
|
|
+ vector4: Nullable<Vector4>;
|
|
|
+ /**
|
|
|
+ * Matrix for the node if it exists
|
|
|
+ */
|
|
|
+ matrix: Nullable<Matrix>;
|
|
|
+ /**
|
|
|
+ * Constructs the node model
|
|
|
+ */
|
|
|
+ constructor();
|
|
|
+ prepareConnection(type: string, outPort: GenericPortModel, connection?: NodeMaterialConnectionPoint): void;
|
|
|
+ prepare(options: NodeCreationOptions, nodes: Array<DefaultNodeModel>, model: DiagramModel, graphEditor: GraphEditor): void;
|
|
|
+ renderProperties(globalState: GlobalState): JSX.Element | null;
|
|
|
}
|
|
|
}
|
|
|
-declare module "babylonjs-node-editor/index" {
|
|
|
- export * from "babylonjs-node-editor/nodeEditor";
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor/legacy/legacy" {
|
|
|
- export * from "babylonjs-node-editor/index";
|
|
|
-}
|
|
|
-declare module "babylonjs-node-editor" {
|
|
|
- export * from "babylonjs-node-editor/legacy/legacy";
|
|
|
-}
|
|
|
-/// <reference types="react" />
|
|
|
-declare module NODEEDITOR {
|
|
|
+declare module "babylonjs-node-editor/components/diagram/generic/genericPortModel" {
|
|
|
+ import { LinkModel, PortModel } from "storm-react-diagrams";
|
|
|
+ import { Nullable } from 'babylonjs/types';
|
|
|
+ import { NodeMaterialConnectionPoint } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPoint';
|
|
|
+ import { GenericNodeModel } from "babylonjs-node-editor/components/diagram/generic/genericNodeModel";
|
|
|
/**
|
|
|
* Port model for the generic node
|
|
|
*/
|
|
@@ -472,101 +473,96 @@ declare module NODEEDITOR {
|
|
|
/**
|
|
|
* What the port is connected to
|
|
|
*/
|
|
|
- connection: BABYLON.Nullable<BABYLON.NodeMaterialConnectionPoint>;
|
|
|
+ connection: Nullable<NodeMaterialConnectionPoint>;
|
|
|
static idCounter: number;
|
|
|
constructor(name: string, type?: string);
|
|
|
- syncWithNodeMaterialConnectionPoint(connection: BABYLON.NodeMaterialConnectionPoint): void;
|
|
|
+ syncWithNodeMaterialConnectionPoint(connection: NodeMaterialConnectionPoint): void;
|
|
|
getNodeModel(): GenericNodeModel;
|
|
|
link(outPort: GenericPortModel): LinkModel<import("storm-react-diagrams").LinkModelListener>;
|
|
|
getInputFromBlock(): void;
|
|
|
createLinkModel(): LinkModel;
|
|
|
getValue: Function;
|
|
|
- static SortInputOutput(a: BABYLON.Nullable<GenericPortModel>, b: BABYLON.Nullable<GenericPortModel>): {
|
|
|
+ static SortInputOutput(a: Nullable<GenericPortModel>, b: Nullable<GenericPortModel>): {
|
|
|
input: GenericPortModel;
|
|
|
output: GenericPortModel;
|
|
|
} | null;
|
|
|
}
|
|
|
}
|
|
|
-declare module NODEEDITOR {
|
|
|
+declare module "babylonjs-node-editor/components/diagram/defaultNodeModel" {
|
|
|
+ import { NodeModel, DiagramModel } from "storm-react-diagrams";
|
|
|
+ import { Nullable } from 'babylonjs/types';
|
|
|
+ import { NodeMaterialBlock } from 'babylonjs/Materials/Node/nodeMaterialBlock';
|
|
|
+ import { GenericPortModel } from "babylonjs-node-editor/components/diagram/generic/genericPortModel";
|
|
|
+ import { GraphEditor, NodeCreationOptions } from "babylonjs-node-editor/graphEditor";
|
|
|
+ import { NodeMaterialConnectionPoint } from 'babylonjs/Materials/Node/nodeMaterialBlockConnectionPoint';
|
|
|
+ import { GlobalState } from "babylonjs-node-editor/globalState";
|
|
|
/**
|
|
|
* Generic node model which stores information about a node editor block
|
|
|
*/
|
|
|
- export class GenericNodeModel extends NodeModel {
|
|
|
+ export class DefaultNodeModel extends NodeModel {
|
|
|
/**
|
|
|
* The babylon block this node represents
|
|
|
*/
|
|
|
- block: BABYLON.Nullable<BABYLON.NodeMaterialBlock>;
|
|
|
- /**
|
|
|
- * Labels for the block
|
|
|
- */
|
|
|
- headerLabels: Array<{
|
|
|
- text: string;
|
|
|
- }>;
|
|
|
- /**
|
|
|
- * BABYLON.Texture for the node if it exists
|
|
|
- */
|
|
|
- texture: BABYLON.Nullable<BABYLON.Texture>;
|
|
|
- /**
|
|
|
- * BABYLON.Vector2 for the node if it exists
|
|
|
- */
|
|
|
- vector2: BABYLON.Nullable<BABYLON.Vector2>;
|
|
|
- /**
|
|
|
- * BABYLON.Vector3 for the node if it exists
|
|
|
- */
|
|
|
- vector3: BABYLON.Nullable<BABYLON.Vector3>;
|
|
|
- /**
|
|
|
- * BABYLON.Vector4 for the node if it exists
|
|
|
- */
|
|
|
- vector4: BABYLON.Nullable<BABYLON.Vector4>;
|
|
|
- /**
|
|
|
- * BABYLON.Matrix for the node if it exists
|
|
|
- */
|
|
|
- matrix: BABYLON.Nullable<BABYLON.Matrix>;
|
|
|
+ block: Nullable<NodeMaterialBlock>;
|
|
|
ports: {
|
|
|
[s: string]: GenericPortModel;
|
|
|
};
|
|
|
/**
|
|
|
* Constructs the node model
|
|
|
*/
|
|
|
- constructor();
|
|
|
+ constructor(key: string);
|
|
|
+ prepareConnection(type: string, outPort: GenericPortModel, connection?: NodeMaterialConnectionPoint): void;
|
|
|
+ prepare(options: NodeCreationOptions, nodes: Array<DefaultNodeModel>, model: DiagramModel, graphEditor: GraphEditor): void;
|
|
|
+ renderProperties(globalState: GlobalState): JSX.Element | null;
|
|
|
}
|
|
|
}
|
|
|
-declare module NODEEDITOR {
|
|
|
+declare module "babylonjs-node-editor/globalState" {
|
|
|
+ import { NodeMaterial } from "babylonjs/Materials/Node/nodeMaterial";
|
|
|
+ import { Nullable } from "babylonjs/types";
|
|
|
+ import { Observable } from 'babylonjs/Misc/observable';
|
|
|
+ import { DefaultNodeModel } from "babylonjs-node-editor/components/diagram/defaultNodeModel";
|
|
|
export class GlobalState {
|
|
|
- nodeMaterial?: BABYLON.NodeMaterial;
|
|
|
- hostDocument?: BABYLON.Nullable<Document>;
|
|
|
- onSelectionChangedObservable: BABYLON.Observable<BABYLON.Nullable<GenericNodeModel>>;
|
|
|
+ nodeMaterial?: NodeMaterial;
|
|
|
+ hostElement: HTMLElement;
|
|
|
+ hostDocument: HTMLDocument;
|
|
|
+ onSelectionChangedObservable: Observable<Nullable<DefaultNodeModel>>;
|
|
|
}
|
|
|
}
|
|
|
-declare module NODEEDITOR {
|
|
|
- interface ITextureLineComponentProps {
|
|
|
- texture: BABYLON.BaseTexture;
|
|
|
- width: number;
|
|
|
- height: number;
|
|
|
- globalState?: any;
|
|
|
- hideChannelSelect?: boolean;
|
|
|
+declare module "babylonjs-node-editor/sharedComponents/popup" {
|
|
|
+ export class Popup {
|
|
|
+ static CreatePopup(title: string, windowVariableName: string, width?: number, height?: number): HTMLDivElement | null;
|
|
|
+ private static _CopyStyles;
|
|
|
}
|
|
|
- export class TextureLineComponent extends React.Component<ITextureLineComponentProps, {
|
|
|
- displayRed: boolean;
|
|
|
- displayGreen: boolean;
|
|
|
- displayBlue: boolean;
|
|
|
- displayAlpha: boolean;
|
|
|
- face: number;
|
|
|
- }> {
|
|
|
- constructor(props: ITextureLineComponentProps);
|
|
|
- shouldComponentUpdate(nextProps: ITextureLineComponentProps, nextState: {
|
|
|
- displayRed: boolean;
|
|
|
- displayGreen: boolean;
|
|
|
- displayBlue: boolean;
|
|
|
- displayAlpha: boolean;
|
|
|
- face: number;
|
|
|
- }): boolean;
|
|
|
- componentDidMount(): void;
|
|
|
- componentDidUpdate(): void;
|
|
|
- updatePreview(): void;
|
|
|
- render(): JSX.Element;
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor/nodeEditor" {
|
|
|
+ import { NodeMaterial } from "babylonjs/Materials/Node/nodeMaterial";
|
|
|
+ /**
|
|
|
+ * Interface used to specify creation options for the node editor
|
|
|
+ */
|
|
|
+ export interface INodeEditorOptions {
|
|
|
+ nodeMaterial: NodeMaterial;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * Class used to create a node editor
|
|
|
+ */
|
|
|
+ export class NodeEditor {
|
|
|
+ /**
|
|
|
+ * Show the node editor
|
|
|
+ * @param options defines the options to use to configure the node editor
|
|
|
+ */
|
|
|
+ static Show(options: INodeEditorOptions): void;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor/index" {
|
|
|
+ export * from "babylonjs-node-editor/nodeEditor";
|
|
|
}
|
|
|
+declare module "babylonjs-node-editor/legacy/legacy" {
|
|
|
+ export * from "babylonjs-node-editor/index";
|
|
|
+}
|
|
|
+declare module "babylonjs-node-editor" {
|
|
|
+ export * from "babylonjs-node-editor/legacy/legacy";
|
|
|
+}
|
|
|
+/// <reference types="react" />
|
|
|
declare module NODEEDITOR {
|
|
|
/**
|
|
|
* GenericNodeWidgetProps
|
|
@@ -653,6 +649,26 @@ declare module NODEEDITOR {
|
|
|
}
|
|
|
}
|
|
|
declare module NODEEDITOR {
|
|
|
+ interface IPropertyTabComponentProps {
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ export class PropertyTabComponent extends React.Component<IPropertyTabComponentProps, {
|
|
|
+ currentNode: BABYLON.Nullable<DefaultNodeModel>;
|
|
|
+ }> {
|
|
|
+ constructor(props: IPropertyTabComponentProps);
|
|
|
+ componentWillMount(): void;
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
+ interface IPortalProps {
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ export class Portal extends React.Component<IPortalProps> {
|
|
|
+ render(): React.ReactPortal;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
interface IFileButtonLineComponentProps {
|
|
|
label: string;
|
|
|
onClick: (file: File) => void;
|
|
@@ -667,7 +683,7 @@ declare module NODEEDITOR {
|
|
|
declare module NODEEDITOR {
|
|
|
interface ITexturePropertyTabComponentProps {
|
|
|
globalState: GlobalState;
|
|
|
- node: GenericNodeModel;
|
|
|
+ node: TextureNodeModel;
|
|
|
}
|
|
|
export class TexturePropertyTabComponent extends React.Component<ITexturePropertyTabComponentProps> {
|
|
|
/**
|
|
@@ -679,6 +695,125 @@ declare module NODEEDITOR {
|
|
|
}
|
|
|
}
|
|
|
declare module NODEEDITOR {
|
|
|
+ /**
|
|
|
+ * BABYLON.Texture node model which stores information about a node editor block
|
|
|
+ */
|
|
|
+ export class TextureNodeModel extends DefaultNodeModel {
|
|
|
+ /**
|
|
|
+ * BABYLON.Texture for the node if it exists
|
|
|
+ */
|
|
|
+ texture: BABYLON.Nullable<BABYLON.Texture>;
|
|
|
+ /**
|
|
|
+ * Constructs the node model
|
|
|
+ */
|
|
|
+ constructor();
|
|
|
+ renderProperties(globalState: GlobalState): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
+ interface ITextureLineComponentProps {
|
|
|
+ texture: BABYLON.BaseTexture;
|
|
|
+ width: number;
|
|
|
+ height: number;
|
|
|
+ globalState?: any;
|
|
|
+ hideChannelSelect?: boolean;
|
|
|
+ }
|
|
|
+ export class TextureLineComponent extends React.Component<ITextureLineComponentProps, {
|
|
|
+ displayRed: boolean;
|
|
|
+ displayGreen: boolean;
|
|
|
+ displayBlue: boolean;
|
|
|
+ displayAlpha: boolean;
|
|
|
+ face: number;
|
|
|
+ }> {
|
|
|
+ constructor(props: ITextureLineComponentProps);
|
|
|
+ shouldComponentUpdate(nextProps: ITextureLineComponentProps, nextState: {
|
|
|
+ displayRed: boolean;
|
|
|
+ displayGreen: boolean;
|
|
|
+ displayBlue: boolean;
|
|
|
+ displayAlpha: boolean;
|
|
|
+ face: number;
|
|
|
+ }): boolean;
|
|
|
+ componentDidMount(): void;
|
|
|
+ componentDidUpdate(): void;
|
|
|
+ updatePreview(): void;
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
+ /**
|
|
|
+ * GenericNodeWidgetProps
|
|
|
+ */
|
|
|
+ export interface TextureNodeWidgetProps {
|
|
|
+ node: BABYLON.Nullable<TextureNodeModel>;
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * Used to display a node block for the node editor
|
|
|
+ */
|
|
|
+ export class TextureNodeWidget extends React.Component<TextureNodeWidgetProps> {
|
|
|
+ /**
|
|
|
+ * Creates a GenericNodeWidget
|
|
|
+ * @param props
|
|
|
+ */
|
|
|
+ constructor(props: TextureNodeWidgetProps);
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
+ /**
|
|
|
+ * Node factory which creates editor nodes
|
|
|
+ */
|
|
|
+ export class TextureNodeFactory extends SRD.AbstractNodeFactory {
|
|
|
+ private _globalState;
|
|
|
+ /**
|
|
|
+ * Constructs a TextureNodeFactory
|
|
|
+ */
|
|
|
+ constructor(globalState: GlobalState);
|
|
|
+ /**
|
|
|
+ * Generates a node widget
|
|
|
+ * @param diagramEngine diagram engine
|
|
|
+ * @param node node to generate
|
|
|
+ * @returns node widget jsx
|
|
|
+ */
|
|
|
+ generateReactWidget(diagramEngine: SRD.DiagramEngine, node: TextureNodeModel): JSX.Element;
|
|
|
+ /**
|
|
|
+ * Gets a new instance of a node model
|
|
|
+ * @returns texture node model
|
|
|
+ */
|
|
|
+ getNewInstance(): TextureNodeModel;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
+ interface IGraphEditorProps {
|
|
|
+ globalState: GlobalState;
|
|
|
+ }
|
|
|
+ export class NodeCreationOptions {
|
|
|
+ column: number;
|
|
|
+ nodeMaterialBlock?: BABYLON.NodeMaterialBlock;
|
|
|
+ type?: string;
|
|
|
+ }
|
|
|
+ export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
|
+ private _engine;
|
|
|
+ private _model;
|
|
|
+ private _nodes;
|
|
|
+ /**
|
|
|
+ * Current row/column position used when adding new nodes
|
|
|
+ */
|
|
|
+ private _rowPos;
|
|
|
+ /**
|
|
|
+ * Creates a node and recursivly creates its parent nodes from it's input
|
|
|
+ * @param nodeMaterialBlock
|
|
|
+ */
|
|
|
+ createNodeFromObject(options: NodeCreationOptions): GenericNodeModel | TextureNodeModel;
|
|
|
+ componentDidMount(): void;
|
|
|
+ componentWillUnmount(): void;
|
|
|
+ constructor(props: IGraphEditorProps);
|
|
|
+ addNodeFromClass(ObjectClass: typeof BABYLON.NodeMaterialBlock): GenericNodeModel | TextureNodeModel;
|
|
|
+ addValueNode(type: string, column?: number, connection?: BABYLON.NodeMaterialConnectionPoint): GenericNodeModel | TextureNodeModel | null;
|
|
|
+ render(): JSX.Element;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
interface INumericInputComponentProps {
|
|
|
label: string;
|
|
|
value: number;
|
|
@@ -787,43 +922,95 @@ declare module NODEEDITOR {
|
|
|
}
|
|
|
}
|
|
|
declare module NODEEDITOR {
|
|
|
- interface IPropertyTabComponentProps {
|
|
|
- globalState: GlobalState;
|
|
|
- }
|
|
|
- export class PropertyTabComponent extends React.Component<IPropertyTabComponentProps, {
|
|
|
- currentNode: BABYLON.Nullable<GenericNodeModel>;
|
|
|
- }> {
|
|
|
- constructor(props: IPropertyTabComponentProps);
|
|
|
- componentWillMount(): void;
|
|
|
- render(): JSX.Element;
|
|
|
+ /**
|
|
|
+ * Generic node model which stores information about a node editor block
|
|
|
+ */
|
|
|
+ export class GenericNodeModel extends DefaultNodeModel {
|
|
|
+ /**
|
|
|
+ * Labels for the block
|
|
|
+ */
|
|
|
+ headerLabels: Array<{
|
|
|
+ text: string;
|
|
|
+ }>;
|
|
|
+ /**
|
|
|
+ * BABYLON.Vector2 for the node if it exists
|
|
|
+ */
|
|
|
+ vector2: BABYLON.Nullable<BABYLON.Vector2>;
|
|
|
+ /**
|
|
|
+ * BABYLON.Vector3 for the node if it exists
|
|
|
+ */
|
|
|
+ vector3: BABYLON.Nullable<BABYLON.Vector3>;
|
|
|
+ /**
|
|
|
+ * BABYLON.Vector4 for the node if it exists
|
|
|
+ */
|
|
|
+ vector4: BABYLON.Nullable<BABYLON.Vector4>;
|
|
|
+ /**
|
|
|
+ * BABYLON.Matrix for the node if it exists
|
|
|
+ */
|
|
|
+ matrix: BABYLON.Nullable<BABYLON.Matrix>;
|
|
|
+ /**
|
|
|
+ * Constructs the node model
|
|
|
+ */
|
|
|
+ constructor();
|
|
|
+ prepareConnection(type: string, outPort: GenericPortModel, connection?: BABYLON.NodeMaterialConnectionPoint): void;
|
|
|
+ prepare(options: NodeCreationOptions, nodes: Array<DefaultNodeModel>, model: DiagramModel, graphEditor: GraphEditor): void;
|
|
|
+ renderProperties(globalState: GlobalState): JSX.Element | null;
|
|
|
}
|
|
|
}
|
|
|
declare module NODEEDITOR {
|
|
|
- interface IGraphEditorProps {
|
|
|
- globalState: GlobalState;
|
|
|
+ /**
|
|
|
+ * Port model for the generic node
|
|
|
+ */
|
|
|
+ export class GenericPortModel extends PortModel {
|
|
|
+ /**
|
|
|
+ * If the port is input or output
|
|
|
+ */
|
|
|
+ position: string | "input" | "output";
|
|
|
+ /**
|
|
|
+ * What the port is connected to
|
|
|
+ */
|
|
|
+ connection: BABYLON.Nullable<BABYLON.NodeMaterialConnectionPoint>;
|
|
|
+ static idCounter: number;
|
|
|
+ constructor(name: string, type?: string);
|
|
|
+ syncWithNodeMaterialConnectionPoint(connection: BABYLON.NodeMaterialConnectionPoint): void;
|
|
|
+ getNodeModel(): GenericNodeModel;
|
|
|
+ link(outPort: GenericPortModel): LinkModel<import("storm-react-diagrams").LinkModelListener>;
|
|
|
+ getInputFromBlock(): void;
|
|
|
+ createLinkModel(): LinkModel;
|
|
|
+ getValue: Function;
|
|
|
+ static SortInputOutput(a: BABYLON.Nullable<GenericPortModel>, b: BABYLON.Nullable<GenericPortModel>): {
|
|
|
+ input: GenericPortModel;
|
|
|
+ output: GenericPortModel;
|
|
|
+ } | null;
|
|
|
}
|
|
|
- export class GraphEditor extends React.Component<IGraphEditorProps> {
|
|
|
- private _engine;
|
|
|
- private _model;
|
|
|
- private _nodes;
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
+ /**
|
|
|
+ * Generic node model which stores information about a node editor block
|
|
|
+ */
|
|
|
+ export class DefaultNodeModel extends NodeModel {
|
|
|
/**
|
|
|
- * Current row/column position used when adding new nodes
|
|
|
+ * The babylon block this node represents
|
|
|
*/
|
|
|
- private _rowPos;
|
|
|
+ block: BABYLON.Nullable<BABYLON.NodeMaterialBlock>;
|
|
|
+ ports: {
|
|
|
+ [s: string]: GenericPortModel;
|
|
|
+ };
|
|
|
/**
|
|
|
- * Creates a node and recursivly creates its parent nodes from it's input
|
|
|
- * @param nodeMaterialBlock
|
|
|
+ * Constructs the node model
|
|
|
*/
|
|
|
- createNodeFromObject(options: {
|
|
|
- column: number;
|
|
|
- nodeMaterialBlock?: BABYLON.NodeMaterialBlock;
|
|
|
- }): GenericNodeModel;
|
|
|
- componentDidMount(): void;
|
|
|
- componentWillUnmount(): void;
|
|
|
- constructor(props: IGraphEditorProps);
|
|
|
- addNodeFromClass(ObjectClass: typeof BABYLON.NodeMaterialBlock): GenericNodeModel;
|
|
|
- addValueNode(type: string, column?: number, connection?: BABYLON.NodeMaterialConnectionPoint): GenericNodeModel;
|
|
|
- render(): JSX.Element;
|
|
|
+ constructor(key: string);
|
|
|
+ prepareConnection(type: string, outPort: GenericPortModel, connection?: BABYLON.NodeMaterialConnectionPoint): void;
|
|
|
+ prepare(options: NodeCreationOptions, nodes: Array<DefaultNodeModel>, model: DiagramModel, graphEditor: GraphEditor): void;
|
|
|
+ renderProperties(globalState: GlobalState): JSX.Element | null;
|
|
|
+ }
|
|
|
+}
|
|
|
+declare module NODEEDITOR {
|
|
|
+ export class GlobalState {
|
|
|
+ nodeMaterial?: BABYLON.NodeMaterial;
|
|
|
+ hostElement: HTMLElement;
|
|
|
+ hostDocument: HTMLDocument;
|
|
|
+ onSelectionChangedObservable: BABYLON.Observable<BABYLON.Nullable<DefaultNodeModel>>;
|
|
|
}
|
|
|
}
|
|
|
declare module NODEEDITOR {
|
|
@@ -837,11 +1024,7 @@ declare module NODEEDITOR {
|
|
|
* Interface used to specify creation options for the node editor
|
|
|
*/
|
|
|
export interface INodeEditorOptions {
|
|
|
- /**
|
|
|
- * Defines the DOM element that will host the node editor
|
|
|
- */
|
|
|
- hostElement?: HTMLDivElement;
|
|
|
- nodeMaterial?: BABYLON.NodeMaterial;
|
|
|
+ nodeMaterial: BABYLON.NodeMaterial;
|
|
|
}
|
|
|
/**
|
|
|
* Class used to create a node editor
|