Walkthrough: The Plug-in Manager

This walkthrough shows how to use the Plug-in Manager to create plug-ins in a workgroup. Steps include creating a new workgroup, creating a custom command, creating a toolbar, and creating an Add-on directory.

Create a workgroup

1. In the Plug-in Manager, click the Workgroup tab, and then choose File > Create.

2.

3. In the Create Workgroup dialog box

- In the Workgroup Folder Name box, type a name for the workgroup.

- Beside the Location of Workgroup box, click and locate the folder that will contain the workgroup.

- Click OK. Softimage creates a folder structure for your workgroup that looks like this:

Create a custom command

1. In the Plug-in Manager, click the Tree tab.

2. Expand your workgroup, right-click the Plug-ins folder and choose New > Command.

3. In the Command Wizard, click Generate Code to generate the custom command.

The plug-in and the custom command appear in the Plug-in Tree under the workgroup Plug-ins folder:

The generated code is put in the Application\Plugins folder of the workgroup.

If you chose a scripting language, the generated plug-in is automatically loaded and executed. Then, no matter what language you chose, the generated code is opened in a script editor.

4. To manage the plug-in (for example, to unload it, remove it from the cache, or delete it), right-click the plug-in:

Note that if you edit a plug-in in the script editor, Softimage automatically reloads (updates) the plug-in when you save your changes. If you use an external editor (for example, to edit and recompile a C++ plug-in), you can use the Update command in the context menu to reload the plug-in.

If the plug-in had a help file, the context menu would include a Help command.

5. To run the command, expand the plug-in, right-click the command and choose Invoke.

Of course, you can easily run a command from the script editor. For custom properties, however, the Plug-in Tree provides a quick way to create an instance of the property on the scene root: just right-click the property and choose Create Property.

Create a Toolbar

1. Under your workgroup, right-click the Toolbars folder and choose New > Toolbar.

2. In the Toolbar Wizard, type a name for the toolbar and then click OK.

The wizard creates a new toolbar and opens it, and loads the toolbar .xsitb file into a script editor. The new toolbar is also added to the View > Toolbars menu in the Softimage menu bar.

Note that the toolbar already includes a button for the command you created. If you create more commands in the workgroup, you can add them to the toolbar by dragging them from the Plug-in Tree to the toolbar.

Notes

• To edit the .xsitb file, expand the Toolbars folder in the Plug-in Tree, right-click the file and choose Edit.

• To open a toolbar, double-click the .xsitb file in the Plug-in Tree.

Create an Add-on Directory

As you create more plug-ins in a workgroup, you may find your Application\Plugins folder getting rather cluttered. If you want to separate the source code for different plug-ins, you can create an Add-on directory for each plug-in. An Add-on directory is located in the Addons folder of a workgroup. Each Add-on directory has its own Application and Data folders.

Using Add-on directories also simplifies the process of packaging an add-on for distribution.

1. In the Plug-in Tree, right-click your workgroup and choose New > Add- Directory.

2. In the Create Add-on Directory dialog box, type a name for the add-on. This name must be a valid name for a folder.

In the Plug-in Tree, a new Addon folder node appears under the workgroup.

3. Expand the Addon folder, and then drag the plug-in from the workgroup to the Plugins folder in the Add-on.

This moves the plug-in from the workgroup Application\Plugins folder to the Application\Plugins folder in the Add-on directory.

4. If you want, you can move the toolbar the same way: drag the .xsitb file from the workgroup to the Toolbars folder in the Add-on.

Package an Add-on for Distribution

If you need to distribute an add-on to people who cannot access your workgroup, you can easily package everything in an Add-on directory into an .xsiaddon file.

1. In the Plug-in Tree, right-click an Add-on and choose Package Add-on.

2. In the Package Add-on Options dialog box, set the packaging options:

- Source is the location of the Add-on directory. The .xsiaddon file will contain everything under the source folder.

- Destination is where the .xsiaddon file will be created.

- Directories to Exclude is a semi-colon (;) separated list of folders that you do not want to include in the .xsiaddon file.

Autodesk Softimage v7.5