* add a new property to this node * @param type string defining the output type ("vec3","number",...) * @param extra_info this can be used to have special properties of the property (like values, etc)
(
name: string,
default_value: NodeProperty | undefined,
type?: string,
extra_info?: Partial<INodePropertyInfo>,
)
| 1462 | * @param extra_info this can be used to have special properties of the property (like values, etc) |
| 1463 | */ |
| 1464 | addProperty( |
| 1465 | name: string, |
| 1466 | default_value: NodeProperty | undefined, |
| 1467 | type?: string, |
| 1468 | extra_info?: Partial<INodePropertyInfo>, |
| 1469 | ): INodePropertyInfo { |
| 1470 | const o: INodePropertyInfo = { name, type, default_value } |
| 1471 | if (extra_info) Object.assign(o, extra_info) |
| 1472 | |
| 1473 | this.properties_info ||= [] |
| 1474 | this.properties_info.push(o) |
| 1475 | this.properties ||= {} |
| 1476 | this.properties[name] = default_value |
| 1477 | return o |
| 1478 | } |
| 1479 | |
| 1480 | /** |
| 1481 | * add a new output slot to use in this node |
no outgoing calls
no test coverage detected