Prev | Next


Scripting Glossary


Glossary Overview
The Slim Object
The Workspace Object
TreeNode Objects
PaletteEntry Objects
Palette Objects
Appearance Objects
Function Objects
Template Objects
Instance Objects
Property Objects
Collection Objects
AtomicProperty Objects
Parameter Objects
Attribute Objects
SlimAttribute, TCLAttribute, and TORAttribute Objects
Class Index
Procedures

Glossary Overview

This file contains a complete glossary of the methods and procedures accessible from the scripting environment. This is a reference document. For more of an introductory environment, see the Introduction to Slim Scripting.

As mentioned in the introduction, Slim's scripting interface is also used by MTOR for communication with Slim, and by Slim itself when parsing files. It is for this reason that some methods available in the slim scripting environment may not actually be useful for scripting the behavior of Slim and are not germaine when Slim is used with RenderMan for Maya Pro.

Methods that fit this criteria are listed here but with minimal documentation and are formatted in italics. For example:

objh GetObject
objh RemoveAlias
objh SetObject newObject

These methods are used to establish the scripting environment, and while available for all objects, are not generally useful.


The Slim Object

These are the methods defined for the slim object:

slim BackupPalettes

Create backup versions of all palettes loaded. This method is called by MTOR when it detects that Maya has crashed.

slim BuildShaders ?arg arg ...?

Generate and build all shaders associated with attachable functions.

Optional arguments:

-dirty
Only act upon functions that have been changed since the shaders have last been generated

slim Clear

Completely reset Slim's state. The method is called by MTOR when it opens a new scene file.

slim ClientCmd cmd
slim ClientMsg msg

Send a command or message to MTOR.

slim ClientSelection app list ?applistcomputed?

This method is used by MTOR to inform Slim that the selection in Maya has changed.

slim CommitCmds  

CommitCmds will:

  1. Flush the undo queue and commit all commands.
  2. Remove all deleted Appearances from memory.
  3. Remove all deleted Palettes from memory.
In the general case, the user will want to call update immediately before calling slim CommitCmds.

slim CreatePalette ?arg arg ...?

Create or open a Slim palette. One of the following arguments is required:

-new
Create a new, untitled palette
-file filename
Open the palette specified by filename
-pickfile
Select a palette to open using the File Picker

Optional arguments:

-edit
Edit the palette that has been created or opened in the Palette Editor

slim Encapsulate ?arg arg ...?

Provides a complete encapsulation of the current state of Slim. This is used by MTOR to save Slim data into the Maya scene. The state can be restored using the Instantiate method.

Optional arguments:

-full
Rather than just referencing them, fully encapsulate external palettes
-export {applist}
Only encapsulate appearances in the specified list. External palettes are fully encapsulated.
slim FindPalette ?name?

Returns the object handle for the palette with the given name. If no name is provided, the first palette handle is returned. If a match cannot be found, the empty string is returned.

slim GetAppearances ?arg arg ...?

Returns the list of appearances from all palettes which match the criteria specified in the arguments. The criteria can use glob style notation, which means that you can use the standard wild card characters: *, ?, etc. If no arguments are provided, the result is equivalent to the request:

slim GetAppearances -name * -id * -master * -template * -type * -selected ignore -dirty ignore

Criteria are specified by the following optional arguments:

-name namestring
Appearances with names matching the specified string
-id idstring
Appearances with unique id matching the specified string
-master masterstring
Appearances with master matching the specified string
-template templatestring
Appearances with template matching the specified string. This is only meaningful for Functions.
-type typestring
Appearances of type matching the specified string. You can determine the list of recognized types using the slim GetTemplates -types command. In addition to these types, you can use any of the following meta-types:

_Attachable
appearances of appropriate type for attaching to objects.
_NotAttachable
appearance not appropriate for attaching to objects.
_AllSpecial
attachable appearances that follow the standard *TOR naming convention (that causes their inclusion in the RIB stream.
_Declare
appearances that obey the standard *TOR naming convention that causes their inclusion into the declaration portion of the RIB stream.
_Frame
appearances that obey the standard *TOR naming convention that causes their inclusion into the frame portion of the RIB stream.
_World
appearances that obey the standard *TOR naming convention that causes their inclusion into the world portion of the RIB stream.
_Frontplane
appearances that obey the standard *TOR naming convention that causes their inclusion into the frontplane portion of the RIB stream.
_Backplane
appearances that obey the standard *TOR naming convention that causes their inclusion into the backplane portion of the RIB stream.

-selected (1 | 0 | ignore)
Appearances matching the specified selection state, which is one of 0 (unselected), 1 (selected) or "ignore" (either).
-dirty (1 | 0 | ignore)
Appearances matching the specified dirtiness state, which is one of 0 (clean, doesn't require regeneration), 1 (dirty, requires regeneration) or "ignore" (either). This criterion is only meaningful for appearances of class function and type _Attachable (see above).

Example uses:

slim GetAppearances -type float -name Fractal*
Returns objects handles for all float appearances with names starting with "Fractal"
slim GetAppearances -id 1000_TLum8400000
Returns the object handle for the appearance with the specified unique id
slim GetAppearances -template pixar*
Returns object handles for all appearances which use the factory templates

slim GetClientSelection apptype

Returns a list of names of items selected in Maya that would have resulted from an attachment of type apptype.

slim GetDoGUI

Returns whether Slim's user interface is visible, or whether it is being run in batch mode.

slim GetEncapsulation obj

Returns an encapsulation of the specified object. This can be used in combination with the Instantiate method.

slim GetEquivalentTypes type

Attachable types like Surface may have several types mapped to them. This method returns all of the types that have been defined to map to the specified type.

Example usage:
% slim GetEquivalentTypes surface
shadingmodel shadingmodel_aov visualizer
slim GetPalettes ?arg arg ...?

Get object handles for all top-level palettes (i.e., subpalettes are excluded).

Optional arguments:

-visible
Only returns palettes that have not been marked as hidden

slim GetPresentableTemplateName tmpltid ?arg arg ...?

Given a template identifier, returns a version suitable for displaying to the user. This will match the string that the user sees elsewhere in the Slim interface. If the user has turned on Expert Menus, the version will be indicated by parentheses.

Optional arguments:

-showVersion ( 1 | 0 )
Explicitly state whether the version is included

Example usage (in this example, the user has Expert Menus on):

% set app [slim GetAppearances -name Fractal*]
func5
% set tmpltID [$app GetTemplateID]
pixar,C_Fractal#0
% set tmpltLabel [slim GetPresentableTemplateName $tmpltID]
Fractal (v0)

slim GetRIB id ?flags?

Invokes the GetRIB method on the appearance with the specified unique ID. This is used by MTOR for rib generation.

slim GetRunMode

Returns whether Slim is being run in conjunction with RfM ("server") or as a standalone application ("solo").

slim GetSlimStatus

Always returns the message "Slim is active." This is used by MTOR to verify that Slim is operational.

slim GetTemplates ?arg arg ...?

Get a list of all active templates.

Optional arguments:

-name name
Only return templates with name matching the specified string
-type type
Only return templates of the specified type
-showhidden
Include hidden (obsolete) templates in the search. These templates are usually excluded.
-return ( name | alterego ) Controls whether the returned list consists of template identifier strings like pixar,ColorSpline#0 ("name", the default) or object handles like tmplt42 ("alterego").
-types
Just return a list of the types encompassed by active templates. This should be used without any other options.

slim GetWorkspace

Returns the workspace object.

slim Instantiate state modes

Instantiate Slim with the specified state string. This is how MTOR initializes Slim when opening a scene file.

slim InstantiateGUI

Initialize the user interface for Slim. This creates all of the palette editors when opening a scene file.

slim JournalCmd ?arg arg ...?

Execute a command and journal it. That is, make it undoable. Journaling works by specifying a command to execute, a command to execute if the user hits undo, and (optionally) a command to execute if the user hits redo.

Arguments:

-doit command
The command to execute
-undoit command
The command to execute if the user hits Undo
-redoit command
A command to execute if the user hits Redo. If this is not specified, the -doit command will be executed. This option can be useful, however, if there is a way to perform this command more efficiently after it has been undone.
-title titlestring
The string to use in the Undo/Redo menu entries
-cmdkey identifier
You will notice that every editor has its own independent Undo/Redo stack. This key, the unique ID for the palette or appearance being edited, identifies which stack to use.

Most methods invoked by the user interface (e.g. SetValue) are automatically journalled. If you find that a method used in a script isn't journalled, you can use this command to make it undoable. More commonly, though, this method is used to gather together several journalled methods into one action.

For example, the following script operates on three different parameters and sets them to zero:
set kd [$apph GetProperties -name Kd]
set ks [$apph GetProperties -name Ks]
set kr [$apph GetProperties -name Kr]
$kd SetValue 0
$ks SetValue 0
$kr SetValue 0

SetValue is automatically journalled. But if a user were to execute this script and then change his mind, he'd have to hit Redo three times. The following code groups this code into one action by disabling the journalling in SetValue and explicitly specifying undo behavior.

proc SetValues {p1 v1 p2 v2 p3 v3} {
    # temporarily disable journalling
    set old [::RAT::SetJournalingState 0]
    $p1 SetValue $v1
    $p2 SetValue $v2
    $p3 SetValue $v3
    # restore journalling
    ::RAT::SetJournalingState $old
}

set kd [$apph GetProperties -name Kd]
set ks [$apph GetProperties -name Ks]
set kr [$apph GetProperties -name Kr]

set curKd [$kd GetValue]
set curKs [$ks GetValue]
set curKr [$kr GetValue]

slim JournalCmd \
	-doit "SetValues $kd 0 $ks 0 $kr 0" \
	-undoit "SetValues $kd $curKd $ks $curKs $kr $curKr" \
	-title "Zero Out K Values" \
	-cmdkey [$apph GetID]
JournalCmd is most frequently used in CustomUIs, which must often group several low-level commands into one action. You will find several example uses of JournalCmd in the CustomUIs that ship with Slim.

slim LoadWorkspaceFile dir file

Set the workspace root to dir and read the specified workspace file.

slim MakePalettesInternal names

This method is used by MTOR when importing a scene file

slim ModalMsg msg
slim ModalStart title file text ?arg arg ...?
slim ModalStop ?arg arg ...?

These methods are used for communication from MTOR to Slim.

slim NewCmdUI vendor nm
slim NewCustomUI vendor nm
slim NewExpressionUI vendor type nm
slim NewPalette id
slim NewPaletteReference filename
slim NewTemplate type nm vendor prefix version

These method are used by the SlimParser when reading a palette file.

slim ReadSlimFile file ?context?

Read the specified Slim file into the context given by context. If not provided the file is read into the global context. You can use this command to load additional Slim templates anytime Slim is running. You can also cause appearances or palettes encapsulated within a slim file to be imported into an existing palette by specifying the container palette's handle as the context.

slim ReadSlimString string ?context?

This operates like ReadSlimFile, only reads data directly from the specified string.

slim ReloadExtensions ?class?

Reload extensions to Slim. Class is the class of extension, which you will find in the LoadExtension calls in slim.ini:

slim
all "slim" extension files
customcmd
all custom commands
customui
all customui definitions

With the class argument omitted, this will reload all extensions

slim SavePrefs

Write user preferences to disk. This is usually performed when Slim shuts down.

slim SetClientSelection app ?type?

This method is used by Slim for Pick Objects in Maya.

slim SetGuiContext
slim SetProjectLocation location
slim SetSceneLocation location

These methods are used by MTOR to intialize Slim.

slim Shutdown ?force?

Shut down Slim. This is usually used by RfM to indicate that Maya is shutting down.

slim Uniqueify mapping

This method is deprecated.

slim UpdateGUI ?arg arg ...?

Same as the tcl/tk "update" builtin

slim WindowCmd cmd win ?arg arg ...?

Issue a command to a specified window

Example uses:

% slim WindowCmd raise all
Raise all slim windows
% slim WindowCmd hide all
Hide all slim windows
% slim WindowCmd show Preferences
Show the preferences window


The Workspace Object

These are the methods defined for the workspace object. For more background on workspaces, please refer to the Workspace Editor documentation.

workspace AddDirMap fromPath toPath zone

Add a directory mapping from fromPath to toPath. The mapping will only be applied on systems in the specified zone. Directory maps are also applied by workspace ResolvePath path.

The following is an example of two directory mappings that would allow any paths beginning with /users to always be replaced with C:/users on windows machines, and vice versa on unix machines:

% workspace AddDirMap /users C:/users UNC
% workspace AddDirMap C:/users /users NFS

workspace AddSearchPath p ?which?

Add the path p to the search paths. The optional argument which, if provided, should be either local or server, which indicates whether to add the path to the project or server paths. If not provided, the default is to add to the project paths.

workspace ApplyDirMaps path

Apply directory mapping to the specified path. The first mapping with a fromPath that matches a portion of path will be applied. Returns the mapped path.

workspace BuildDirs

Create all of the directories associated with the workspace definition.

workspace ClearDirMaps ?arg arg ...?

Clear directory mappings. With no additional arguments, all directory mappings are cleared.

Optional arguments:

-index i
Delete the directory mapping with the specified index in the list of mappings.
-mappattern pattern
Deletes any directory mappings which match the specified glob-style pattern. For example:

% workspace ClearDirMaps -mappattern {C:/usr /usr NFS}
% workspace ClearDirMaps -mappattern {* * UNC}

workspace ClearSearchPath p ?which?

Remove the path p from the searchpath list associated with which. The optional argument which, if provided, should be either local or server, which indicates whether to clear the path from the project or server paths. If not provided, the default is to clear from the project paths.

workspace CreateTempWSFile

Create a temporary workspace file. This method is used for deferred ribgen

workspace GetDir name ?dosubst? ?createit?

Determine the location of the abstract directory type given by name. The list of known abstractions can be obtained via the GetDirNames method. The optional dosubst argument controls whether variable substitution is performed on the directory value, and defaults to 0 (do not perform substitution). The optional createit argument, if set to 1, causes the directory to be created; it defaults to 0.

workspace GetDirMapZone

Determine the zone in which the system is operating. The system's zone is specified by a preference called WSDirMapZone, which is set in the default RAT.ini. The default zoning scheme is based on filesystem type. Windows systems are in the UNC zone, while all other systems are in NFS. The list of all possible zones is specified by the pref called WSDirMapZoneList, also set in RAT.ini.

workspace GetDirMapZoneList

Get the list of possible zones in which directory mappings can be applied. Each directory mapping must be associated with one zone. A list of possible zones is given by the preference called WSDirMapZoneList, which is set to {NFS UNC} in the default RAT.ini. As you may have guessed, the default zoning scheme is based on file system type. Unices would be NFS and windows would be UNC. A systems's zone is specified by the preference called WSDirMapZone, also set in RAT.ini.

workspace GetDirMaps

Get the list of directory mappings. Each element in the list a sub-list containing a {to from zone} triplet. Here's an example list of dirmaps (paths containing spaces are surrounded by an extra set of braces):

{{foo bar UNC} {bar foo NFS} {{C:/Documents And Settings} /users NFS}}

workspace GetDirNames

Get the list of names of project resource locations. Use workspace GetDir name to get the actual directory name of the resource location, relative to the project root.

workspace GetProjectName

Get the name of the workspace file.

workspace GetRootDir

Get the current root directory. This method is equivalent to: workspace GetDir WSRoot.

workspace GetSceneDir

Get the directory in which the Maya scene file resides.

workspace GetSearchPathTypes ?which?

Get the list of resource types (shader, texture, etc.) for which searchpaths are defined. The which argument specifies whether to check local (the default) or server searchpaths.

workspace GetSearchPaths which ?dosubst? ?fmt?

Get the current project or server search paths depending on the which argument. To get the default project or server search paths, which should be local or server, respectively. Or to get the search paths used by a particular resource type, the which argument can be the name of the resouce type, like shader or texture. Note that if the search paths for a resource type are emtpy, the default will be used instead. The optional dosubst argument indicates whether to perform variable substitution when set to 1 (it defaults to 0). You can choose the format of the return value using the optional fmt argument which can be one of: list or RIB; the default is to return a list.

workspace GlobalizePath subpath

Prepend the current project root directory to the relative pathname given by subpath, and return the result.

workspace IsLocked type value

Determines whether the specified type of path is locked.

Possible values for type:

searchPaths
Check whether the searchpath list specified by value (one of server or local) is locked.
resourceLocations
Check whether the location of the resource specified by value is locked

workspace LocalizePath path ?w?

Convert an absolute file reference given by path to a relative one by stripping off known leading path components. You can choose to strip only if the path is below the current workspace root by setting the optional argument w to workspace. The default behavior is to consider all directories in the current local search paths.

workspace LockDir name location

Operates like SetDir method, but locks the directory to prevent future changes.

workspace LockRootDir d

Set and lock the root directory.

workspace LockSearchPaths p ?which?

Operates like SetSearchPaths method, but locks the searchpaths to prevent future changes.

workspace QuerySettings

Encapsulate the current state of the workspace object.

workspace ReloadProjectFile

Reload the last workspace file associated with the current workspace root. i.e., revert to the saved version of the current workspace file.

workspace ResolvePath path ?which? ?extensions?

Determine a fully qualified pathname to the file given by path by traversing search paths to resolve the file. This command returns the empty string if the file can't be found. The which argument can be used to indicate that only the searchpaths for the given resource type should be searched. Otherwise the default local search paths are used. You can also provide an optional list of space separated potential extensions (in a single string) which are appended to the filename during the search; for example:

% workspace ResolvePath fish {} "tif tex"
will search for fish.tif and fish.tex in the default searchpaths. A list of the found files (full pathnames) will be returned.
% workspace ResolvePath fish texture "tif tex"
will search for fish.tif and fish.tex in the texture searchpaths.

Also note that directory mappings will be applied to the path before it is resolved. For example, if a dirmap exists which maps /home to C:/home in the UNC zone, then the following command on a UNC system:

% workspace ResolvePath /home/somefile
could return:
C:/home/somefile

workspace RestoreDefaultPaths

Restore searchpaths to application defaults.

workspace RestoreDefaultSetupFiles

Restore setup files to application defaults.

workspace SetDir name location

Sets the resource abstraction given by name to the value given by location. These abstractions are used to determine where rendering related resources are to be found; the list of known abstractions can be obtained via the GetDirNames method.

workspace SetDirMaps maplist

Set the list of directory mappings to the specified maplist. Each entry in the list must be a {to from zone} triplet (list). Any pathnames that contain spaces should be surrounded by an extra set of braces. For example:

% workspace SetDirMaps {{foo bar UNC} {bar foo NFS} {{C:/Program Files/goo} /users/goo NFS}}

workspace SetProject root ?projectFile?

Set the current workspace root and initialize the workspace object's state using the contents of the last workspace file in use at that location or the file specified via the optional projectFile argument.

workspace SetSearchPaths p ?which?

Setthe search paths in the workspace object to p, which should be a single string (or list) containing one or several space-separated paths. Paths containing spaces should each be enclosed in an extra set of braces. The optional argument which can be local, server, or the name of a resource type, like texture or shader. local and server indicate that the default project or server paths should be updated. If not specified the default is to modify the local project paths.

workspace UpdateScriptingState

This method is used by MTOR to update the workspace's scripting state after making changes.

workspace WriteWSFile p ?which?

Write the current state of the workspace to the current workspace file.


TreeNode Objects

The TreeNode base class implements the support for organizing objects in tree structures. Refer to the Class Hierarchy diagram to see the list of classes that inherit from TreeNode. Because the classes representing the palettes, appearances, and parameters that you manipulate all inherit from this class, the following methods are common to all of them:

objh AddChild c ?front : 0?

Re-parent the specified object under this object. By default, the new child will be last in its parent's list of children. You can make the child the first in the parent's list by passing 1 for the front parameter. Note that you can use this command to move appearances and sub-palettes between palettes.

objh GetChildren

Get a list of the handles to the children of this object.

objh GetDescendents mode

Get the list of all descendents of this object. The descendents are sorted according to the mode argument which can take one of these values:

depthFirst
children appear before their parents.
prefixDepthFirst
parents precede children, but siblings follow children
breadthFirst
siblings appear before children

objh GetDrawMode

Get the draw mode for the object. For inlined functions, this is set to "inline".

objh GetParent

Get the handle to this object's parent.

objh GetRoot

Get the handle to the object that parents all objects in this object's tree.

objh RemoveChild c ?delete : 1?

Removes the specified child. By default, the child will also be deleted.

Note: using this command to delete a node may not remove all references to the child object, which can cause problems when working with appearances. We recommend that you use the Delete method to delete an appearance.

objh SetChildren children

Explicitly set the list of children for the object.


PaletteEntry Objects

PaletteEntry is another base class that defines a common set of functionality for palettes and appearances. The following methods are defined for these classes:

objh Delete ?remove : 0?

Deletes the entry. By default, the entry is only scheduled for deletion, which allows it to be easily undeleted. Setting the optional remove argument to 1 causes the entry to be immediately deleted. Using Delete 1 repeatedly is not recommended, as Delete 1 can be slow if called many times in a row. The recommended method for forcing the deletion of multiple objects is:

	foreach object $objects {
	   $object Delete 0
	}
	update
	slim CommitCmds

objh GenerateID

Generate a new unique ID for the entry.

objh GetDescription

Get the description for the object. The description is what is displayed when the user raises the help balloon for that object.

objh GetDisplayLevel

Get the display level for the entry.

Possible levels:

"" (empty string)
The default. Always visible.
hidden
Always hidden.
expert
Only visible when the user has "Expert Menus" turned on.
objh GetID

Get the unique ID for the entry.

objh GetLabel

Get the label for the object. For palette entries, this is usually identical the name.

objh GetName

Get the name of the object.

objh GetType

Get the type for the entry.

objh GetUserData key

User data is additional information associated with a PaletteEntry. It is stored as a series of name-value pairs. Other than that, the contents are completely arbitrary. You may find it to be a valuable way to store extra information for your scripts, or to communicate information from templates to CustomUIs. UserData is not visible in the Slim interface.

GetUserData accesses the user data stored with the specified key. If no user data is defined for this key, the empty string is returned.

objh GetUserDataArray

Get the entire array of user data. This can be useful when copying user data from one object to another.

objh IsDeleted

Because of the undoable nature of Delete, nodes that have been deleted via the interface may still be accessible from the scripting environment. This method allows you to check for this case.

objh IsDirty

Returns whether the node is "dirty" and needs to be saved.

objh IsHidden

This method allows you to quickly check whether a node is hidden.

objh SetDescription desc

Set the entry's description to the specified string.

objh SetDisplayLevel level

Set the display level for the entry.

objh SetID id

Set the unique ID for the entry to id.

objh SetImage imgbuf

Set the image using the specified encoded string. This method is used when reading a palette file.

objh SetLabel label

Set the entry's label to the specified string.

objh SetUserData key value

Set the user data for key to value.

objh SetUserDataArray data

Set the entire array of user data. This can be useful when copying user data from one object to another.

objh Undelete

Recover an entry scheduled for deletion. Note that this will not work if an entry has been immediately deleted.


Palette Objects

In addition to the methods defined in the PaletteEntry and TreeNode base classes, the following methods are defined for the objects representing the palettes and subpalettes in your scene:

plth ChangeSaveMode mode

Change the mode in which this palette is saved:

full
All property information is saved. This mode is compatible with previous versions of Slim.
minimal
Only changes to parameters are saved. This mode can only be read by Slim versions 6.5 and greater.
Note that when converting a "full" palette to a minimal one, Slim checks each field of a property to see if it matches the template. Matching fields are considered unset and not saved.

plth CreateAppearance ?arg arg ...?

Creates a new appearance inside this palette.

Valid options:

-template tmpltID
Creates an appearance using the template specified by tmpltID. You can find the names of available templates with the slim GetTemplates command.
-file filename
Creates an instance of the shader given by filename, which must be the name of a .slo or .slim file.

plth DeleteDisconnected

Delete any nodes in the graph that are not attachable and are not connected to any other attachable nodes.

plth DeleteEntries ?arg arg ...?

Deletes the appearances represented by any object handles listed. This method acts like the Delete method in that nodes are, by default, not immediately deleted. The optional -remove flag specifies immediate deletion.

plth DeleteUnused

Remove of all unused appearances in the palette. Appearances are deemed unused if they are not attached to any geometry in the Maya scene. This method is only meaningful if Slim is is connected to MTOR.

Because it interacts with MTOR, this method cannot be called via MEL using slimcmd).

plth Edit

Raise the Palette Editor for this palette.

plth GetAccessMode

Get the write permissions for this palette:

rw
Palette is writable
ro
Palette is read-only
plth GetAppearances ?arg arg ...?

Get the appearances in this palette matching the specified criteria. See the entry for slim GetAppearances specifics on criteria.

plth GetFilename

Get the filename associated with an external palette. This filename is generally derived from the palette's label. Returns the string untitled if the palette is internal or has never been saved.

plth GetGraphArea

This method is deprecated.

plth GetSaveMode

Get the save mode for this palette. Possible modes are discussed in ChangeSaveMode.

plth GetStorageType

Determine whether palette is internal (stored with a Maya scene) or external (stored as a separate file).

plth ImportInstance file ?arg arg ...?

Import the compiled shader (fully) specified by file. The optional -render flag triggers a subsequent preview render of the shader.

Determine whether palette is internal (stored with a Maya scene) or external (stored as a separate file).

plth Instantiate slimstr
plth InstantiateApp slimstr

Instantiate the object that has been previously encapsulated in the string slimstr. Typically you would obtain slimstr from a call to slim Encapsulate obj with an appearance or sub-palette handle. (Though Instantiate and InstantiateApp are equivalent, InstantiateApp is the preferred usage.)

plth Internalize ?arg arg ...?

Convert an external slim palette to an internal one. Note that because the file containing the external palette will still exist, this amounts to copying the data inside the palette. As such, Slim will regenerate unique IDs for all elements inside the palette to prevent any possible conflicts with the palette stored in the file. RfM will update the attachment data in the Maya scene.

plth NewFunction type nm templ
plth NewInstance type nm master
plth NewPalette id

These methods are used by the SlimParser when reading a palette file.

plth Read filename

Read the palette encapsulation in filename into the palette object.

plth Revert filename

Revert the palette to a checkpoint file saved in filename. The checkpointed file should be one created using Save with the -checkpoint option enabled, though this is not strictly enforced.

The palette stored in the checkpointed file should have a unique ID identical to that of the current palette. Reverting to a palette with a different unique ID may result in the loss of shader attachments.

plth Save filename ?arg arg ...?

Save the palette into the the external file filename. If the palette is currently internal, it will be converted into an external palette.

Optional arguments:

-uniqueify
New unique IDs will be generated for the palette and its appearances. So long as Slim is able to communicate with MTOR, attachments will be updated.
-checkpoint
In addition to saving to the specified filename, a checkpoint of the palette will be made. The checkpoint palette is a backup copy, saved in the same location and with the same filename plus a ".bk#" suffix, where ".bk0" is always the most recent. For example, a palette named foo.splt might have checkpoints: foo.splt.bk0, foo.splt.bk1, etc. The number of checkpointed palettes maintained by slim is determined by the CheckpointQueueSize preference, which can be adjusted in the Preferences Editor. The -checkpoint flag will have no effect if the queue size is set to zero, which is the default.
-keepRef
By default, when a save occurs, the palette file reference is updated. The -keepRef flag disables that behavior, for cases when the user wants to save a palette to disk but maintain the existing palette reference in slim.

plth SelectAppearances applist

Select the appearances specified by applist.

plth SetAccessMode mode

Set the write permissions for the palette.

plth SetSaveMode

Set the save mode for this palette. Note that this only used by the parser and will not perform any conversion for your palette. To change the save mode via scripting, use ChangeSaveMode.

plth SetGUIInfo geom vis
plth SetGraphVisible v
plth SetGraphVisible v
plth SetPaneSize p s
plth SetViewStyle v

These methods are used by the SlimParser when reading a palette file.

plth UndeleteEntries ?arg arg ...?

Undelete the appearances represented by any object handles listed. This method acts like the Undelete method in that it will only undelete appearances that are scheduled for deletion.

plth UniqueifyAll ?arg arg ...?

Generate new unique IDs for all appearances in the palette. If MTOR is connected, it will be updated with new unique IDs to maintain appearance connections. Unless the -keepnames flag is passed, each will receive a new name.

plth UpdateEditor

Update the Palette Editor for the palette. It is sometimes necessary to invoke this method after making changes to the palette via scripting. If no editor is associated with the palette, a value of 1 is returned. Otherwise a value of 0 is returned.


Appearance Objects

Appearance is a base class representing Functions (dynamic nodes that generate a shader) and Instances (which refer to an existing shader).

The following methods are defined for appearances:

apph Attach ?subtype : ""?

Attach the appearance to the current Maya selection. This is only meaningful if called when Slim is connected to MTOR.

The optional subtype argument is used to specify the subtype for volume shaders.

Because it interacts with MTOR, this method cannot be called via MEL using slimcmd. Instead, you can use the following MEL:

mtor control attach surface `slimcmd apph GetID`;

apph Detach ?subtype : ""?

Detach the appearance to the current Maya selection. This is only meaningful if called when Slim is connected to MTOR.

The optional subtype argument is used to specify the subtype for volume shaders.

Because it interacts with MTOR, this method cannot be called via MEL using slimcmd. Instead, you can use the following MEL:

mtor control detach surface `slimcmd apph GetID`;

apph Duplicate ?arg arg ...?

Create a duplicate of the appearance and store it in the same palette.

Optional arguments:

-destination dst
Put the duplicate appearance in the palette with object handle dst.
-update val
Specify whether to update the editor after duplicating. By default the editor will update.
apph Edit ?arg arg ...?

Edit the appearance in the Appearance Editor. If the appearance is already being edited, this will raise the Appearance Editor.

Optional arguments:

-newwindow
Rather than using an existing Appearance Editor window, create a new Appearance Editor for this appearance.
-slimfile
Edit this appearance as a text file using the user's preferred text editor.

apph EditMaster op

This method is deprecated.

apph Export filename

Encapsulate and export the appearance to a file specified by filename.

apph GetAttachmentType

Get the type of attachment (ensemble, surface, displacement, etc.) the appearance makes to geometry. Some appearance types like shadingmodel can be mapped to an attachment type like surface. These mappings are defined by the SlimAttachableMap preference set in slim.ini. For appearances that cannot be attached to geometry, the empty string is returned.

apph GetLighttype

For light shaders, get the type of light (e.g. distant).

apph GetMaster ?dosubst : 0?

Get the master of the appearance: the base string used to refer to the shader in the RIB file. Set the optional parameter dosubst to 1 to perform variable substitution on the returned result. If not specified, dosubst defaults to 0.

apph GetNamespace

Get the appearance's namespace. Usually this is the empty string, indicating the global namespace. The namespace is usually set when the enclosing palette is loaded and is useful when storing palettes within Maya scene files undergoing import or reference operations.

apph GetPreviewFrame
apph GetPreviewObjSize
apph GetPrimitive
apph GetPreviewShadingRate

These methods get the settings used for preview renders in the Appearance Editor.

apph GetProperties ?arg arg ...?

Get the list of an appearance's properties that match the search criteria, specified using one of the following flags. The criteria can use glob style notation, which means that you can use the standard wild card characters: *, ?, etc. If no arguments are provided, the result is equivalent to the request:

apph GetProperties -name * -access * -type * -class * -provider * -private

Optional filtering criteria:

-access pattern
Use this to limit return properties based on their access (input or output).
-class pattern
Use this to limit return properties based on their class. Class must be fully specified, e.g. ::Slim::Parameter.
-name pattern
Limit properties to only those with a name matching pattern.
-provider pattern
Limit properties to only those with a value provider matching pattern.
-type pattern
Limit properties to only those with a type (e.g. float, color, string) matching pattern.

Options:

-private
When limiting properties using any of the above tests, any parameters with provider primitive will by default be excluded. Use this switch to include them.
-first
By default, all properties matching the specified criteria will be returned. Use this option to return only the first property that matches the criteria. Because any subsequent properties are skipped, this option can sometimes improve performance when querying an appearance with a large number of properties.

apph GetPropertyTree

Get the root of the tree of properties for this appearance. All parameters, collections, and attributes in the appearance are descendents of this property. You can use this method along with the GetChildren method to descend through the property tree.

apph GetSubtype

Get the subtype of this appearance. Currently, this only applies to volume appearances, which can be defined to be of subtype atmosphere, interior, or exterior.

apph GetWorklist ?arg arg ...?

Get a list of actions that must be performed before rendering. This applies to nodes like ImageFile, which must sometimes convert an image to a texture before it is used.

apph NewCollection type nm ?front?
apph NewParameter type nm ?front?
apph NewRIBAttribute type nm ?front?
apph NewSlimAttribute type nm ?front?
apph NewTCLAttribute type nm ?front?
apph NewTORAttribute type nm ?front?

Though these methods are primarily used by the SlimParser, they can also be used to add parameters to a dynamic template. The method creates a property and returns a handle to it that you can then use to specify more information.

Example usage:

set newProp [$apph NewParameter float Kd]
$newProp SetLabel "Diffuse Component"
$newProp SetDescription "Amount of diffuse light"
$newProp SetDefaultValue 1
For a real example, see the source of the AddParam customui.

apph PickObjects ?modes ""?

Pick all objects to which this appearance is attached. With the -adapt flag, this script acts like the Pick Objects (Computed) command. That is, attachable shaders that use this appearance (including adaptors) will also be considered.

Because this method interacts with MTOR, it cannot be called from a slimcmd.

apph PreserveValues

Mark all properties in the appearance as set. This will protect the values from any changes to templates.

apph PreviewRender

Initiate a render of the preview swatch for this appearance.

apph Reload ?flags ""?

Reload the source of the appearance, whether it be a template, or a shader or slim file on disk.

For functions, the Reload method will track when the template file was loaded and when it was last changed. By default, it will only successfully reload the template, if the file on disk has changed since the palette was loaded. To force a template reload, use the -force flag.

apph RevertValues

Unset the values for all properties in the appearance editor. These properties will revert to their default value.

apph SetLighttype t

Set the type of light (e.g. distant) for this appearance. This is only applicable to light shaders.

apph SetMaster m

Set the master of the appearance: the base string used to refer to the shader in the RIB file.

apph SetNamepsace nm

Set the appearance's namespace. The namespace is usually set when the enclosing palette is loaded and is useful when storing palettes within Maya scene files undergoing import or reference operations.

apph SetSubtype

Set the subtype of this appearance. Currently, this only applies to volume appearances, which can be defined to be of subtype atmosphere, interior, or exterior.

apph UpdateEditor

Update the Appearance Editor for the appearance. This sometimes necessary when making changes to an appearance's properties. If no editor is associated with apph a value of 1 is returned. Otherwise a value of 0 is returned.


Function Objects

Functions are nodes created from a template, and are combined to create a shader. Function is a subclass of Appearance, so Functions support all of the Appearance methods listed above.

The following methods are defined for functions:

funch BuildShader ?arg arg ...?

Generate and compile the shader for this appearance. By default, Slim will check the dirty status of the appearance and only continue if it has changed since the shader was last generated. You can override this and force shader generation by using the -force flag.

funch CreateInstance ?arg arg ...?

Create a new Instance of this shader. By default, the Palette Editor will be updated. This behavior can be overridden by passing -update 0.

funch DeleteNetwork

Delete this function and any function in its network. Technically, these functions are only scheduled for deletion, and may be recovered with either Undelete or UndeleteNetwork.

funch DirtyMaster

Indicate that the shader for the function needs to be regenerated. For most changes to functions, Slim is able to detect dirtiness. This method allows one to force dirtiness for a situation that Slim does not handle. The layering customui, for example, makes use of this method when rearranging layers.

funch DuplicateNetwork ?arg arg ...?

Duplicate the entire network for this function and store it in the same palette.

Optional arguments:

-destination dst
Put the duplicate appearance in the palette with object handle dst.
-update val
Specify whether to update the editor after duplicating. By default the editor will update.

funch Flatten ?arg arg ...?

Create a new appearance by flattening an active function network into a single frozen instance. The new appearance will have a name based on the name of this appearance, and will be flattened according to the Instance Structure preference.

Optional arguments:

-name nm
Name the new appearance nm.
-file f
Write the shader to a filename specified by f.
-structure structure
Use the defined structure. Possible options are flat (all parameters in one list), grouped (parameters grouped by appearance), and hierarchical (parameters arranged in a hierarchy approximating the graph).
-update val
Specify whether to update the editor after flattening. By default the editor will update.
funch GetConnectedAttachables ?arg arg ...?

Get the list of downstream attachable appearances that -- directly or indirectly -- connect to this appearance. By default, the returned list will consist of object handles. To get a list of unique IDs instead, pass -return id.

funch GetConnectionClients

Return the list of properties that connect to this function.

funch GetConnectedFunctions

Get the list of functions to which properties have connected. Even if multiple properties connect to the same function. This list is guaranteed not to have any redundant listings, and is therefore useful when writing recursive procedures.

funch GetInstances

Get a list of instances that have been created from this function. Note that this will only return instances that exist in the same palette as the function.

funch GetSLSource ?language : rsl?

Get the shading language source for this function.

funch GetSLSourceType ?language : rsl?

Determine the kind of shading language generator used by this function (e.g. StaticFunction, DynamicFunction, GenerativeFunction, etc.)

funch GetObjectID

Get the object handle for the template that begat this function.

funch GetTemplateID

Get the template identifier (e.g. pixar,SurfacePoint#0) for this function.

funch IsDownRev

Determine whether the template used by this function is obsolete. This is often used in conjunction with UpgradeTemplate

funch MasterIsDirty

Determine whether the shader for this function needs to be regenerated and recompiled before it is used for a render. Slim will automatically dirty a master when, for example, changes are made to internal parameters. The master can also be dirtied via the DirtyMaster method.

funch SetHasInstances
funch SetModificationTime
funch SetState s
funch SetTemplateHints fileref hints

These methods are used by the SlimParser when reading a palette file.

funch UndeleteNetwork

Undo the execution of Delete Network.

funch UpdateInstances

Update all instances of this function. This command regenerates the shader (if necessary), and then reloads any instances of this function that are stored in the same palette.

funch UpgradeTemplate

Upgrade the template used by this function to its latest version. You can determine whether the current template is obsolete by using the IsDownRev method.


Template Objects

The Template class is a subclass of Function. As mentioned above, you can access the Template object for a function via the GetTemplate method. For your convenience, however, this is usually not necessary. Most methods that access template information like GetSLSource can be called straight from the function.

Therefore, the methods specific to the Template class are not especially useful for scripting, but are listed below:

tmplth AddSLDirective language type dir
tmplth SetSLSource language type src
tmplth SetAdaptor src

These methods are all used by the SlimParser when reading template and palette descriptions.


Instance Objects

Instance objects represent appearances in shader that work with an existing shader. Instance objects are used to represent proper Instances created from functions, as well as any appearances created by importing a shader. Instances do not have templates. Their source is a shader on disk, and perhaps a function in the palette. As such, the methods specific to instances are fairly limited:

insth GetProgenitor

Get the file or function which begat this instance. The file is returned for instances created from imported shaders. For proper Instances, the progenitor is the unique ID for the original function.

insth GetProgenitorFunction

Get the object handle for the original function. If the instance was created from an imported shader, this method returns the empty string.

insth SetProgenitor

Set the progenitor for this instance.


Property Objects

Property is a base class representing the Parameters, Collections, and Attributes inside of an appearance. You will mainly deal with subclasses of Property. The only true Property objects are the roots of the Property Tree for each appearance. This root, not visible in the user interface, is accessed using the GetPropertyTree method for appearances.

The following methods are common to all subclasses of Property:

proph BuildDefaultWidget canvas win recommendedwidth height ?arg arg ...?

Create the widget for this property as it is seen in the Appearance Editor. This is most often used from within a CustomUI to build a Value Editor for a property. Arguments detail the specific canvas and window information for the widget, along with suggested width and height. By default, the Property Menu will appear for any property without a default connection. You can override this behavior using the -menu switch. See some of the factory customui scripts for example usage.

proph BuildIcon win

Build the icon for this property. Like BuildDefaultWidget, this method is most often used from within a CustomUI.

proph CreateConnection templateid

Create an instance of the specified template and connect it to this property.

proph GetAccess

Determine access -- whether it as input or output -- for this property.

proph GetAppearance

Get the object handle for the appearance that uses this property.

proph GetCommandKey

Useful when journaling a command, this method accesses the proper command key for the property. This is useful for properties inside of appearances that may be inlined.

proph GetConnectedFunction

Get the object handle for the function to which this property connects. This method will only return the connected function if it is being used. That is, if the property's ValueProvider is not set to connection, it will return the empty string.

proph GetConnection

Return the unique ID for the function to which this property connects. Unlike GetConnectedFunction, this method will return an ID as long as it exists. The ValueProvider is not consulted. For this reason, and because the unique ID is returned, rather than the (more useful) object handle, GetConnectedFunction is the preferred method to use when scripting.

proph GetConnectionStyle

Get the connection style for the property. For inline connections, this will return "inline". Otherwise, this will return an empty string.

proph GetDetail

Get the detail for this property. Possible values for detail:

uniform
Property cannot be connected to a function.
varying
Property can be connected to a function.
mustvary
Property must be connected to a function.

proph GetLabel

Get the label for the object. The label is primarily used for interface, and can therefore contain special characters (including spaces).

proph GetLabelRef

Get a reference to the variable which stores the label. You can use the result of this as the -textvariable when creating Tk widgets in a CustomUI.

proph GetName

The name will often be used within RIB or shading language and must therefore resemble a variable.

proph GetMsgHandler msg

Get the property's msghandler defined for the specified message.

proph GetMsgHandlers

Get the entire array of msghandlers for this property.

proph GetSubtype

Get subtype for this property. Subtype is most often used to define a specific editor for a property. Properties representing a texture name, for example, are of type string, but of subtype texture.

proph GetUserData key

User data is additionalinformation associated with a property. It is stored as a series of name-value pairs. Other than that, the contents are completely arbitrary. You may find it to be a valuable way to store extra information for your scripts, or to communicate information from templates to CustomUIs. UserData is not visible in the Slim interface.

GetUserData accesses the user data stored with the specified key. If no user data is defined for this key, the empty string is returned.

proph GetUserDataArray

Get the entire array of user data. This can be useful when copying user data from one object to another.

proph GetValueProvider

Get the source of a property's value. Valid ValueProviders depend on the specific subclass of Property. This is the complete list of possible values:

constant
Constant value. For parameters, this indicates that the value is stored within the code of the shader. This option appears as Internal in the user interface.
variable
Value is defined by a variable. For parameters, this indicates that the value is a parameter of the shader and may be overridden by the RIB file. This option appears as External in the user interface. For (RIB) Attributes, a value of variable indicates that the attribute is disabled.
connection
Value is provided by a connected function. This option is only valid for non-uniform Properties and Connections.
expression
Value is provided by a TCL expression. This option appears as TCL Expression in the user interface.
primitive
Value is provided by a global parameter of the shader, like a PrimVar. When the property is an output, the primitive value provider is used for arbitrary output variables.

proph GetValueProviders

Get the range of valid value providers for the property. An empty list (the default) signifies no change from the default behavior.

proph SetAccess a

Set whether this property is an input or output.

proph SetConnection id ?arg arg ...?

Connect the property to the function with the specified unique ID. When using this method, you must also make sure that the property's ValueProvider is set to connection. To disconnect the property from a function, pass the empty string as id. The optional args list is used by Slim for more customized undo behavior.

proph SetDetail d ?default : ""? ?style : ""?

Set the detail for the property, as defined in GetDetail. For properties with detail mustvary, the optional default parameter can be used to specify the default template to make a connection to. For an inline connection, pass inline for style.

proph SetDrawMode m

Set the Draw Mode for a property. The default Draw Mode is all. When a Collection has a Draw Mode of children, it will not be drawn, but its children will.

proph SetLabel label

Set the entry's label to the specified string.

proph SetMsgHandler msg cmd

Set the property's msghandler for msg to be cmd.

proph SetState s

Set the state of the property. Most often, this is used with Collections, which can either be open or closed. Properties without any children have a barren state.

proph SetUserData key value

Set the user data for key to value.

proph SetUserDataArray data

Set the entire array of user data. This can be useful when copying user data from one object to another.

proph SetValueProvider p

Set the ValueProvider for the property to p. Valid options for ValueProvider are discussed in the GetValueProvider method.

proph SetValueProviderRange range

Set the range of valid ValueProviders to the provided list, e.g. {constant connection}. You can use this to, for example, prevent a property from being marked external. Valid entries for the range are discussed in the GetValueProvider method.


Collection Objects

Collection objects are used to group Parameters and Attributes. Since they do not have a value, there is but a small number of methods specific to Collection objects:

collh GetCustomUIName
collh GetCustomUIVendor
collh GetCustomUIModes

CustomUIs are defined on Collection properties. These methods access the CustomUI information for a collection.

collh NewCollection type nm
collh NewParameter type nm
collh NewRIBAttribute type nm
collh NewSlimAttribute type nm
collh NewTCLAttribute type nm
collh NewTORAttribute type nm

Like their counterpart methods defined for the Appearance class, these methods are used both for parsing a palette file, and for creating new properties in a dynamic template. When using these methods, any properties will be created as children of the collection.

collh SetCustomUI vendor nm ?modes : ""?

Set the customui information for the collection.


AtomicProperty Objects

The AtomicProperty base class represents all properties which have a value. Because of this, the majority of the methods listed below relate to the property's value. Parameter and all of the *Attribute classes are all subclasses of AtomicProperty, and from a scripting point of view, are relatively similar.

proph GetArrayIndex

If the property is an element of an array, get its index. If the property is not an element of an array, this method will return -1.

proph GetDefaultValue

Get the default value for this property.

proph GetExpression

Get the TCL expression that is set for this property. Note that this may return an expression, even if the property's ValueProvider is not set to expression.

proph GetValue

Get the current value of the property.

proph GetMax
proph GetMin
proph GetPrecision
proph GetRange
Access the range information for this property. As you can see in a palette or template file, the range is stored as a pair consisting of {min max} or as a triple consisting of {min max precision}. GetRange accesses this list directly. GetMin and GetMax are provided as convenience functions. The GetPrecision method accesses the third element of range, if present. If it is not present, this method returns the DefaultSliderPrecision preference (defined in slim.ini with a default of 0.01).

proph GetTCLContext

Get the context in which a TCL expression will be evaluated. By default, TCL expressions are evaluated in the mtor context, allowing them to make use of information such as the object name, frame, etc. TCL expressions that wish to evaluate before rib generation and/or make use of the Slim scripting environment will be evaluated in the slim context.

proph GetUserRange

Get the user range for the property, which is set when the user enters a value beyond the template-specified range (including precision).

proph RevertValue

Revert the value for this property to its default.

proph SetArrayIndex i

Set the index for a property that is an element of an array. An index of -1 indicates that this property is not an element in an array.

proph SetDefaultValue v

Set the default value for this property to be v.

proph SetExpression expr

Set the TCL expression for this property to be the specified string. To use this effectively, you will want to make sure that the property's ValueProvider is set to expression.

proph SetRange r

Set range to r, where r is a list containing {min max} or {min max precision}.

proph SetTCLContext c

Set the context in which a TCL expression is evaluated.

proph SetUserRange r

Set the user-overridden range for a property. This is mainly used by the SlimParser.

proph SetValue v ?dynamic : 0?

Set the current value of the property. The dynamic flag is used to indicate that the value is being set interactively. This will, among other things, keep the value from making its way onto the Undo stack. A slider, for example, would have dynamic set to 1 when the user is dragging the slider back and forth and set to 0 when the user releases the slider.

proph ValidateTCLExpression str

Evaluate the expression specified by str. Results of the validation will be sent to the Message Log. If the evaluation generates an error, it will be returned. A successful evaluation will return an empty string.

proph ValidateTCLString

Validate a property that has a TCL expression for its value. This is useful for properties that, for example, contain a txmake expression.


Parameter Objects

What sets the Parameter class apart from other subclasses is its existence inside of the shader. It is for this reason that the methods specific to Parameter are oriented toward its presencing in shading language.

parmh GetNameSL uniqueify

Get the name of the parameter as it exists in shading language. The uniqueify parameter specifies whether to guarantee the the parameter has a unique name by prepending it with the name of the appearance. This is necessary for non root-level Functions.

parmh GetValueSL

Get the parameter's value in a format suitable for shading language. For example:

% $parmh GetType
color
% $parmh GetValue
{1 0 0}
% $parmh GetValueSL
color(1,0,0)


Attribute Objects

Attribute objects represent RIB attributes associated with your shader. This is the only method unique to the Attribute class:

attrh IsEnabled

It is briefly mentioned in the listing for GetValueProvider that for an Attribute, a value provider of variable indicates that the Attribute is disabled. This is admittedly not very intuitive, so the IsEnabled method is provided as a convenience.


SlimAttribute, TCLAttribute, and TORAttribute Objects

Though internally these classes differ from the AtomicProperty base class, from a scripting perspective they are the same. There are no methods specific to these classes.


Class Index

This index lists all of the classes of objects with which you will interact. These classes all derive from the TreeNode class, as demonstrated by the Class Hierarchy diagram.

This index lists the common name (how we refer to the class in documentation), the internal name (how the class is used within Slim internals), and the scripting name (how the class is used within the Slim scripting environment). Base classes like TreeNode do not have a scripting representation.

Common Name Internal Name Scripting Name
TreeNode ::Slim::TreeNode  
PaletteEntry ::Slim::PaletteEntry  
Palette ::Slim::Palette ::Slim::AlterEgo::plt
Appearance ::Slim::Appearance  
Function ::Slim::Function ::Slim::AlterEgo::func
Template ::Slim::Template ::Slim::AlterEgo::tmplt
Instance ::Slim::Instance ::Slim::AlterEgo::inst
Property ::Slim::Property ::Slim::AlterEgo::prop
Collection ::Slim::Collection ::Slim::AlterEgo::coll
AtomicProperty ::Slim::AtomicProperty  
Parameter ::Slim::Parameter ::Slim::AlterEgo::parm
Attribute ::Slim::Attribute ::Slim::AlterEgo::attr
SlimAttribute ::Slim::SlimAttribute ::Slim::AlterEgo::slimattr
TCLAttribute ::Slim::TCLAttribute ::Slim::AlterEgo::tclattr
TORAttribute ::Slim::TORAttribute ::Slim::AlterEgo::torattr


Procedures

The following procedures are defined in the Slim scripting environment:

GetAppName

This procedure returns the name of the current application. (Hint: it's "slim".)

GetEnv var ?default?

Get the value of the specified environment variable. You can use the optional default argument to specify a value to return if the environment variable is not defined.

GetHostName

Get the name of the host machine that is running Slim.

GetPlatform

Get a name-value list of platform information, suitable for setting as an array, e.g.:

% array set platform [GetPlatform]
% set platform(os)
Linux
tcl veterans will recognize this as the tcl_platform global.

GetPref var ?default?

Get the value of the specified preference. You can use the optional default argument to specify a value to return if the preference is not set. Note that querying an unset preference will have the side effect of setting that preference to the specified default.

GetUserName

Get the name of the user that is running Slim.

GetVersion variation:numeric

Get the current version of the application. The optional variation parameter dictates how much version information to print. By default, the numeric variation is used:

numeric
The simplest form of the version string, e.g. 6.5.
RAT
Include the build suffix e.g. 6.5b3.
short
Return the RAT version plus build date.
long
The most verbose version information, including build date and copyright information. This is the string returned when running slim -version.

::RAT::GetUniqueID

Generate a new unique identifier.

::RAT::LogMsg level msg

Send the message msg to the Slim Message Log. Valid values for level are: COPIOUS, INFO, NOTICE, WARNING, ERROR, SEVERE, in order of rising priority.

::RAT::PickFile ?arg arg ...?

Invoke the File Picker. Arguments to this command specify how to configure the File Picker and the command to execute when the user has selected a file:

-cmd command
The command to execute when the user has a selected a file. The pattern %v is substituted with the selected pathname.
-filetypes types
Types of files to show in the File Picker. Sample types include All, Image, Texture, etc. A complete list of definitions of types and how they map to file extensions can be found in RAT.ini
-initialfile path
The initial path to show in the File Picker.
-mode mode
The File Picker's mode of operation. Possible modes include openone (the default), openmulti, opendir, and save.
-title title
Title for the file picker window. By default, this is "Open File..." when in open mode; "Save File..." when in save mode.

SetPref var value

Set the specified preference to the specifed value.

These procedures are defined via the Custom Commands that ship with Slim. You may find them useful to use in your own scripts.

::Slim::ResourceReport ?arg arg ...?

Enumerate external resource usage and point out unresolved resources. The report is printed to the Slim Message Log. By default the report is verbose. The only valid arg is -short, which trims the report down to only workspace information and warnings about unresolved resources. Source can be found in the file customcmd.slim.

::Slim::SearchReplace pattern replace ?arg arg ...?

Searches for pattern in string entry fields of appearances and replaces with replace. Information about each match replacement that occurs is printed to Slim's Message Log. Note that expression fields (ie. fields with the orange tcl button to their right) are not included in this search/replace. You may also provide one or more of the following optional arguments:

-scope objh
Restrict searches to the fields in the specified object handle, which may point to an appearance or to a palette. The default scope of all applies the search to all appearances in all palettes.
-filter flt
Restrict searches using the specified filter:
all
Apply to all string entry fields (the default).
appnames
Only apply to names of appearances.
masters
Only apply to the master fields of appearances.
maps
Only apply to properties that contain a file reference. This does not include entries for an appearance's name or master.
nomaps
Apply to everything except properties that contain a file reference.


Prev | Next


 

 

Pixar Animation Studios
Copyright© Pixar. All rights reserved.
Pixar® and RenderMan® are registered trademarks of Pixar.
All other trademarks are the properties of their respective holders.