Running Custom Commands

 
 
 

You can run a custom command in any of the following ways:

When you run a custom command, the command gets logged to the history, together with any parameter values.

If the command contains only actions that can be undone (for example, if it does not contain commands like DeleteAll), then you can undo the result of your custom command by choosing Edit Undo from the main menu.

NoteTo add custom commands to the built-in menus, see Standard and Contextual Menus [SDK Guide].

Running Commands from Custom Toolbars

You can add custom commands to custom toolbars in the same way as any native command — see Adding Commands to Toolbars. In the Customize Toolbar window, set Command Categories to Custom to make it easier to find your custom commands.

Running Commands from Keys

You can map a custom command to a key on your keyboard in the same way as any native command. The complete procedure is described in Modifying Key Assignments. In the Keyboard Mapping window, select Custom Script Commands from the Group list to make it easier to find your custom commands.

Running Commands Automatically

You can run custom commands or any native Softimage command automatically in either of the following ways:

  • When you change the selection in a 3D view.

  • Whenever you change frames.

  • You can also bind scripts and commands to events so that they are triggered automatically in response to specific actions and states. For more information, see Custom Events [SDK Guide].

To run a script file automatically, you must first create a custom command based on the script.

Running Scripts When the Selection Changes in a 3D View

  1. Choose File Preferences from the main menu.

    The Preferences window opens.

  2. Expand the Tools folder and click Selection.

  3. Enter the command name and any parameters in the Selection Change Command box. For example, in VBScript syntax:

    	LogMessage GetValue("SelectionList")

    This setting is stored in your preferences and used with all scenes.

NoteThe Selection Change Command is run only when you select something in a 3D view. It is not run when selecting elements in other ways, such as using the explorer or schematic views.

Running Scripts When the Frame Changes

You can select a script or native Softimage command to run automatically after the current frame is changed and the scene is updated. This lets you use scripts to simulate "persistent" effects.

  1. Choose Playback Playback Options from the Playback panel below the timeline.

    The Play Control property editor opens.

  2. Click the Update tab. In the On-Frame-Change Script Command box, enter the command name and any parameters. This setting is stored with the scene.

ImportantThe On-Frame-Change Script Command setting is saved with the scene. If you set it to a custom command, make sure the custom command is available on all systems used to open the scene.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License