Difference between revisions of "Silhouette Module Reference"
Jump to navigation
Jump to search
Line 96: | Line 96: | ||
=== Global Constants === | === Global Constants === | ||
− | ==== Blend Mode Constants === | + | ==== Blend Mode Constants ==== |
{| class="wikitable" | {| class="wikitable" | ||
! scope="col" | Name | ! scope="col" | Name |
Revision as of 16:02, 18 November 2012
Contents
The fx Module
All of Silhouette's built-in functions are defined in the fx module. The easiest way to make use of the module is to use the Python statement from fx import *.
Global Attributes
These attributes are read-only.
Name | Description |
---|---|
actions | The List of Actions |
gui | True if running in the GUI, False from the command-line |
hooks | The List of Hooks |
io_modules | The List of IO Handlers |
prefs | The Preferences map |
version | The Silhouette version as a float (major.minor) |
Global Functions
Name | Description |
---|---|
action(name) | Returns the Action with the given name |
activeLayer() | Return the active Layer, or None |
activeNode() | Return the active Node, or None |
activeProject() | Return the active Project, or None |
activeSession() | Return the active Session, or None |
addAction(action) | Add a new Action to the action list |
askQuestion(text, title=None, okText='OK', cancelText='Cancel') | Display a Question Dialog and return True if the 'ok' button is pressed. |
beginUndo(label) | Begin an undo block. Must be followed up with endUndo(). |
bind(key, function) | Bind the key to a function. |
buildPath(path) | Parse and return a path with automatic variable expansion |
cut(objects) | Cut the objects into the Clipboard (same as Edit->Cut) |
copy(objects) | Copy the objects into the Clipboard (same as Edit->Copy) |
delete(objects) | Delete the objects (same as Edit->Delete) |
displayError(msg, title=None) | Display an Error Dialog |
displayInformation(msg, title=None) | Display an Information Dialog |
displayWarning(msg, title=None) | Display a Warning Dialog |
endUndo() | End an undo block. |
getBind(key) | Return the function or control name the key is bound to, or None. |
getLog() | Return the complete text of the log. |
log(text) | Add text to the log. |
select(objects) | Select the object List. |
selection() | Return the selection List. |
setActiveLayer(layer) | Sets the active Layer, or None. |
showView(view, visible=True) | Shows (or hides) the view by name |
status(text) | Display the text in the status bar. |
unbind(key) | Unbind the key from its function. |
uniqueLabel(label) | Returns a project-wide unique version of the label, appending a number if necessary. |
viewVisible(view) | Returns True if view is visible. |
Global Constants
Blend Mode Constants
Name | Description |
---|---|
Blend_Add | Add blend mode |
Blend_Subtract | Subtract blend mode |
Blend_Multiply | Multiply blend mode |
Blend_XOR | XOR blend mode |
= Depth Constants
Name | Description |
---|---|
Depth_Default | The preferred depth (based on the Session depth) |
Depth_8 | 8 bits per component |
Depth_Float16 | 16 bit half-float per component |
Depth_Float32 | 32 bit float per component |
fx Objects
Name | Description |
---|---|
Action | Base class for Actions |
Object | Base class for all objects |