Difference between revisions of "Experimental:Palette:virtualFile Ext"

From TouchDesigner Documentation
Jump to: navigation, search
 
Line 57: Line 57:
 
|text=Finds all files in VFS with names matching the pattern. Returns a list of VFSFile objects.
 
|text=Finds all files in VFS with names matching the pattern. Returns a list of VFSFile objects.
 
*pattern - (Keyword, Optional) The pattern to match against.
 
*pattern - (Keyword, Optional) The pattern to match against.
 +
}}
 
{{ClassMethod
 
{{ClassMethod
 
|class=VirtualFileExt
 
|class=VirtualFileExt
Line 87: Line 88:
 
|text=Get a VFSFile by index
 
|text=Get a VFSFile by index
 
*index - (Keyword) index of the file
 
*index - (Keyword) index of the file
 +
}}
 
}}
 
}}
 
{{History}}
 
{{History}}

Latest revision as of 17:13, 4 May 2020

These Extentions reference a specific Palette:virtualFile.


VirtualFileExt[edit]

The VirtualFileExt extension provides extended functionality for working with the virtual files embedded in the component. Many of the functions mirror the vfs functions that exist on all COMPs.

Members[edit]

No operator specific members.


Methods[edit]

AddFile(filePath=None, overrideName=None, removeAllFirst=None, returnVirtualPath=False)VFSFile or virtual path:

Add an embedded file from disk to the component with an option to override the name.

  • filePath - (Keyword, Optional) The path of the file to add. Default = par.Filesource
  • overrideName - (Keyword, Optional) When specified, will override the name of the file in VFS.
  • removeAllFirst - (Keyword, Optional) If True, remove all the virtual files first, default = par.Removeallbeforeadds
  • returnVirtualPath - (Keyword, Optional) If True, return the virtual path instead of VFSFile

AddFromImage(top=None, name=None, filetype=None, removeAllFirst=None, returnVirtualPath=False)VFSFile or virtual path:

Add an image file created from the provided TOP. Returns an vfs info dictionary OR vfs paths using mode defined by par.Uselabel

  • top - (Keyword, Optional) The TOP image to use. Default = par.Imagesourcetop
  • name: the name to be stored with the image. Default = par.Virtualfileimagename + par.Virtualfileimagefiletype
  • filetype - (Keyword, Optional) The file filetype to save virtual file in. For available formats, see https://docs.derivative.ca/TOP_Class saveByteArray function. Default = par.Virtualfileimagefiletype
  • removeAllFirst - (Keyword, Optional) If True, remove all the virtual files first, default = par.Removeallbeforeadds
  • returnVirtualPath - (Keyword, Optional) If True, return the virtual path instead of VFSFile

AddFromTable(table=None, removeAllFirst=None, returnVFSPath=False)list of VFSFiles or list of Virtual Paths:

Add all files from 'path' column in input table. If there is an 'overrideName' column, use this for virtual names. Returns a list of VFSFiles OR virtual paths

  • table - (Keyword, Optional) table of filepaths, default = wired input or par.Pathstable
  • removeAllFirst - (Keyword, Optional) if True, remove all the virtual files first, default = par.Removeallbeforeadds
  • returnVirtualPath - (Keyword, Optional) if True, return list of vfs paths instead of VFSFiles

FileList(pattern='*')list of VFSFiles:

Finds all files in VFS with names matching the pattern. Returns a list of VFSFile objects.

  • pattern - (Keyword, Optional) The pattern to match against.

RemoveFiles(pattern='*'):

Destroys any virtual file from the component that matches with the supplied pattern.

  • pattern - (Keyword, Optional) The pattern to match against.
  • useLabel - (Keyword, Optional) When true, will match against the file label instead of the full path.

RemoveSingle(index=None):

Destroy a virtual file by index

  • index - (Keyword, Optional) Index of file to remove. Default = par.Virtualfileindex

Rename(oldName, newName):

Change the name of a virtual file

  • oldName - name of file to rename
  • newPath - new name for file

VFSFileFromIndex(index)VFSFile:

Get a VFSFile by index

  • index - (Keyword) index of the file


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 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.