Component

From TouchDesigner 099 Wiki
(Redirected from Components)

Component.png

See also Category:Components for a full list of articles related to Components.

Components (or COMPs) are unique compared to other operator families in that they contain their own networks. To make a new network in your project, create a new Component using the OP Create Menu and selecting from the COMP tab. Then go inside your new component and start building your network. Component networks can contain operators and/or additional sub-networks (additional components). Sub-networks create a hierarchy of networks that can be navigated (using the network path) and forms the overall hierarchical structure of .toe/.tox files.


Opcreate COMP.jpg


Component Types

There are two special types of components, Object Components and Panel Components as well as a number of miscellaneous components. These are listed in 3 separate columns in the OP Create Menu.

Object Components (3D objects for rendering)

Object components can be parented in a hierarchy by connecting them together vertically (using their connectors on the top and bottom of the nodes).

PythonIcon.png ObjectCOMP_Class

Panel Components (interactive 2D panels)

Panel components can be parented in a hierarchy by connecting them together vertically (using their connectors on the top and bottom of the nodes).

PythonIcon.png PanelCOMP_Class

Miscellaneous Components

  • Animation COMP - the Animation COMP is used to create keyframe animation data. Keyframed channels are stored inside the component and can be edited by scoping the Animation COMP in the Animation Editor.
  • Base COMP - the Base COMP has no panel gadgets and no object gadgets. It is the most basic shell of a component and can be used when a new network is required.
  • Replicator COMP - the Replicator COMP creates a node for every row of a table, adding and deleting nodes ("replicants") as the table changes.
  • Time COMP - the Time COMP contains a network of operators that can drive a Timeline, drive animations in Animation COMPs, or be used to drive any custom time-based system.
  • Window COMP - the Window COMP create a separate floating application window. This can be used for control panels or when outputting to multiple monitors.

Component Inputs and Outputs

Components can have operator inputs and outputs on the left/right sides of the node if their network contains In and/or Out operators (of most types: TOP, CHOP, SOP, DAT. e.g. In TOP and Out CHOP).

These allow operator data to flow in and out of the component's network, allowing a Component to share its internal data with other components, operators, and other parts of your project. Adding these OPs inside a Component will add alphanumerically-ordered inputs/outputs on the left/right side of the component that data can flow through. Inputs are on Component’s left side, outputs on the right.

ComponentInsOuts.jpg

An output preview window is displayed when the cursor is over one of the outputs of a component. MMB on output preview to see info about that output. RMB on output preview brings up OP Create menu.

Example

A noise component has been constructed to take a TOP, CHOP, and SOP input, apply noise to each one, then output the results. The component's internal network looks like this:

NoiseExampleInside.jpg

The image below shows how the inputs and outputs of the Component can be connected into a network.

NoiseExampleOutside.jpg


Component Flags

Components have the 4 common Flags along their left side: the Viewer Flag, the Clone Immune Flag, the Cooking Flag, and the Lock Flag. Object Components also have a Bypass Flag and an additional 3 flags in their lower right corner: the Pickable Flag (orange), the Render Flag (purple), and the Display Flag (blue).

Saving Components to Files

You can save out a Component into a .tox file with a RMB -> Save Component on the node. This is handy for sharing networks with other TouchDesigner users and projects. Any commonly-used tool or network you create in TouchDesigner is good candidate for a Component.

To embed other files, like images, into .tox files, see Virtual File System (VFS).


See Also Category:Components