polygonjs-engine
Version:
node-based webgl 3D engine https://polygonjs.com
36 lines (35 loc) • 1.53 kB
JavaScript
import {TypedSopNode} from "./_Base";
import {InputCloneMode as InputCloneMode2} from "../../poly/InputCloneMode";
import {RestAttributesSopOperation} from "../../../core/operations/sop/RestAttributes";
import {NodeParamsConfig, ParamConfig} from "../utils/params/ParamsConfig";
const DEFAULT = RestAttributesSopOperation.DEFAULT_PARAMS;
class RestAttributesSopParamsConfig extends NodeParamsConfig {
constructor() {
super(...arguments);
this.tposition = ParamConfig.BOOLEAN(DEFAULT.tposition);
this.position = ParamConfig.STRING(DEFAULT.position, {visibleIf: {tposition: true}});
this.restP = ParamConfig.STRING(DEFAULT.restP, {visibleIf: {tposition: true}});
this.tnormal = ParamConfig.BOOLEAN(DEFAULT.tnormal);
this.normal = ParamConfig.STRING(DEFAULT.normal, {visibleIf: {tnormal: true}});
this.restN = ParamConfig.STRING(DEFAULT.restN, {visibleIf: {tposition: true}});
}
}
const ParamsConfig2 = new RestAttributesSopParamsConfig();
export class RestAttributesSopNode extends TypedSopNode {
constructor() {
super(...arguments);
this.params_config = ParamsConfig2;
}
static type() {
return "restAttributes";
}
initializeNode() {
this.io.inputs.setCount(1);
this.io.inputs.initInputsClonedState([InputCloneMode2.FROM_NODE]);
}
cook(input_contents) {
this._operation = this._operation || new RestAttributesSopOperation(this.scene(), this.states);
const core_group = this._operation.cook(input_contents, this.pv);
this.setCoreGroup(core_group);
}
}