UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

37 lines (36 loc) 1.29 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { DeleteByNameSopOperation } from "../../operations/sop/DeleteByName"; import { NodeParamsConfig, ParamConfig } from "../utils/params/ParamsConfig"; import { SopType } from "../../poly/registers/nodes/types/Sop"; const DEFAULT = DeleteByNameSopOperation.DEFAULT_PARAMS; class DeleteByNameSopParamConfig extends NodeParamsConfig { constructor() { super(...arguments); /** @param group to assign the material to */ this.group = ParamConfig.STRING(DEFAULT.group, { objectMask: true }); /** @param invert */ this.invert = ParamConfig.BOOLEAN(DEFAULT.invert); } } const ParamsConfig = new DeleteByNameSopParamConfig(); export class DeleteByNameSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return SopType.DELETE_BY_NAME; } initializeNode() { this.io.inputs.setCount(1); this.io.inputs.initInputsClonedState(DeleteByNameSopOperation.INPUT_CLONED_STATE); } cook(inputCoreGroups) { this._operation = this._operation || new DeleteByNameSopOperation(this.scene(), this.states, this); const coreGroup = this._operation.cook(inputCoreGroups, this.pv); this.setCoreGroup(coreGroup); } }