Fix node reference when changing elements

This commit is contained in:
barsdeveloper
2024-09-14 22:16:06 +02:00
parent 8b38173204
commit 3f0185fca5
14 changed files with 209 additions and 98 deletions

View File

@@ -25,7 +25,7 @@ export default class KnotEntity extends ObjectEntity {
inputPinEntity.copyTypeFrom(pinReferenceForType)
outputPinEntity.copyTypeFrom(pinReferenceForType)
}
values["CustomProperties"] = new (ObjectEntity.attributes.CustomProperties)([inputPinEntity, outputPinEntity])
values.CustomProperties = new (ObjectEntity.attributes.CustomProperties)([inputPinEntity, outputPinEntity])
super(values)
}
}

View File

@@ -0,0 +1,30 @@
import Configuration from "../../Configuration.js"
import ObjectEntity from "../ObjectEntity.js"
import ObjectReferenceEntity from "../ObjectReferenceEntity.js"
import StringEntity from "../StringEntity.js"
export default class NiagaraClipboardContent extends ObjectEntity {
/**
* @param {BlueprintEntity} blueprint
* @param {ObjectEntity[]} nodes
*/
constructor(blueprint, nodes) {
const typePath = Configuration.paths.niagaraClipboardContent
const name = blueprint.takeFreeName("NiagaraClipboardContent")
const exportPath = `/Engine/Transient.${name}`
let exported = ""
for (const node of nodes) {
if (node.exported) {
exported += node.serialize()
}
}
const result = nodes.filter(n => !n.exported).map(n => n.serialize())
super({
Class: new ObjectReferenceEntity(typePath),
Name: new StringEntity(name),
ExportPath: new ObjectReferenceEntity(typePath, exportPath),
ExportedNodes: new StringEntity(btoa(exported))
})
}
}