Page Class

From TouchDesigner Documentation
Revision as of 12:05, 1 March 2018 by Markus Heckmann (talk | contribs) (Created page with " <!--PYH Page--> The Page class describes the list of custom parameters contained on a page. Pages are created on components via the COMP_Class#Custom_Paramete...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

The Page class describes the list of custom parameters contained on a page. Pages are created on components via the COMP class. See also the guide Custom Parameters.

Methods that create parameters return a tuplet, which is a list of parameters that were created. A tuplet is the set of parameters that appear on one line of the parameter dialog.

To view individual attributes of each parameter such as default, min, max, etc, see the Par Class documentation.


Members[edit]

index (Read Only) The numeric index of this page.
pars (Read Only) The list of parameters on this page.
parTuplets (Read Only) The list of parameter tuplets on this page. A tuplet is the set of parameters on one line.
name Get or set the name of the page.
owner (Read Only) The OP to which this object belongs.
styles (Read Only) A dictionary of named tuples describing possible Par style attributes. Example: Page.styles['Int'] returns StyleInfo(sizeable=True, suffixes=['1', '2', '3', '4'])



Methods[edit]

destroy()

Destroy the page this object refers to, and all its parameters.

sort(parameter1, parameter2, parameter3..)

Reorder custom parameters in specified order.
n = op('base1')
page = n.appendCustomPage('Custom1')
page.sort('Speed','Color','Value')

appendStr(name, label=None, order=None, replace=True)tuplet

Create a string type parameter. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.

appendStrMenu(name, label=None, order=None, replace=True)tuplet

Create a menu type parameter. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.

appendFloat(name, label=None, size=1, order=None, replace=True)tuplet

Create a float type parameter. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • size - (Keyword, Optional) Set the number of values associated with the parameter. When greater than 1, the parameter will be shown as multiple float fields without a slider and multiple parameters will be created with the index of the parameter appended to the parameter name, starting at 1.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendInt(name, label=None, size=1, order=None, replace=True)tuplet

Create a integer type parameter. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • size - (Keyword, Optional) Set the number of values associated with the parameter. When greater than 1, the parameter will be shown as multiple float fields without a slider and multiple parameters will be created with the index of the parameter appended to the parameter name, starting at 1.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendToggle(name, label=None, order=None, replace=True)tuplet

Create a toggle button type parameter. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.

appendMomentary(name, label=None, order=None, replace=True)tuplet

Create a momentary type parameter. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.

BUILD NOTE: Only available in experimental builds 2017.30000+

appendPulse(name, label=None, order=None, replace=True)tuplet

Create a pulse button type parameter. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.

appendPython(name, label=None, order=None, replace=True)tuplet

Create a python type parameter. These parameters only allow editing of a python expression. Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.

BUILD NOTE: Only available in experimental builds 2017.30000+

appendMenu(name, label=None, order=None, replace=True)tuplet

Create a menu type parameter. Returns the created parameter objects.
To set the actual menu entries, use the Par members: .menuNames and .menuLabels.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendRGB(name, label=None, order=None, replace=True)tuplet

Create a RGB color type parameter. Similar to creating a float parameter with size=3, but with more appropriate default naming.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendRGBA(name, label=None, order=None, replace=True)tuplet

Create a RGBA color type parameter. Similar to creating a float parameter with size=4, but with more appropriate default naming.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendUV(name, label=None, order=None, replace=True)tuplet

Create a UV 2D texture type parameter. Similar to creating a float parameter with size=2, but with more appropriate default naming.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendUVW(name, label=None, order=None, replace=True)tuplet

Create a UVW 3D texture type parameter. Similar to creating a float parameter with size=3, but with more appropriate default naming.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendWH(name, label=None, order=None, replace=True)tuplet

Create a WH size type parameter. Similar to creating a float parameter with size=2, but with more appropriate default naming.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendXY(name, label=None, order=None, replace=True)tuplet

Create a XY position type parameter. Similar to creating a float parameter with size=2, but with more appropriate default naming.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendXYZ(name, label=None, order=None, replace=True)tuplet

Create a XYZ position type parameter. Similar to creating a float parameter with size=3, but with more appropriate default naming.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendOBJ(name, label=None, order=None, replace=True)tuplet

Create a 3D Object COMP node reference type parameter. This parameter will only accept references to 3D Object COMPs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendPanelCOMP(name, label=None, order=None, replace=True)tuplet

Create a Panel COMP node reference type parameter. This parameter will only accept references to Panel COMPs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendCOMP(name, label=None, order=None, replace=True)tuplet

Create a COMP node reference type parameter. This parameter will only accept references to COMPs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendSOP(name, label=None, order=None, replace=True)tuplet

Create a SOP node reference type parameter. This parameter will only accept references to SOPs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendMAT(name, label=None, order=None, replace=True)tuplet

Create a MAT node reference type parameter. This parameter will only accept references to MATs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendCHOP(name, label=None, order=None, replace=True)tuplet

Create a CHOP node reference type parameter. This parameter will only accept references to CHOPs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendTOP(name, label=None, order=None, replace=True)tuplet

Create a TOP node reference type parameter. This parameter will only accept references to TOPs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendDAT(name, label=None, order=None, replace=True)tuplet

Create a DAT node reference type parameter. This parameter will only accept references to DATs, and will refuse operators of other families.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendOP(name, label=None, order=None, replace=True)tuplet

Create a node reference type parameter. This parameter will accept references to any operator.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendFile(name, label=None, order=None, replace=True)tuplet

Create a file reference type parameter. Has built-in functionality to open a new file picker window.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.


appendFolder(name, label=None, order=None, replace=True)tuplet

Create a folder reference type parameter. Has built-in functionality to open a new folder picker window.
Returns the created parameter objects.
  • name - The name of the parameter.
  • label - (Keyword, Optional) The displayed label of the parameter, default will use the name argument.
  • order - (Keyword, Optional) Specify the display order of the parameter, default is highest.
  • replace - (Keyword, Optional) By default, replaces parameter with fresh attributes. If False, it errors if the parameter already exists.

Miscellaneous[edit]

__getstate__()dict

Returns a dictionary with persistent data about the object suitable for pickling and deep copies.

__setstate__(dict)

Reads the dictionary to update persistent details about the object, suitable for unpickling and deep copies.

Special Functions[edit]

len(Page)int

Returns the total number of parameters.
   a = len(page)

[index]Par

Return a specific parameter given an integer index.
   x = page[0]

Iterator

Iterate over each parameter.
   for p in page:
       # do something with Par p


The component types that are used to render 3D scenes: Geometry Component contain the 3D shapes to render, plus Camera, Light, Ambient Light, Null, Bone, Handle and other component types.

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.

An Operator Family that reads, creates and modifies 3D polygons, curves, NURBS surfaces, spheres, meatballs and other 3D surface data.

An Operator Family that associates a shader with a SOP or Geometry Object for rendering textured and lit objects.

An Operator Family which operate on Channels (a series of numbers) which are used for animation, audio, mathematics, simulation, logic, UI construction, and many other applications.

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.

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.