You can use the Autodesk Softimage SDK object model to package, install and uninstall Softimage add-ons. These features are available either through a simple script or through a compiled library file:
In addition there are several scripting commands which can help you debug v1.0 plug-ins. These simulate some of the tasks you can perform in the Plug-in Manager:
The easiest way to package an add-on is to use the PackageAddon command, which packages an entire add-on directory (for example, \myserver\myworkgroup\Addons\MyParticleTool).
You can also create an Addon object and add items one at a time. The basic workflow of using packaging an add-on this way through scripting is very similar to packaging the add-on through the Package Add-on dialog:
Get a pointer to the object using XSIApplication.CreateAddon:
set oAddOn = Application.CreateAddon
Add the components of your customization as required. You can add the same types of items as you can through the UI by using the Addon.AddItem:
oAddOn.AddItem siToolbarAddonItemType, "MyToolbar" oAddOn.AddItem siScriptCmdAddonItemType, "myCmd"
sPath = InstallationPath( siUserPath ) oAddOn.AddItem siOtherAddonItemType, sPath & "\Data\MyHelpPage.html"
You can use either the Addon.AddItem method with siOtherAddonItemType or just use the Addon.AddOtherItem method. The difference is that AddOtherItem allows you to specify a destination directory, whereas AddItem does not. The equivalent to the last line above is:
oAddOn.AddOtherItem sPath & _ "\Data\MyHelpPage.html", "Help"
If you want to specify a default installation path for your add-on, use the Addon.DefaultInstallationPath property:
oAddOn.DefaultInstallationPath = siFactoryPath oAddOn.SubDirectory = "ToxicTools"
When you are finished adding items, use the Addon.Save method to save the new .xsiaddon file:
oAddOn.Save sPath & "\addons\myAddOn.xsiaddon"
You can use the XSIApplication.InstallAddon method which takes the full path of the .xsiaddon file and where you want the add-on to be installed (the Addons\InstalledAddons path—see siInstallationPath):
' Install myAddon.xsiaddon in the workgroup sPath = InstallationPath( siUserPath ) InstallAddon "\myAddon.xsiaddon", siWorkgroupAddonPath
Since the XSIApplication object is an intrinsic object that represents the running instance of Softimage, you do not need to specify the Application object explicitly inside Softimage.
You can use the UnInstallAddon (XSIApplication) method which takes the full installation path (the Addons\InstalledAddons path) of the .xsiaddon file:
' Uninstall the add-on by name sPath = InstallationPath( siWorkgroupAddonPath ) UninstallAddon sPath & "\myAddon.xsiaddon"
You can use the UnloadAddonLib command to unload a single specified v1.0 plug-in library from memory. This allows you to easily fix and recompile your libraries in your development environment and then load them in again with the ReloadAddonLib command.
These commands both take the full path of the library file as the only argument but return no value.
You can use the UnloadAllAddonLibs command to unload all currently loaded v1.0 plug-in libraries from memory. This allows you to easily fix and recompile your libraries in your development environment and then load them in again with the ReloadAllAddonLibs command.
You can use the UnloadAllCOMLibs command to explicitly free unused ActiveX libraries.
This command takes no arguments and does not return a value.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License