mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-23 06:37:29 +08:00
Material nodes wip, various refactoring
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { generateNodeTest } from "../fixtures/testUtilities.js"
|
||||
import Blueprint from "../../js/Blueprint.js"
|
||||
import generateNodeTests from "../fixtures/testUtilities.js"
|
||||
import Configuration from "../../js/Configuration.js"
|
||||
import SVGIcon from "../../js/SVGIcon.js"
|
||||
|
||||
@@ -66,19 +65,4 @@ const tests = [
|
||||
},
|
||||
]
|
||||
|
||||
/** @type {Blueprint} */
|
||||
let blueprint
|
||||
|
||||
before(() => {
|
||||
cy.visit(`http://127.0.0.1:${Cypress.env("UEBLUEPRINT_TEST_SERVER_PORT")}/empty.html`, {
|
||||
onLoad: () => {
|
||||
cy.get("ueb-blueprint")
|
||||
.then(b => blueprint = b[0])
|
||||
.click(100, 300)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
tests.forEach(
|
||||
testObject => generateNodeTest(testObject, () => blueprint)
|
||||
)
|
||||
generateNodeTests(tests)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { generateNodeTest } from "../fixtures/testUtilities.js"
|
||||
import generateNodeTests from "../fixtures/testUtilities.js"
|
||||
import Configuration from "../../js/Configuration.js"
|
||||
import SVGIcon from "../../js/SVGIcon.js"
|
||||
|
||||
@@ -483,19 +483,4 @@ const tests = [
|
||||
},
|
||||
]
|
||||
|
||||
/** @type {Blueprint} */
|
||||
let blueprint
|
||||
|
||||
before(() => {
|
||||
cy.visit(`http://127.0.0.1:${Cypress.env("UEBLUEPRINT_TEST_SERVER_PORT")}/empty.html`, {
|
||||
onLoad: () => {
|
||||
cy.get("ueb-blueprint")
|
||||
.then(([b]) => blueprint = b)
|
||||
.click(100, 300)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
tests.forEach(
|
||||
testObject => generateNodeTest(testObject, () => blueprint)
|
||||
)
|
||||
generateNodeTests(tests)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { generateNodeTest } from "../fixtures/testUtilities.js"
|
||||
import Blueprint from "../../js/Blueprint.js"
|
||||
import generateNodeTests from "../fixtures/testUtilities.js"
|
||||
import Configuration from "../../js/Configuration.js"
|
||||
import SVGIcon from "../../js/SVGIcon.js"
|
||||
|
||||
@@ -846,19 +845,4 @@ const tests = [
|
||||
},
|
||||
]
|
||||
|
||||
/** @type {Blueprint} */
|
||||
let blueprint
|
||||
|
||||
before(() => {
|
||||
cy.visit(`http://127.0.0.1:${Cypress.env("UEBLUEPRINT_TEST_SERVER_PORT")}/empty.html`, {
|
||||
onLoad: () => {
|
||||
cy.get("ueb-blueprint")
|
||||
.then(b => blueprint = b[0])
|
||||
.click(100, 300)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
tests.forEach(
|
||||
testObject => generateNodeTest(testObject, () => blueprint)
|
||||
)
|
||||
generateNodeTests(tests)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { generateNodeTest } from "../fixtures/testUtilities.js"
|
||||
import generateNodeTests from "../fixtures/testUtilities.js"
|
||||
import Configuration from "../../js/Configuration.js"
|
||||
import SVGIcon from "../../js/SVGIcon.js"
|
||||
|
||||
@@ -69,25 +69,10 @@ const tests = [
|
||||
.map(k => /** @type {import("../../js/entity/ObjectEntity.js").default} */(entity[k]))
|
||||
.filter(v => v.getType())
|
||||
expect(pinObjects).to.be.of.length(4)
|
||||
pinObjects.forEach(v => expect(v.getType()).to.be.equal(Configuration.nodeType.edGraphPinDeprecated))
|
||||
pinObjects.forEach(v => expect(v.getType()).to.be.equal(Configuration.paths.edGraphPinDeprecated))
|
||||
expect(entity.getPinEntities()).to.be.of.length(4)
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
/** @type {Blueprint} */
|
||||
let blueprint
|
||||
|
||||
before(() => {
|
||||
cy.visit(`http://127.0.0.1:${Cypress.env("UEBLUEPRINT_TEST_SERVER_PORT")}/empty.html`, {
|
||||
onLoad: () => {
|
||||
cy.get("ueb-blueprint")
|
||||
.then(b => blueprint = b[0])
|
||||
.click(100, 300)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
tests.forEach(
|
||||
testObject => generateNodeTest(testObject, () => blueprint)
|
||||
)
|
||||
generateNodeTests(tests)
|
||||
|
||||
49
cypress/e2e/materialNodes.cy.js
Normal file
49
cypress/e2e/materialNodes.cy.js
Normal file
@@ -0,0 +1,49 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import generateNodeTests from "../fixtures/testUtilities.js"
|
||||
import Configuration from "../../js/Configuration.js"
|
||||
|
||||
const tests = [
|
||||
{
|
||||
name: "1.13e+14,0",
|
||||
value: String.raw`
|
||||
Begin Object Class=/Script/UnrealEd.MaterialGraphNode Name="MaterialGraphNode_22"
|
||||
Begin Object Class=/Script/Engine.MaterialExpressionConstant2Vector Name="MaterialExpressionConstant2Vector_0"
|
||||
End Object
|
||||
Begin Object Name="MaterialExpressionConstant2Vector_0"
|
||||
R=313213107306496.000000
|
||||
MaterialExpressionEditorX=-2208
|
||||
MaterialExpressionEditorY=-1072
|
||||
MaterialExpressionGuid=A9605277916E4C64B0DAF6ADEBF312A6
|
||||
Material=/Script/UnrealEd.PreviewMaterial'"/Engine/Transient.M_CobbleStone_Pebble"'
|
||||
End Object
|
||||
MaterialExpression=/Script/Engine.MaterialExpressionConstant2Vector'"MaterialExpressionConstant2Vector_0"'
|
||||
NodePosX=-2208
|
||||
NodePosY=-1072
|
||||
NodeGuid=287700BEECBE4FF98F47394337B10A51
|
||||
CustomProperties Pin (PinId=A5E99A21F6214E22845DE6FE673F1E0C,PinName="X",PinType.PinCategory="optional",PinType.PinSubCategory="red",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultValue="313213107306496.0",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=True,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
||||
CustomProperties Pin (PinId=8038D6C855844EF6854E33B12592F287,PinName="Y",PinType.PinCategory="optional",PinType.PinSubCategory="red",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,DefaultValue="0.0",PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=True,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
||||
CustomProperties Pin (PinId=F0ABD57F7F22490D96D86245449F67C5,PinName="Output",PinFriendlyName=NSLOCTEXT("MaterialGraphNode", "Space", " "),Direction="EGPD_Output",PinType.PinCategory="mask",PinType.PinSubCategory="",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
||||
CustomProperties Pin (PinId=FC6CF9B376184D2091DFB4B6DC66769F,PinName="Output2",PinFriendlyName=NSLOCTEXT("MaterialGraphNode", "Space", " "),Direction="EGPD_Output",PinType.PinCategory="mask",PinType.PinSubCategory="red",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
||||
CustomProperties Pin (PinId=B0C4B417692647C5B455F6108AC55181,PinName="Output3",PinFriendlyName=NSLOCTEXT("MaterialGraphNode", "Space", " "),Direction="EGPD_Output",PinType.PinCategory="mask",PinType.PinSubCategory="green",PinType.PinSubCategoryObject=None,PinType.PinSubCategoryMemberReference=(),PinType.PinValueType=(),PinType.ContainerType=None,PinType.bIsReference=False,PinType.bIsConst=False,PinType.bIsWeakPointer=False,PinType.bIsUObjectWrapper=False,PinType.bSerializeAsSinglePrecisionFloat=False,PersistentGuid=00000000000000000000000000000000,bHidden=False,bNotConnectable=False,bDefaultValueIsReadOnly=False,bDefaultValueIsIgnored=False,bAdvancedView=False,bOrphanedPin=False,)
|
||||
End Object
|
||||
`,
|
||||
color: Configuration.nodeColors.yellow,
|
||||
icon: false,
|
||||
pins: 5,
|
||||
pinName: ["X", "Y"],
|
||||
delegate: false,
|
||||
development: false,
|
||||
additionalTest:
|
||||
/** @param {import("../../js/element/NodeElement.js").default} node */
|
||||
node => {
|
||||
/** @typedef {import("../../js/element/PinElement.js").default} PinElement */
|
||||
expect(/** @type {PinElement} */(node.querySelectorAll("ueb-pin")[3]).getColor())
|
||||
.to.deep.equal(Configuration.pinColor.red)
|
||||
expect(/** @type {PinElement} */(node.querySelectorAll("ueb-pin")[4]).getColor())
|
||||
.to.deep.equal(Configuration.pinColor.green)
|
||||
}
|
||||
},
|
||||
]
|
||||
|
||||
generateNodeTests(tests)
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { generateNodeTest } from "../fixtures/testUtilities.js"
|
||||
import generateNodeTests from "../fixtures/testUtilities.js"
|
||||
|
||||
const tests = [
|
||||
{
|
||||
@@ -24,19 +24,4 @@ const tests = [
|
||||
},
|
||||
]
|
||||
|
||||
/** @type {Blueprint} */
|
||||
let blueprint
|
||||
|
||||
before(() => {
|
||||
cy.visit(`http://127.0.0.1:${Cypress.env("UEBLUEPRINT_TEST_SERVER_PORT")}/empty.html`, {
|
||||
onLoad: () => {
|
||||
cy.get("ueb-blueprint")
|
||||
.then(b => blueprint = b[0])
|
||||
.click(100, 300)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
tests.forEach(
|
||||
testObject => generateNodeTest(testObject, () => blueprint)
|
||||
)
|
||||
generateNodeTests(tests)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
import { generateNodeTest } from "../fixtures/testUtilities.js"
|
||||
import generateNodeTests from "../fixtures/testUtilities.js"
|
||||
import Configuration from "../../js/Configuration.js"
|
||||
import SVGIcon from "../../js/SVGIcon.js"
|
||||
|
||||
@@ -401,19 +401,4 @@ const tests = [
|
||||
},
|
||||
]
|
||||
|
||||
/** @type {Blueprint} */
|
||||
let blueprint
|
||||
|
||||
before(() => {
|
||||
cy.visit(`http://127.0.0.1:${Cypress.env("UEBLUEPRINT_TEST_SERVER_PORT")}/empty.html`, {
|
||||
onLoad: () => {
|
||||
cy.get("ueb-blueprint")
|
||||
.then(b => blueprint = b[0])
|
||||
.click(100, 300)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
tests.forEach(
|
||||
testObject => generateNodeTest(testObject, () => blueprint)
|
||||
)
|
||||
generateNodeTests(tests)
|
||||
|
||||
Reference in New Issue
Block a user