From TouchDesigner Documentation
Jump to: navigation, search

Folder DAT{{Summary |opFamily=COMP |opType=base |opClass=Palette:virtualFile Ext |opLicense= |short= |long=This component embeds files within itself so you don't have to refer to, or depend on external files in your project. Instead, the embedded files will be saved within the .toe or .tox files containing this component. It is essentially an interface for the Virtual File System that is built into all COMPs.


Adding Virtual Files

There are three parameter-based ways to add files to the component. You can also use its Extension Class. To see a File List of embedded virtual files, wire a nullDAT to the second output, or click the List All Virtual Files To Textport parameter with a textport open.

Add Virtual File From Disk

This adds any external file selected in the Source File parameter.

Add Virtual Files From Table

This adds multiple external files identified in the paths column of the tableDAT specified in the Paths Table parameter. You can also wire a path table into virtualFile's input. If the table has an overrideName column, that column will be used to set the added file's names. Tip: to preserve file hierarchy, you can use a Folder DAT with the Relative Path column turned on wired into a Substitute DAT to change 'relpath' to 'overrideName'.

Add Virtual Image File From TOP

This converts a TOP image into an image file and stores that file without having to save the image externally. There are parameters to specify the image source, image file type, and virtual file name.

Accessing Virtual Files

Virtual files are accessed as if they were files on disk, by file in operators (e.g. Movie File In TOP or File In DAT). They are accessed using a special vfs syntax to specify their location:

vfs:<component path>:<virtual file name>

The virtual file name can include slashes to simulate a folder structure. The vfs path can be put in the file parameter of any operator that loads external files.

VFS Path Helpers

There are two ways to get a vfs path automatically from the virtualFile component.

  • The output DAT contains a tableDAT showing the paths of all virtual files in the virtualPath column".
  • The read-only Virtual Path parameter holds the vfs path of the virtual file at the index selected in the Index parameter.

Example expressions that might be used in a file parameter:

# gets the file selected by Index parameter.

# gets the second virtual file if 'null1' is wired to output of a virtualFile component.
op('/null1')[2, 'virtualPath]

Parameters - VFS Page

Version Version - Component Version

Help Help - Open this wiki page

List All Virtual Files To Textport List - Print the vfsFileList to textport

Remove All Virtual Files Remove - Remove virtual files from this component

Echo Commands To Texport Echocommands - Print vfs commands run by parameter functions. This is for visibility and learning of the TouchDesigner vfs Python commands.

Remove All Files Before Adds Removeallbeforeadds - Remove all files first when adding virtual files

Index Virtualfileindex - Index of the specific virtual file for parameters below

Virtual Path Virtualpath - vfs path of the selected virtual file

Remove Virtual File Removesingle - Remove the selected virtual file

Rename Virtual File Rename - Open a dialog to give the selected virtual file a new internal filePath

Source File Filesource - The external file to embed

Add From Disk Add - Add the file selected in Source File parameter

Paths Table Pathstable - Table with 'path' column containing file paths of files to embed. An optional 'overrideName' column will be used as well, if found.

Add From Table Addfromtable - Add files specified in Paths Table DAT

Image Source TOP Imagesourcetop - TOP to use to create virtual image file

Virtual File Name Virtualfilename - Virtual name of the created file

Auto-Increment Name Autoincrementname - When on, add one to the digit at end of Virtual File Name every time an image is embedded

Virtual File Image Filetype Virtualfileimagefiletype - File type to embed

Add From TOP Addfromtop - Add virtual file from Image Source TOP

Operator Inputs

  • Input 0 - Table with 'path' column (and optionally 'overrideName' column) containing file paths of files to embed. Will override Paths Table parameter

Operator Outputs

  • Output 0 - info about all embedded virtual files

Palette • Palette:arcBallCamera • Palette:arcBallGeometry • Palette:audioAnalysis • Palette:audioSet • Palette:battery • Palette:blendModes • Palette:bloom • Experimental:Palette:camera • Palette:cameraBrowser • Palette:camSchnappr • Palette:changeColor • Palette:changeToColor • Palette:checker • Palette:chromaKey • Palette:colorThreshold • Palette:compareComp • Palette:convolve • Palette:cornerPinSOP • Palette:customAttributes • Experimental:Palette:debugControl • Palette:dent • Palette:depthExtract • Palette:dilate • Palette:equalizer • Palette:feedback • Palette:feedbackEdge • Palette:firmata • Palette:geoPanel • Palette:gestureCapture • Palette:graphPlot • Palette:histogram • Palette:hsvBlur • Palette:imageSearch • Palette:julia • Palette:kantanMapper • Palette:kinectCalibration • Palette:kinectPointcloud • Palette:leapPaint • Palette:lightTunnel • Palette:mandelbrot • Palette:mesh • Palette:monochrome • Palette:motionSense • Palette:moviePlayer • Palette:multiLevel • Palette:multiMix • Palette:noise • Palette:onScreenKeyboard • Palette:opticalFlow • Palette:particlesGpu • Palette:pixelate • Palette:pixelRelocator • Palette:pointGenerator • Palette:pointillize • Palette:pointMerge • Palette:pointRender • Palette:pointRepack • Palette:pointTransform • Palette:pointWeight • Palette:popDialog • Palette:probe • Palette:projectorBlend • Palette:pushPins • Palette:puzzle • Palette:radialBlur • Palette:remotePanel • Palette:rgbaBlur • Palette:rgbaDelay • Palette:rgbContrast • Palette:search • Palette:searchReplace • Palette:sharpen • Palette:softenAlpha • Palette:solarize • Palette:sopRender • Palette:stitcher • Palette:stoner • Palette:superFormula • Palette:sweetSpotPreviz • Palette:TDVR • Palette:transitMap • Palette:twirl • Palette:vectorScope • Palette:virtualFile • Palette:waveformMonitor • Palette:webBrowser • Palette:xyScope

An Operator Family that contains its own Network inside. There are twelve 3D Object Component and eight 2D Panel Component types. See also Network Path.

A built-in panel in TouchDesigner that contains a library of components and media that can be dragged-dropped into a TouchDesigner network.

TOuch Environment file, the file type used by TouchDesigner to save your project.

TouchDesigner Component file, the file type used to save a Component from TouchDesigner.

A dialog box in which commands and scripts can entered manually. Script errors and python print() messages are also output to the textport.

The location of an operator within the TouchDesigner environment, for example, /geo1/torus1, a node called torus1 in a component called geo1. The path / is called Root. To refer instead to a filesystem folder, directory, disk file or http: address, see Folder.

An Operator Family that creates, composites and modifies images, and reads/writes images and movies to/from files and the network. TOPs run on the graphics card's GPU.

Lets you embed files inside a .tox or .toe file. Operators like the Movie File In TOP that read regular files can also read the embedded VFS files using a vfs: syntax.

An Operator Family that manipulates text strings: multi-line text or tables. Multi-line text is often a command Script, but can be any multi-line text. Tables are rows and columns of cells, each containing a text string.

An Operator Family that contains its own Network inside. There are twelve 3D Object Component and eight 2D Panel Component types. See also Network Path.

A form of DATs (Data Operators) that is structured as rows and columns of text strings.