mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-15 09:44:49 +08:00
Fix node reference when changing elements
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
30
js/entity/objects/NiagaraClipboardContent.js
Normal file
30
js/entity/objects/NiagaraClipboardContent.js
Normal 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))
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user