CPlusPlus CHOP

From TouchDesigner 088 Wiki

Summary

The CPlusPlus CHOP allows you to make custom CHOP operators by writing your own .dll using C++. Operators created in this manner will not appear in the OP Create Dialog, but rather are accessible by specifying the new created DLL in a CPlusPlus CHOP.

Note: The CPlusPlus CHOP is only available in TouchDesigner Commercial and TouchDesigner Pro.

See Write a CPlusPlus DLL and the other articles in the C++ Category for more detailed information on how to make .dll for use with this node.

Examples for CPlusPlus CHOP as a Visual Studio project in Windows are available in C:/Program Files/Derivative/TouchDesigner088/Samples/CPlusPlus/CHOP or your custom TouchDesigner install folder.

See also: CPlusPlus TOP

PythonIcon.png cplusplusCHOP_Class

Parameters - Load Page

DLL Path dll - The path to the DLL you want to load.

Re-init Class reinit - When this parameter goes above 1, it will delete the instance of the class created by the .dll, and create a new one.

Unload DLL unloaddll - When this parameter goes above 1, it will delete the instance of the class created by the .dll and unload the .dll. If multiple CHOPs have loaded the same .dll they will all need to unload it to release the file.

Parameters - Custom

This page holds the default Custom Parameters created from the sample C++ CHOP .dll. This page can be removed, edited, or appended to from within the setupParameters() function in CPlusPlusCHOPExample.cpp. Refer to the Write a CPlusPlus CHOP page for detailed explanation of creating your own Custom Parameters.

Parameters - Common Page

Time Slice - Turning this on forces the channels to be "Time Sliced". A Time Slice is the time between the last cook frame and the current cook frame.

Scope - To determine which channels get affected, some CHOPs use a Scope string on the Common page.

Patterns can be used in the Scope: * (match all channels and therefore affect all channels), ? (match single character. See Pattern Matching.

Sample Rate Match - Handle cases where multiple input CHOPs' sample rates are different. When the CHOP needs to combine inputs with different sample rates, the Sample Rate Match Options offers these choices:

  • Resample At First Input's Rate - Use rate of first input to resample others.
  • Resample At Maximum Rate - Resample to the highest sample rate.
  • Resample At Minimum Rate - Resample to the lowest sample rate.
  • Error if Rates Differ - Doesn't accept conflicting sample rates.

When Resampling occurs, the curves are interpolated according to the Interpolation Method Option, or "Linear" if the Interpolate Options are not available.

Export Method - This will determine how to connect the CHOP channel to the parameter. Refer to the Export article for more information.

  • DAT Table by Index - Uses the docked DAT table and references the channel via the index of the channel in the CHOP.
  • DAT Table by Name - Uses the docked DAT table and references the channel via the name of the channel in the CHOP.
  • Channel Name is Path:Parameter - The channel is the full destination of where to export to, such has geo1/transform1:tx.

Export Root - This path points to the root node where all of the paths that exporting by Channel Name is Path:Parameter are relative to.

Export Table - The DAT used to hold the export information when using the DAT Table Export Methods (See above).