### Accessing and Iterating Through Monitors Source: https://docs.derivative.ca/Monitors_Class Demonstrates how to get the total number of monitors, access a specific monitor by index, and iterate through all installed monitors to print their descriptions. This is useful for understanding the display setup. ```python print(len(monitors)) # number of monitors print(monitors[0]) # first monitor in the list for m in monitors: print(m.description) # print all installed monitors' descriptions ``` -------------------------------- ### Generate Installation Log File Source: https://docs.derivative.ca/Install_TouchDesigner Run the installer with the /LOG argument to create a log file for debugging installation errors. Send this log file to support. ```bash "C:\MyFolder\TouchDesigner0xx.xxxxx.exe" /LOG="example.log" ``` -------------------------------- ### Getting Input Connectors Source: https://docs.derivative.ca/AlembicSOP_Class Provides an example of how to get a list of all input connectors associated with this operator. ```python input_connectors = node.inputConnectors ``` -------------------------------- ### Accessing and Iterating Licenses Source: https://docs.derivative.ca/Licenses_Class Demonstrates how to access the licenses object, get the number of installed licenses, access a specific license, and iterate through all licenses to print their types. ```APIDOC ## Accessing and Iterating Licenses ### Description This snippet shows how to interact with the `licenses` object to retrieve information about installed licenses. ### Usage ```python print(len(licenses)) # Get the total number of installed licenses print(licenses[0]) # Access the first license in the list # Iterate through all licenses and print their types for l in licenses: print(l.type) ``` ``` -------------------------------- ### Install License Source: https://docs.derivative.ca/Licenses_Class Method to install a new license using a provided key. ```APIDOC ## Install License ### Description Installs a license using the provided license key. ### Method Signature `install(key)`→ `bool` ### Parameters - **key** (str): The license key to install. ### Returns - `True` if the license installation was successful, `False` otherwise. ``` -------------------------------- ### Setup WebRTC Component Source: https://docs.derivative.ca/Palette%3AwebRTC Instantiate a webRTC COMP and link it to a signalingClient for establishing WebRTC connections. ```python Reference the signalingClient COMP to the webRTC COMP's signalingClient par. ``` -------------------------------- ### Load TOX component from file Source: https://docs.derivative.ca/BlendCOMP_Class This example demonstrates loading a component from a .tox file. It shows how to specify the file path and optionally keep component inputs unwired. ```Python n.loadTox(filepath='path/to/your/component.tox', unwired=True) ``` -------------------------------- ### Filter Key Example Source: https://docs.derivative.ca/Palette%3AoperatorPath Use a Python lambda function to filter accessible operators by name. This example accepts operators whose names start with 'a'. ```python lambda x: x.name.startswith('a') ``` -------------------------------- ### Plugin Folder Structure Example Source: https://docs.derivative.ca/Custom_Operators Illustrates how custom operator plugins can be organized within the main Plugins directory on Windows. ```text Documents/Derivative/Plugins/wave2.dll Documents/Derivative/Plugins/Company1/feature1.dll Documents/Derivative/Plugins/Company1/feature2.dll Documents/Derivative/Plugins/Mine/customMerge.dll ``` -------------------------------- ### Setting Common Flags Source: https://docs.derivative.ca/DeleteCHOP_Class Examples of how to get or set common operator flags such as activeViewer, allowCooking, bypass, and others. ```python # Get or set Viewer Active Flag. viewerActive = n.activeViewer n.activeViewer = True # Get or set Cooking Flag. allowCooking = n.allowCooking n.allowCooking = False # Get or set Bypass Flag. bypass = n.bypass n.bypass = True # Get or set Clone Immune Flag. cloneImmune = n.cloneImmune n.cloneImmune = False # Get or set Current Flag. current = n.current n.current = True # Get or set Display Flag. display = n.display n.display = False # Get or set the Expose Flag. expose = n.expose n.expose = True # Get or set Lock Flag. lock = n.lock n.lock = False # Get or set Selected Flag. selected = n.selected n.selected = True # Get or set parameter expression language as python. python = n.python n.python = False # Get or set Render Flag. render = n.render n.render = True # Get or set the Show Custom Only Flag. showCustomOnly = n.showCustomOnly n.showCustomOnly = False # Get or set Show Docked Flag. showDocked = n.showDocked n.showDocked = True # Get or set Viewer Flag. viewer = n.viewer n.viewer = False ``` -------------------------------- ### Setup Signaling Client Source: https://docs.derivative.ca/Palette%3AwebRTC Activate the signalingClient component and enable 'Forward to Subscribers' for peer discovery and connection management. ```python Change its Active par to ON. Change its Forward to Subscribers par to ON. ``` -------------------------------- ### Install Floating Cloud License via Command Line Source: https://docs.derivative.ca/Floating_Cloud_Licenses Use this command to import the .wbc credential file onto your system. Replace with the actual path to your credential file. ```bash cmu32.exe --import --file ``` -------------------------------- ### Setting Operator Flags Source: https://docs.derivative.ca/FilterCHOP_Class Examples of how to get or set common operator flags such as activeViewer, allowCooking, bypass, and others. Note that only COMPs can disable the allowCooking flag. ```python # Example for activeViewer flag n.activeViewer = True # Example for allowCooking flag n.allowCooking = False # Example for bypass flag n.bypass = True # Example for cloneImmune flag n.cloneImmune = True # Example for current flag n.current = True # Example for display flag n.display = True # Example for expose flag n.expose = True # Example for lock flag n.lock = True # Example for selected flag n.selected = True # Example for python flag n.python = True # Example for render flag n.render = True # Example for showCustomOnly flag n.showCustomOnly = True # Example for showDocked flag n.showDocked = True # Example for viewer flag n.viewer = True ``` -------------------------------- ### Parameter Start Section Status Source: https://docs.derivative.ca/ParGroup_Class Get or set the parameter's separator status. When true, a visible separator is drawn before this parameter. This can only be set on Custom Parameters. ```APIDOC ## startSection ### Description Get or set the parameter's separator status. When True a visible separator is drawn between this parameter and the ones preceding it. ### Type `bool` ### Notes Can only be set on Custom Parameters. ``` -------------------------------- ### Setup Signaling Server Source: https://docs.derivative.ca/Palette%3AwebRTC Activate the signalingServer component to initiate a signaling server for WebRTC connections. ```python Change its Active par to ON. ``` -------------------------------- ### Access and Iterate Licenses Source: https://docs.derivative.ca/Licenses_Class Demonstrates how to get the number of installed licenses, access the first license, and iterate through all licenses to print their types. The `licenses` object is available in the `td` module. ```python print(len(licenses)) # number of licenses print(licenses[0]) # first license in the list for l in licenses: print(l.type) # print all installed licenses' types ``` -------------------------------- ### Managing Common Flags in EtherdreamCHOP Source: https://docs.derivative.ca/EtherdreamCHOP_Class Provides examples of getting or setting common operator flags such as active, bypass, display, and render. These flags control the behavior and visibility of the operator. ```python # Example for 'active' flag (other flags follow similar pattern) active_state = n.activeViewer n.activeViewer = True ``` ```python # Example for 'python' flag n.python = True ``` ```python # Example for 'showCustomOnly' flag n.showCustomOnly = True ``` ```python # Example for 'showDocked' flag n.showDocked = True ``` -------------------------------- ### Instantiating and Accessing Color Components Source: https://docs.derivative.ca/Color_Class Demonstrates various ways to create a Color object and access its individual components using indexing. ```python v = tdu.Color() # starts as (0, 0, 0, 1) v2 = tdu.Color(0, 0, 1, 1) values = [0, 1, 0, 1] v3 = tdu.Color(values) green = v3[1] # access individual elements by index. Same as v3.g ``` -------------------------------- ### Setting up Internal Parameters Manually Source: https://docs.derivative.ca/Internal_Parameters This procedure involves creating a Base COMP, adding custom parameters to it, and then linking it to an internal shortcut name within the parent component. ```python ipar.Effect.Size ``` -------------------------------- ### Setting Operator Flags Source: https://docs.derivative.ca/AngleCHOP_Class Examples of how to get or set common operator flags such as activeViewer, allowCooking, bypass, and others. These flags control various aspects of operator behavior and visibility. ```python # Example for activeViewer flag # op.activeViewer = True # Example for allowCooking flag # op.allowCooking = False # Example for bypass flag # op.bypass = True # Example for cloneImmune flag # op.cloneImmune = False # Example for current flag # op.current = True # Example for display flag # op.display = False # Example for expose flag # op.expose = True # Example for lock flag # op.lock = False # Example for selected flag # op.selected = True # Example for python flag # op.python = True # Example for render flag # op.render = False # Example for showCustomOnly flag # op.showCustomOnly = True # Example for showDocked flag # op.showDocked = False # Example for viewer flag # op.viewer = True ``` -------------------------------- ### Set Operation Example: Blend Prefix Exclusion Source: https://docs.derivative.ca/Pattern_Matching Match nodes starting with 'blend' but exclude those immediately followed by a digit. This pattern is useful for differentiating between named blends and numbered variants. ```text blend* ~ blend[0-9]* ``` -------------------------------- ### TDPyEnvManagerContext YAML Configuration Source: https://docs.derivative.ca/Palette%3AtdPyEnvManager This is an example of the context configuration file for TDPyEnvManager. It defines settings for environment management, including activation, mode, name, installation path, Python version, and auto-setup options. ```yaml active: true mode: Python vEnv envName: .venv installPath: . pythonVersion: '3.11' autoSetup: true autoSetupReqs: [] autoSetupSyncReqs: false contextVersion: 2 createdByVersion: 1.4.0 extraPaths: [] ``` -------------------------------- ### Print 'Hello World!' in Textport Source: https://docs.derivative.ca/Introduction_to_Python_Tutorial A simple test to verify Python execution in the Textport. Press Enter to see the output. ```Python print('Hello World!') ``` -------------------------------- ### Example of Channel Selection and Renaming Source: https://docs.derivative.ca/Select_CHOP This example demonstrates fetching specific channels and renaming them using pattern matching. It selects channels 'c1', 'c3', 'c5', 'c7', 'c9', and 'ambient', then renames them to 'b1' through 'b5' and 'amb' respectively. ```text Channel Names: c[1-10:2] ambient Rename From: c* ambient Rename To: b[1-5] amb ``` -------------------------------- ### Set Operation Example: Path and Range Exclusion Source: https://docs.derivative.ca/Pattern_Matching Match nodes within a specific path that start with 'geo' but exclude a range of 'geo' nodes. This pattern refines selection within a directory structure. ```text ./mygeos/geo* ~ ./mygeos/geo[3-5] ``` -------------------------------- ### Tscript Macro Definition and Execution Example Source: https://docs.derivative.ca/Tscript Demonstrates how to define a macro with a simple command and then execute it, showing the output. ```Tscript touch-> macro greet echo hello world touch-> greet hello world ``` -------------------------------- ### Set Operation Example: Complex Selection Source: https://docs.derivative.ca/Pattern_Matching Demonstrates a combination of wildcard matching, set difference, and union for nuanced selection. This pattern matches nodes starting with 'geo' except those in a specific range, or matches 'geo3'. ```text (* ~ geo*) | geo3 ``` -------------------------------- ### Capture Override File Format Example Source: https://docs.derivative.ca/Capture_SOP This example demonstrates the format for an override file used to manually set capture weights for points. Each line specifies a point, a capture region, and its weight. ```text 0 /obj/chain_bone1/cregion 0 0.0 0 /obj/chain_bone2/cregion 0 3.757989 0 /obj/chain_bone3/cregion 0 1.757989 ```