This is an operator that, when added inside your TouchDesigner project, ensures that the file you dragged and dropped into your scene is present inside of your project folder.
By default, when a file is dragged and dropped into a TouchDesigner scene, it is automatically loaded into the appropriate operator. However, if the file is not present in your project folder, it will be imported using an absolute path link (C:/User/...). This will break your files's link if your project is moved or sent to someone else.
The Import file on drop operator solves this problem by detecting if the dropped file is present within your project folder. If it is not, it will be automatically added to your project folder in the appropriate location. This behavior is inspired by file import in software like Unreal Engine.
This operator works by replacing the drop and DragDrop scripts from the /sys operator of TouchDesigner. Don't worry, since TouchDesigner's external operators don't save changes automatically, no program breaking action will take place. The changes take place when the operator is added to your scene.
Import file on drop changes the behavior of TouchDesigner like so: Let's say you want to import a png file inside of your scene. If the file is inside of your project folder, the import is made as usual. But, if the file was outside of the project folder, it will automatically be duplicated inside of an "Image" folder in your project folder and the import link will be adjusted accordingly to be a relative link.
If your project already contains an "Image" folder, it will simply add the duplicated file to the existing folder.
If a file of the same name is already present inside of the folder, the file's name will be altered by adding a "_copy_1" at the end of the file's name.
You can customise the name and destination of the files in the parameters of the operator.
- When set to On, the ne drag and drop features will be enabled.
- A String containing a list of all the extensions you want the operator to ignore. The default behavior will be used instead.
In this section, you will be able to edit the destination folder of the different files types compatible with TouchDesigner. The names of the folders are based on the folder structure created by TouchDesigner's Create Project Folder option.
- The name of the folder that will be created.
- A String containing a list of all the extensions you want to be added into the folder specified prior.
This page allows you to add your own import logic for importing specific file types using operators from the Palette. Both Custom and basic components will work.
- The name of the folder that will be created.
- A String containing a list of all the extensions you want to be added into the folder specified prior.
- A link to the tox file needed for the import. Reminder, you can use the methods "app.paletteFolder" and "app.userPaletteFolder" to access the operators from the Palette.
- The name of the parameter in which the relative link of the file will be added.
Since the code sent to the /sys operator references the parameters of the Import file on drop operator, a Global OP Shortcut named "ImportFileOnDrop" is set on the operator to make it accessible globally. It's important to not alter or remove this shortcut, if so, the operator will stop working.
TD builds > 2025.32280
Download the latest version from the Release Page. Then, place the TOX file at the root of your project.
PC
Initial release.
Enjoy!
