Browse Source

Associated with #6012

David Catuhe 6 năm trước cách đây
mục cha
commit
930c023877

+ 2 - 2
nodeEditor/src/components/diagram/defaultNodeModel.ts

@@ -31,7 +31,7 @@ export class DefaultNodeModel extends NodeModel {
         }
         // Create output ports
         options.nodeMaterialBlock._outputs.forEach((connection: any) => {
-            var outputPort = new DefaultPortModel(connection.name + "-output", "output");
+            var outputPort = new DefaultPortModel(connection.name, "output");
             outputPort.syncWithNodeMaterialConnectionPoint(connection);
             this.addPort(outputPort)
         })
@@ -53,7 +53,7 @@ export class DefaultNodeModel extends NodeModel {
                     connectedNode = existingNodes[0];
                 }
 
-                let link = connectedNode.ports[connection.connectedPoint.name + "-output"].link(inputPort);
+                let link = connectedNode.ports[connection.connectedPoint.name].link(inputPort);
                 if (graphEditor._toAdd) {
                     graphEditor._toAdd.push(link);
                 } else {

+ 1 - 1
nodeEditor/src/components/diagram/port/defaultPortModel.ts

@@ -37,7 +37,7 @@ export class DefaultPortModel extends PortModel {
 
     syncWithNodeMaterialConnectionPoint(connection: NodeMaterialConnectionPoint) {
         this.connection = connection;
-        this.name = connection.name + "-" + this.position;
+        this.name = connection.name;
     }
 
     getNodeModel() {

+ 2 - 2
src/Materials/Node/Blocks/Fragment/colorSplitterBlock.ts

@@ -17,8 +17,8 @@ export class ColorSplitterBlock extends NodeMaterialBlock {
     public constructor(name: string) {
         super(name, NodeMaterialBlockTargets.Fragment);
 
-        this.registerInput("rgba", NodeMaterialBlockConnectionPointTypes.Color4, true);
-        this.registerInput("rgb", NodeMaterialBlockConnectionPointTypes.Color3, true);
+        this.registerInput("rgba-in", NodeMaterialBlockConnectionPointTypes.Color4, true);
+        this.registerInput("rgb-in", NodeMaterialBlockConnectionPointTypes.Color3, true);
 
         this.registerOutput("rgb", NodeMaterialBlockConnectionPointTypes.Color3);
         this.registerOutput("r", NodeMaterialBlockConnectionPointTypes.Float);

+ 2 - 2
src/Materials/Node/Blocks/Fragment/vectorSplitterBlock.ts

@@ -17,8 +17,8 @@ export class VectorSplitterBlock extends NodeMaterialBlock {
     public constructor(name: string) {
         super(name, NodeMaterialBlockTargets.Fragment);
 
-        this.registerInput("xyzw", NodeMaterialBlockConnectionPointTypes.Vector4, true);
-        this.registerInput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3, true);
+        this.registerInput("xyzw-in", NodeMaterialBlockConnectionPointTypes.Vector4, true);
+        this.registerInput("xyz-in", NodeMaterialBlockConnectionPointTypes.Vector3, true);
 
         this.registerOutput("xyz", NodeMaterialBlockConnectionPointTypes.Vector3);
         this.registerOutput("x", NodeMaterialBlockConnectionPointTypes.Float);