Difference between revisions of "Experimental:Palette:virtualFile"

From TouchDesigner Documentation
Jump to: navigation, search
(Blanked the page)
(Tag: Blanking)
 
Line 1: Line 1:
[[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 [[COMP_Class#Virtual_File_System|Virtual File System]] that is built into all COMPs.
 
{{OPSection
 
    |opFamily=COMP
 
|sectionName=Usage
 
    |sectionSummary=
 
{{OPSubSection
 
|sectionName=Adding Virtual Files
 
|sectionSummary=There are three parameter-based ways to add files to the component. You can also use its [[Palette:virtualFile Ext|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.
 
    |opFamily=COMP}}{{OPSubSection
 
|sectionName=Add Virtual File From Disk
 
|sectionSummary=This adds any external file selected in the '''Source File''' parameter.
 
    |opFamily=COMP}}{{OPSubSection
 
|sectionName=Add Virtual Files From Table
 
|sectionSummary=This adds multiple external files identified in the <code>paths</code> column of the tableDAT specified in the <code>Paths Table</code> parameter. You can also wire a path table into virtualFile's input. If the table has an <code>overrideName</code> 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'.
 
    |opFamily=COMP}}{{OPSubSection
 
|sectionName=Add Virtual Image File From TOP
 
    |sectionSummary=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.
 
    |opFamily=COMP}}{{OPSubSection
 
|sectionName=Accessing Virtual Files
 
    |sectionSummary=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 '''<code>vfs</code> syntax''' to specify their location:
 
<syntaxhighlight>vfs:<component path>:<virtual file name></syntaxhighlight>
 
The virtual file name can include slashes to simulate a folder structure.
 
    |opFamily=COMP}}{{OPSubSection
 
|sectionName=VFS Path Helpers
 
    |sectionSummary=There are two ways to get a <code>vfs</code> path automatically from the virtualFile component.
 
* The '''output DAT''' contains a tableDAT showing the paths of all virtual files in the <code>virtualPath</code> column".
 
* The read-only '''Virtual Path''' parameter holds the <code>vfs</code> path of the virtual file at the index selected in the '''Index''' parameter. 
 
  
Example expressions that might be used in a <code>file</code> parameter:
 
<syntaxhighlight lang=python>
 
# gets the file selected by Index parameter.
 
op('/virtualFile').par.Virtualpath
 
 
# gets the second virtual file if 'null1' is wired to output of a virtualFile component.
 
op('/null1')[2, 'virtualPath]</syntaxHighlight>
 
 
    |opFamily=COMP}}}}
 
{{ParameterPage
 
|opFamily=COMP
 
|pageName=VFS
 
|pageSummary=
 
|items={{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Version
 
|parName=Version
 
|parType=Str
 
|parReadOnly=
 
|parSummary=Component Version
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Help
 
|parName=Help
 
|parType=Pulse
 
|parReadOnly=
 
|parSummary=Open this wiki page
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=List All Virtual Files To Textport
 
|parName=List
 
|parType=Pulse
 
|parReadOnly=
 
|parSummary=Print the vfsFileList to textport
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Remove All Virtual Files
 
|parName=Remove
 
|parType=Pulse
 
|parReadOnly=
 
|parSummary=Remove virtual files from this component
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Echo Commands To Texport
 
|parName=Echocommands
 
|parType=Toggle
 
|parReadOnly=
 
|parSummary=Print vfs commands run by parameter functions. This is for visibility and learning of the TouchDesigner vfs Python commands.
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Remove All Files Before Adds
 
|parName=Removeallbeforeadds
 
|parType=Toggle
 
|parReadOnly=
 
|parSummary=Remove all files first when adding virtual files
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Index
 
|parName=Virtualfileindex
 
|parType=Int
 
|parReadOnly=
 
|parSummary=Index of the specific virtual file for parameters below
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Virtual Path
 
|parName=Virtualpath
 
|parType=Str
 
|parReadOnly=
 
|parSummary=vfs path of the selected virtual file
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Remove Virtual File
 
|parName=Removesingle
 
|parType=Pulse
 
|parReadOnly=
 
|parSummary=Remove the selected virtual file
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Rename Virtual File
 
|parName=Rename
 
|parType=Pulse
 
|parReadOnly=
 
|parSummary=Open a dialog to give the selected virtual file a new internal filePath
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Source File
 
|parName=Filesource
 
|parType=File
 
|parReadOnly=
 
|parSummary=The external file to embed
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Add From Disk
 
|parName=Add
 
|parType=Pulse
 
|parReadOnly=
 
|parSummary=Add the file selected in Source File parameter
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Paths Table
 
|parName=Pathstable
 
|parType=DAT
 
|parReadOnly=
 
|parSummary=Table with 'path' column containing file paths of files to embed. An optional 'overrideName' column will be used as well, if found.
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Add From Table
 
|parName=Addfromtable
 
|parType=Str
 
|parReadOnly=
 
|parSummary=Add files specified in Paths Table DAT
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Image Source TOP
 
|parName=Imagesourcetop
 
|parType=TOP
 
|parReadOnly=
 
|parSummary=TOP to use to create virtual image file
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Virtual File Name
 
|parName=Virtualfilename
 
|parType=Str
 
|parReadOnly=
 
|parSummary=Virtual name of the created file
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Auto-Increment Name
 
|parName=Autoincrementname
 
|parType=Toggle
 
|parReadOnly=
 
|parSummary=When on, add one to the digit at end of Virtual File Name every time an image is embedded
 
|parOrder=
 
|parItems=}}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Virtual File Image Filetype
 
|parName=Virtualfileimagefiletype
 
|parType=Menu
 
|parReadOnly=
 
|parSummary=File type to embed
 
|parOrder=
 
|parItems=
 
    }}
 
{{Parameter
 
|opFamily=COMP
 
|opType=
 
|parLabel=Add From TOP
 
|parName=Addfromtop
 
|parType=Str
 
|parReadOnly=
 
|parSummary=Add virtual file from Image Source TOP
 
|parOrder=
 
|parItems=}}
 
 
}}
 
{{InputsPage
 
|opFamily=COMP
 
|opInputs={{OPInput
 
|opFamily=DAT
 
|inputIndex=0
 
|inputName=Paths Table
 
|inputSummary=Table with 'path' column (and optionally 'overrideName' column) containing file paths of files to embed. Will override Paths Table parameter}}
 
}}
 
{{OutputsPage
 
|opFamily=COMP
 
|opOutputs={{OPOutput
 
|opFamily=DAT
 
|outputIndex=0
 
|outputName=vfsFiles
 
|outputSummary=info about all embedded virtual files}}
 
}}
 
{{History}}
 
{{CategoryNavBox
 
|Category=Palette}}
 
{{#invoke:Category
 
|list
 
|Palette}}
 

Latest revision as of 16:02, 21 May 2020