Community Post

A word about external files in 2023.10k builds

Externals are an important part of TouchDesigner and how we share pieces of networks between users, community members and team members.
With this new branch, we are introducing changes to working with external files to make them easier to manage and open new possibilities.
They are part of the future of TouchDesigner and will be welcome improvements in the upcoming years on multiple fronts.
The features introduced are subject to change, and we are welcoming community feedback, as well as reports for anything that might look like bugs.

Externals, pre-2023 flavor.

While they are designed with sharing in mind, and to be able to be used across multiple projects, one of the main issue when working with externals at the moment is that any operator within the external COMP pointing to a path on disk is either absolute, or relative to the project .toe file itself… Which means, they are actually difficult to share across project if not everything related to the external itself is embedded within the file.
There were ways around it relying on some expressions which was prone to errors and, we’d rather do without expressions when it comes to loading external files reliably.

Bye to Re-Init Network, Welcome to Enable External .tox and toggle.

The first things you’ll notice is that the Re-Init Network pulse parameter is gone, as well as the Reload .tox on Start toggle parameter.
They are replaced by Enable External .tox which will act similarly to the Reload .tox On Start toggle, as long as a valid path is set for the External .tox Path file parameter. There is an additional pulse next to the toggle which acts similarly to Re-Init Network.
At any time, with the External .tox Path file parameter being set, a user can toggle the Enable External .tox toggle par on / off so that the content of the COMP gets embedded in the .toe file.

Relative File Path Behavior

This is the most important change for externals.
This parameter has an impact on any file path within the component itself.
For the following sections and screenshots, let's assume that, somewhere on our machine, we are going with the following folder structure:
In out custom component, we have a python extension within a Text DAT set to Sync To File with the path scripts/
By default, and just like you are used to it, this path would point to an extension in a scripts folder next to our project .toe file. If the .toe file was in a specific project folder called MyTouchDesignerProject then our DAT would point to a .py file in MyTouchDesignerProject/scripts/
Now, with the Relative File Path Behavior set to Relative to External COMP File (.tox), any file path within my External COMP (with a valid External .tox Path set) will be relative to the .tox file the COMP is pointing to.
Let’s assume that we have a .tox file at the root of MyTouchDesignerProject, next to our .toe file, named MySuperCustomCOMP.tox , with scripts and assets folder where some files important to that .tox are being stored. Changing the Relative File Path Behavior parameter would not have a direct impact.
Now, let’s assume that we create outside of our project folder, a folder named MyToxCollection and in this folder, we move our .tox file, as well as the scripts and assets folder within their own folder named MySuperCustomCOMP.
Opening the .tox file in any other TouchDesigner project, we can preserve the relative paths within our external COMP and have our extension file being loaded relatively to the .tox rather than the .toe file.
This works for any file type, such as images on a Movie File In TOP with relative paths being relative to the .tox itself or additional COMPs within our .tox pointing to any other .tox relatively to my parent .tox… etc, etc.
Yes, it means you can now zip a folder with a .tox and all files related to this .tox, whether they are scripts, images, 3D Models, Fonts… etc, and be sure that all the paths are working just fine when they are loaded in a project on another machine with the Relative File Path Behavior set to Relative to External.

Drag n drop of .tox

You’ll notice that, when you drag n drop an external .tox file to your TouchDesigner network, the Enable External .tox toggle par is turned off and the content of the .tox file gets embedded. This is to preserve the familiar behavior of the pre-2023 flavor. TouchDesigner attempts to pre-fill the External .tox Path file parameter with a path that is relative to the current .toe file.
If you have OPs with paths within the COMP you just drag n dropped into your project, toggle On the Enable .tox Path toggle parameter and the paths will get resolved relatively to the .tox file.
⚠️Note: Remember to toggle On the Enable External .tox toggle parameter so that paths to files within your COMP are resolved relatively. Otherwise, the Relative File Path Behavior will have no impact.


The OP Class did get a new member: fileFolder.
fileFolder can be used in expressions and it will also tell which folder does a path currently gets resolved with when a path parameter is on a given OP and that the path set is of relative type.

Tooltips, infos

On File parameters, the tooltip is now giving an extra bit of information, and shows not only the full absolute path to the file currently being loaded, but also which folder it was resolved relative with.
Additionally, the Info dialog is now showing where was a .tox loaded from.