BWPluginAPI
This is the main API file, your plugin should inlcude only this file.\n All the other relevant API files will be included automatically by this file.\n This file contains all the general functionality for plugin (like initialize, menu, events etc...)
BwApiPluginInit
Initializer function.
Python
BwApi.PluginInit()
C++
BwApiPluginInit();
C#
BwApi.PluginInit();
Returns: 1 for successful initialization or 0 if the initialization failed C++:
---
BwApiVersion
Get the API version used by the plugin and the latest API version supported by the host application.
Python
BwApi.Version()
C++
BwApiVersion(pluginApiVer, latestApiVer);
C#
BwApi.Version();
Parameters
Param | Variable | Description |
Out | pluginApiVer | API version used by the plugin. |
Out | latestApiVer | Latest API version supported by the host application. |
Returns: Error/success code (see errorCodes enum above).
---
BwApiIdentifierGet
Get the current plugin identifier (previouly set by BwApiIdentifierSet).
Python
BwApi.IdentifierGet()
C++
BwApiIdentifierGet(identifier);
C#
BwApi.IdentifierGet();
Parameters
Param | Variable | Description |
Out | identifier | Unique plugin identifier. |
---
BwApiApplicationExit
Exit Browzwear application with status code.
Python
BwApi.ApplicationExit()
C++
BwApiApplicationExit();
C#
BwApi.ApplicationExit();
Note: If there is an open garment a meesage box will be prompt to user asking him to save the garment before exit. The user may cancel this operation.
---
BwApiHostApplicationGet
Get the application information (For more information view at host_application.json).
Python
BwApi.HostApplicationGet()
C++
BwApiHostApplicationGet(hostApplication);
C#
BwApi.HostApplicationGet();
Parameters
Param | Variable | Description |
Out | hostApplication | Information about the application. |
---
BwApiCallbackBase
This is the function type use for all callback.
Python
BwApi.CallbackBase(garmentId, callBackPtr, callBackId, dataString)
C++
BwApiCallbackBase(garmentId, callBackPtr, callBackId, dataString);
C#
BwApi.CallbackBase(garmentId, callBackPtr, callBackId, dataString);
Parameters
Param | Variable | Description |
In | garmentId | Is the garment, if applicable to the action. Or empty string in other cases. |
In | callBackPtr | Internal use only, pass NULL. |
In | callBackId | Integer value that later on will be sent to the callback (callbackId parameter). |
In | dataString | Data file name for file operation, and other data depending of callback type. |
Returns: Plugin should return 1 on success operation and 0 upon failure.
---
BwApiPluginNameSet
Set the plugin's name.
Python
BwApi.PluginNameSet(name)
C++
BwApiPluginNameSet(name);
C#
BwApi.PluginNameSet(name);
Parameters
Param | Variable | Description |
In | name | Plugin name. |
---
BwApiLanguageGet
Get the current interfcae language.
Python
BwApi.LanguageGet()
C++
BwApiLanguageGet(languageCode);
C#
BwApi.LanguageGet();
Parameters
Param | Variable | Description |
Out | languageCode | Short language code (available values: en, de, el, es-es, hu, it, pt-pt, ru, th, tr, zh-cn, zh-tw). https://msdn.microsoft.com/en-us/library/ms533052(v=vs.85).aspx |
Returns: Error/success code (see errorCodes enum above).
---
BwApiMenuFunctionAdd
Add plugin menu item.
Python
BwApi.MenuFunctionAdd(menuName, callbackObj, callBackID)
C++
BwApiMenuFunctionAdd(menuName, callbackObj, callBackID);
C#
BwApi.MenuFunctionAdd(menuName, callbackObj, callBackID);
Parameters
Param | Variable | Description |
In | menuName | Menu item name, this item will be displayed on the plugin's menu. |
In | callbackObj | Class derived from BwApiCallbackBase. |
In | callBackID | Integer value that later on will be sent to the callback (callbackId parameter). |
Returns: Error/success code (see errorCodes enum above). C++:
Note: CallBackID value 9999 is saved for internal use only.
---
BwApiMenuFunctionReloadAdd
Add 'Reload Plugin' menu item to the end of the plugin's sub menu.
Python
BwApi.MenuFunctionReloadAdd()
C++
BwApiMenuFunctionReloadAdd();
C#
BwApi.MenuFunctionReloadAdd();
Returns: Error/success code (see errorCodes enum above).
Note: This call will unload the plugin, load it back and then call to the initialize function again.
---
BwApiFileMethodRegister
Register plugin to file open / import / export dialog.
Python
BwApi.FileMethodRegister(callbackObj, callBackID, text, fileExtenions, fileOperation)
C++
BwApiFileMethodRegister(callbackObj, callBackID, text, fileExtenions, fileOperation, registeredFuncId);
C#
BwApi.FileMethodRegister(callbackObj, callBackID, text, fileExtenions, fileOperation);
Parameters
Param | Variable | Description |
In | callbackObj | Class derived from BwApiCallbackBase. |
In | callBackID | Integer value that later on will be sent to the callback (callbackId parameter). |
In | text | The text to display for the file open / import / export (file description). |
In | fileExtenions | The file extension supported. |
In | fileOperation | The file operation to register to (see BwApiFileOperation enum). |
Out | registeredFuncId | Auto generated ID for this registration, if you wish to unregister call UnregisterFileMethod with this value. C++: |
---
BwApiFileMethodUnregister
Unregister plugin from file open / import / export dialog.
Python
BwApi.FileMethodUnregister(registeredFuncId)
C++
BwApiFileMethodUnregister(registeredFuncId);
C#
BwApi.FileMethodUnregister(registeredFuncId);
Parameters
Param | Variable | Description |
In | registeredFuncId | Auto generated ID for this registration, if you wish to unregister call UnregisterFileMethod with this value. |
---
BwApiEventRegister
Register plugin for specific event type.
Python
BwApi.EventRegister(callbackObj, callBackID, eventType)
C++
BwApiEventRegister(callbackObj, callBackID, eventType, registeredFuncId);
C#
BwApi.EventRegister(callbackObj, callBackID, eventType);
Parameters
Param | Variable | Description |
In | callbackObj | Class derived from BwApi.CallbackBase. |
In | callBackID | Integer value that later on will be sent to the callback (callbackId parameter). |
In | eventType | The event type to register to (see BwApiEventType enum). |
Out | registeredFuncId | Auto generated ID for this registration, you should call to BwApiEventUnregister with this value. C++: |
---
BwApiEventUnregister
Unregister from plugin event.
Python
BwApi.EventUnregister(callbackObj, callBackID)
C++
BwApiEventUnregister(callbackObj, callBackID, registeredFuncId);
C#
BwApi.EventUnregister(callbackObj, callBackID);
Parameters
Param | Variable | Description |
In | callbackObj | Class derived from BwApi.CallbackBase. |
In | callBackID | Integer value that later on will be sent to the callback (callbackId parameter). |
Out | registeredFuncId | The function ID received from BwApiEventRegister. |
---
BwApiUpdateSessionFunctionSet
DEPPRECATED please use BwApiUpdateSessionFunctionSet_v2
Python
BwApi.UpdateSessionFunctionSet()
C++
BwApiUpdateSessionFunctionSet();
C#
BwApi.UpdateSessionFunctionSet();
---
BwApiUpdateSessionFunctionRequest
DEPPRECATED please use BwApiUpdateSessionFunctionRequest_v2
Python
BwApi.UpdateSessionFunctionRequest()
C++
BwApiUpdateSessionFunctionRequest();
C#
BwApi.UpdateSessionFunctionRequest();
---
BwApiUpdateSessionFunctionSet_v2
Python
BwApi.UpdateSessionFunctionSet_v2()
C++
BwApiUpdateSessionFunctionSet_v2();
C#
BwApi.UpdateSessionFunctionSet_v2();
---
BwApiUpdateSessionFunctionSet_v2
Set function to call for update session from the currect thread must not have pending request when calling this function.
Python
BwApi.UpdateSessionFunctionSet_v2(callbackObj)
C++
BwApiUpdateSessionFunctionSet_v2(callbackObj);
C#
BwApi.UpdateSessionFunctionSet_v2(callbackObj);
Parameters
Param | Variable | Description |
In | callbackObj | Class derived from BwApiCallbackBase. |
Returns: Error/success code (see errorCodes enum above). C++:
Note: You must call to BwApiIdentifierSet before calling to this function!
---
BwApiUpdateSessionFunctionRequest_v2
Request update session to be called in the currect context, this is the only function that can be invoked by the plugin from any thread. Must not have pending request when calling this function, for further information look at BwApiUpdateSessionFunctionSet.
Python
BwApi.UpdateSessionFunctionRequest_v2(identifier, callBackID, dataString)
C++
BwApiUpdateSessionFunctionRequest_v2(identifier, callBackID, dataString);
C#
BwApi.UpdateSessionFunctionRequest_v2(identifier, callBackID, dataString);
Parameters
Param | Variable | Description |
In | identifier | Plugin identifier as set during initialize. |
In | callBackID | Integer value that later on will be sent to the callback (callbackId parameter). |
In | dataString | Data string to pass to the call back. |
Returns: Error/success code (see errorCodes enum above).
---
BwApiSpecialFolderGet
Get special folder.
Python
BwApi.SpecialFolderGet(folderType)
C++
BwApiSpecialFolderGet(folderType, folderPath);
C#
BwApi.SpecialFolderGet(folderType);
Parameters
Param | Variable | Description |
In | folderType | Special folder type (see BwApiSpecialFolderType enum). |
Out | folderPath | Path to a special folder. |
---
BwApiSettingsGet
Get settings of the system.
Python
BwApi.SettingsGet()
C++
BwApiSettingsGet(settings);
C#
BwApi.SettingsGet();
Parameters
Param | Variable | Description |
Out | settings | Settings JSON object as string containing all the settings information (see settings.json schema). |
---
BwApiSettingsUpdate
Update settings of the system.
Python
BwApi.SettingsUpdate(settings)
C++
BwApiSettingsUpdate(settings);
C#
BwApi.SettingsUpdate(settings);
Parameters
Param | Variable | Description |
In | settings | Settings JSON object as string containing all the settings information (see settings.json schema). |
Note: The update is only for the current session and it's not persistent.
---
BwApiDefaultAssetsGet
Get a JSON object with paths to default VStitcher and Lotta assets in the following pattern:
Python
BwApi.DefaultAssetsGet()
C++
BwApiDefaultAssetsGet(defaultAssetsJson);
C#
BwApi.DefaultAssetsGet();
Parameters
Param | Variable | Description |
Out | defaultAssetsJson | defaultAssetsJson JSON object as string containing all the default assets in VS/Lotta. |
---