Docs CHOPs & sensing

ConstantCHOP

A Constant CHOP with typed values: numbers, toggles, tuples, text, paths or operator references, each promoted as a property you can read and set from Python, and a snap from its input. An alternative for the Constant CHOP.

∿ CHOPs & sensing ◆ Patreon:Base OP Create menu entry

This tool unlocks with Patreon. It installs through the same picker as everything else and unlocks with the Patreon Base tier or higher, connected from inside TouchDesigner. Everything else in the toolkit stays free and MIT, and the membership is what keeps that work moving.

Join on Patreon → How unlocking works →

Where it appears

Read off the registry hosts in the component, so this is where the tool puts itself in a default install; every one of these can be reordered or hidden from Hub.

What it is

ConstantCHOP holds a list of named values, like the Constant CHOP, and gives the values a type. Pick a Type and every constant becomes a float, an integer, a toggle, a four-value tuple such as XYZW or RGBA, a string, a file or folder path, or a reference to an operator. Numbers, toggles and tuples come out as channels; text, paths and references come out as a table.

With Promote to Property on, each constant is also a property on the node: op('ConstantCHOP').Speed reads and sets the constant named speed, and Speed_out reads what the node outputs. A prefix keeps those names clear of anything else on the COMP.

Snap Input takes whatever is wired in and turns it into constants, one per channel, named and valued from it. Switching Type keeps each value wherever it converts.

It is the alternative for the Constant CHOP: create a Constant CHOP with the alternatives shortcut held and ConstantCHOP is offered in its place. It is also a member of the FNS operator family: pick it from the FNS tab of the OP Create dialog and it lands as one node.

Input and outputs

  • in1 (CHOP): optional; the channels Snap Input copies from.
  • out1 (CHOP): the numeric constants as channels.
  • out2 (DAT): every constant as a table of names and values.

Parameters

Constant

ControlType / defaultWhat it does
TypeType menuFloat The kind of value every constant holds. Numbers, toggles and tuples come out of the CHOP output; text, paths and operator references come out of the DAT output. Switching keeps each value where it converts.
Options: Float, Int, Toggle, Momentary, XYZW, RGBA, UVW, WH and 17 more
ConstantConstant sequence0 One block per constant: add or remove blocks here.
NameConstant0name textempty The channel name, and the property name when Promote to Property is on.
ValueConstant0value number0 The constant's value.

Common

ControlType / defaultWhat it does
Snap InputSnapinput button Replace the constants with the channels wired into the input: one block per channel, named and valued from it. Float and Int only.
Promote to PropertyPromote on / offon Expose each constant as a property on this COMP, so op(...).Name reads and sets its value and Name_out reads the output.
To get/set values as .{prefix}{name}
Property PrefixPrefix textC_ Put in front of every property name, to keep them clear of other names on the COMP.
Author: Function Store (@function.str)

Edit this page on GitHub →