Files
ueblueprint/js/entity/objects/NiagaraClipboardContent.js
barsdeveloper 365732a99c WIP
2024-12-03 22:15:17 +02:00

31 lines
1.1 KiB
JavaScript
Executable File

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))
})
}
}