Package autodesk_toxik :: Module ui :: Class Workspace
[frames] | no frames]

Class Workspace

 object --+    
          |    
Boost.Python.instance --+
              |
             Workspace

The workspace provides access to the context of the interactive application and thus only makes sense when scripts are executed in the embedded interpreter.

Instance Methods
 
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__reduce__(...)
helper for pickle

Inherited from Boost.Python.instance: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods
str
getBrowserFolder()
Returns: The path of the current folder of the Toxik browser in focus.
BrowserScheme
getBrowserScheme()
Returns the scheme of the current Toxik browser which determines the type of entities that are browsed.
List of str
getBrowserSelection(...)
Gets the paths of elements selected in the Toxik browser in focus.
str
getBrowserTarget()
Gets the path of the browser element targeted by the action being processed; in other words, the element on which the user right-clicked to invoke a script.
List of Graph
getCompositions(...)
Returns: The list of compositions that are opened in the Toxik UI workspace.
Graph
getCurrentComposition(...)
Returns: Composition that is currently opened in the Toxik UI workspace.
List of str
getFileBrowserSelection()
Same as getBrowserSelection but only for file system browsers.
str
getFileBrowserTarget()
Same as getBrowserTarget but only for file system browsers.
int
getNbCompositions(...)
Returns: The number of compositions that are opened in the Toxik UI workspace.
List of Node.
getSelectedNodes()
Returns: The composition nodes currently selected in the Toxik UI.
Node or None
getTargetNode()
Returns: The node targeted by the action being processed; in other words, the node on which the user right-clicked to invoke a script.
bool
isCompositionOpened(...)
Indicates whether the composition at the specified path is currently opened in the Toxik UI workspace.
 
openComposition(...)
Opens the given composition in the Toxik UI workspace.
Class Variables
  __instance_size__ = 24
Properties

Inherited from object: __class__

Method Details

__init__(...)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__reduce__(...)

 

helper for pickle

Overrides: object.__reduce__
(inherited documentation)

getBrowserFolder()
Static Method

 
Returns: str
The path of the current folder of the Toxik browser in focus. The returned string is empty if there's no browser in focus.

getBrowserScheme()
Static Method

 

Returns the scheme of the current Toxik browser which determines the type of entities that are browsed. Possible schemes are provided by the BrowserScheme class. The most common and interesting one being the BrowserScheme.FILE_SYSTEM scheme which identifies a file system browser.

Returns: BrowserScheme
The scheme of the Toxik browser in focus. The returned string is empty if there's no browser in focus.

getBrowserSelection(...)
Static Method

 

Gets the paths of elements selected in the Toxik browser in focus. Note that the browser can be something else than a file system browser; see getBrowserScheme method).

Returns: List of str
The current browser selection. The returned list is empty if there's no selection or if there's no browser in focus.

getBrowserTarget()
Static Method

 

Gets the path of the browser element targeted by the action being processed; in other words, the element on which the user right-clicked to invoke a script. This target is also part of the current browser selection returned by getBrowserSelection.

Returns: str
The path of the current browser target. The returned string is empty if there's no target.

getCompositions(...)
Static Method

 
Returns: List of Graph
The list of compositions that are opened in the Toxik UI workspace.
Raises:
  • UiError - If this method is not used within the embedded interpreter.

getCurrentComposition(...)
Static Method

 
Returns: Graph
Composition that is currently opened in the Toxik UI workspace.
Raises:
  • UiError - If this method is not used within the embedded interpreter, or if there is no current composition in the workspace.

getFileBrowserSelection()
Static Method

 

Same as getBrowserSelection but only for file system browsers. Gets the paths of files and folders selected in a BrowserScheme.FILE_SYSTEM browser (see getBrowserScheme).

Returns: List of str
The current file browser selection. The returned list is empty if there's no selection or if if the current browser is not a file system browser.

getFileBrowserTarget()
Static Method

 

Same as getBrowserTarget but only for file system browsers. Gets the path of the file or folder on which the user right-clicked in a BrowserScheme.FILE_SYSTEM scheme browser (see getBrowserScheme) to invoke a script. This target is also part of the current file browser selection returned by getFileBrowserSelection.

Returns: str
The path of the current file/folder target. The returned string is empty if there's no target or if the current browser is not a file system browser.

getNbCompositions(...)
Static Method

 
Returns: int
The number of compositions that are opened in the Toxik UI workspace.
Raises:
  • UiError - If this method is not used within the embedded interpreter.

getSelectedNodes()
Static Method

 
Returns: List of Node.
The composition nodes currently selected in the Toxik UI. The returned list is empty if no nodes are selected or if there's no Toxik UI. This is a shorcut for Workspace.getCurrentComposition().getSelectedNodes().

getTargetNode()
Static Method

 
Returns: Node or None
The node targeted by the action being processed; in other words, the node on which the user right-clicked to invoke a script. The target node is also part of the current node selection returned by getSelectedNodes. None is returned if there's no target node.

isCompositionOpened(...)
Static Method

 

Indicates whether the composition at the specified path is currently opened in the Toxik UI workspace.

Parameters:
  • path (str) - Composition file path (txcomposition).
Returns: bool
True if the specified composition is opened in the Toxik UI workspace.
Raises:
  • UiError - If this method is not used within the embedded interpreter.

openComposition(...)
Static Method

 

Opens the given composition in the Toxik UI workspace.

Parameters:
  • path (Graph) - Composition to open.