Softimage SDK Programmer's Guide > Customizing Softimage using the SDK > Custom Commands >

# Setting Command Capabilities

By default, custom commands can be:

- Assigned a keyboard shortcut.

- Used in batch mode with xsibatch or xsi -script.

- Logged to the command history.

These "capabilities" can be disabled in the Init callback:

    function MyCommand_Init( ctxt )
    {
    	var oCmd;
    	oCmd = ctxt.Source;

    	// ...

    	// Disable keyboard mapping for this command
    	oCmd.SetFlag(siSupportsKeyAssignment,false);		// true by default

    	// Command cannot be used with xsibatch or xsi -script
    	oCmd.SetFlag(siCannotBeUsedInBatch,true);			// false by default

    	// Disable logging
    	oCmd.SetFlag(siNoLogging,true);		// false by default

    	// ...
    	return true;
    }

The SetFlag or SetFlag method is used to set the "capability flags" that control the behavior of the command:

- siSupportsKeyAssignment

  Specifies whether a keyboard shortcut can be assigned to the command in the Keyboard Mapping dialog box. Set to false if the command is a low-level helper function that you don't want to expose for general use.

- siCannotBeUsedInBatch

  Specifies whether the command can be used in scripts run from the command line using xsibatch or xsi -script. For example, a command that requires user input cannot be used in batch mode.

- siNoLogging

  Specifies whether the command is logged to the command history. Disabling logging can improve performance. For example, if the custom command is called frequently by other scripts, or if the command takes a large collection of objects as an argument, disabling logging will speed up the command.