Skip to main content

Application

Version IdentifierGet ApplicationExit HostApplic...

Updated over 2 months ago

Version

Get the API version used by the plugin and the latest API version supported by the host application.

Python C++ C# VS Server

Python

BwApi.Version()

C++

BwApiVersion();

C#

BwApi.Version();

VS Server

{
	"id": "API processing order number",
	"function": "Version",
	"params": {}
}    

Parameters

Param

Variable

Description

Out

pluginApiVer

API version used by the plugin

Out

latestApiVer

Latest API version supported by the host application

Error/success code (see errorCodes enum above).

IdentifierGet

Get the current plugin identifier (previouly set by BwApiIdentifierSet).

Python C++ C# VS Server

Python

BwApi.IdentifierGet()

C++

BwApiIdentifierGet();

C#

BwApi.IdentifierGet();

VS Server

{
	"id": "API processing order number",
	"function": "IdentifierGet",
	"params": {}
}    

Parameters

Param

Variable

Description

Out

identifier

Unique plugin identifier

ApplicationExit

Exit Browzwear application with status code.

Python C++ C#

Python

BwApi.ApplicationExit()

C++

BwApiApplicationExit();

C#

BwApi.ApplicationExit();

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.

HostApplicationGet

Get the application information (For more information view at host_application.json).

Python C++ C# VS Server

Python

BwApi.HostApplicationGet()

C++

BwApiHostApplicationGet();

C#

BwApi.HostApplicationGet();

VS Server

{
	"id": "API processing order number",
	"function": "HostApplicationGet",
	"params": {}
}    

Parameters

Param

Variable

Description

Out

hostApplication

Information about the application

PluginNameSet

Set the plugin's name. In case a menu item will be added the name of the plugin will be used as the top level menu.

Python C++ C# VS Server

Python

BwApi.PluginNameSet(name)

C++

BwApiPluginNameSet(name);

C#

BwApi.PluginNameSet(name);

VS Server

{
	"id": "API processing order number",
	"function": "PluginNameSet",
	"params": {
		"name": "value"
	}
}    

Parameters

Param

Variable

Description

In

name

Plugin name

LanguageGet

Get the current interfcae language.

Python C++ C# VS Server

Python

BwApi.LanguageGet()

C++

BwApiLanguageGet();

C#

BwApi.LanguageGet();

VS Server

{
	"id": "API processing order number",
	"function": "LanguageGet",
	"params": {}
}    

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

Error/success code (see errorCodes enum above).

MenuFunctionAdd +(_C_API)

Add plugin menu item.

Python C++ C# C VS Server

Python

BwApi.MenuFunctionAdd(menuName, callbackObj, callBackID)

C++

BwApiMenuFunctionAdd(menuName, callbackObj, callBackID);

C#

BwApi.MenuFunctionAdd(menuName, callbackObj, callBackID);

C

BwApiMenuFunctionAdd_C_API(menuName, callbackObj, callBackID);

VS Server

{
	"id": "API processing order number",
	"function": "MenuFunctionAdd",
	"params": {
		"menuName": "value",
		"callbackObj": "value",
		"callBackID": "value"
	}
}    

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)

Error/success code (see errorCodes enum above).

CallBackID value 9999 is saved for internal use only.

CallBackID value -1 will create a separator under the last menu item that was added.

MenuFunctionReloadAdd

Add 'Reload Plugin' menu item to the end of the plugin's sub menu. This allow you to perform changes to your plugin and ask VStitcher to reload the plugin without restarting VStitcher.

Python C++ C# VS Server

Python

BwApi.MenuFunctionReloadAdd()

C++

BwApiMenuFunctionReloadAdd();

C#

BwApi.MenuFunctionReloadAdd();

VS Server

{
	"id": "API processing order number",
	"function": "MenuFunctionReloadAdd",
	"params": {}
}    

Error/success code (see errorCodes enum above).

This call will unload the plugin, load it back and then call to the initialize function again.

Warning: You should use this only during the plugin development phase, you should not ship your plugin to customers while calling this function.

FileMethodRegister +(_C_API)

Register plugin to file open / import / export dialog.

Python C++ C# C

Python

BwApi.FileMethodRegister(callbackObj, callBackID, text, fileExtenions, fileOperation)

C++

BwApiFileMethodRegister(callbackObj, callBackID, text, fileExtenions, fileOperation);

C#

BwApi.FileMethodRegister(callbackObj, callBackID, text, fileExtenions, fileOperation);

C

BwApiFileMethodRegister_C_API(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

FileMethodUnregister

Unregister plugin from file open / import / export dialog.

Python C++ C#

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

EventRegister +(_C_API)

Register plugin for specific event type.

Python C++ C# C

Python

BwApi.EventRegister(callbackObj, callBackID, eventType)

C++

BwApiEventRegister(callbackObj, callBackID, eventType);

C#

BwApi.EventRegister(callbackObj, callBackID, eventType);

C

BwApiEventRegister_C_API(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

EventUnregister

Unregister from plugin event.

Python C++ C#

Python

BwApi.EventUnregister(callbackObj, callBackID)

C++

BwApiEventUnregister(callbackObj, callBackID);

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

UpdateSessionFunctionSet +(_C_API)

DEPPRECATED please use BwApiUpdateSessionFunctionSet_v2

Python C++ C# C VS Server

Python

BwApi.UpdateSessionFunctionSet()

C++

BwApiUpdateSessionFunctionSet();

C#

BwApi.UpdateSessionFunctionSet();

C

BwApiUpdateSessionFunctionSet_C_API();

VS Server

{
	"id": "API processing order number",
	"function": "UpdateSessionFunctionSet",
	"params": {}
}    

UpdateSessionFunctionRequest

DEPPRECATED please use BwApiUpdateSessionFunctionRequest_v2

Python C++ C# VS Server

Python

BwApi.UpdateSessionFunctionRequest()

C++

BwApiUpdateSessionFunctionRequest();

C#

BwApi.UpdateSessionFunctionRequest();

VS Server

{
	"id": "API processing order number",
	"function": "UpdateSessionFunctionRequest",
	"params": {}
}    

UpdateSessionFunctionSet_v2 +(_C_API)

Set function to call for update session from the currect thread must not have pending request when calling this function.

Python C++ C# C VS Server

Python

BwApi.UpdateSessionFunctionSet_v2(callbackObj)

C++

BwApiUpdateSessionFunctionSet_v2(callbackObj);

C#

BwApi.UpdateSessionFunctionSet_v2(callbackObj);

C

BwApiUpdateSessionFunctionSet_v2_C_API(callbackObj);

VS Server

{
	"id": "API processing order number",
	"function": "UpdateSessionFunctionSet_v2",
	"params": {
		"callbackObj": "value"
	}
}    

Parameters

Param

Variable

Description

In

callbackObj

Class derived from BwApiCallbackBase

Error/success code (see errorCodes enum above).

You must call to BwApiIdentifierSet before calling to this function!

UpdateSessionFunctionRequest_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 C++ C# VS Server

Python

BwApi.UpdateSessionFunctionRequest_v2(identifier, callBackID, dataString)

C++

BwApiUpdateSessionFunctionRequest_v2(identifier, callBackID, dataString);

C#

BwApi.UpdateSessionFunctionRequest_v2(identifier, callBackID, dataString);

VS Server

{
	"id": "API processing order number",
	"function": "UpdateSessionFunctionRequest_v2",
	"params": {
		"identifier": "value",
		"callBackID": "value",
		"dataString": "value"
	}
}    

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

Error/success code (see errorCodes enum above).

SpecialFolderGet

Get special folder.

Python C++ C# VS Server

Python

BwApi.SpecialFolderGet(folderType)

C++

BwApiSpecialFolderGet(folderType);

C#

BwApi.SpecialFolderGet(folderType);

VS Server

{
	"id": "API processing order number",
	"function": "SpecialFolderGet",
	"params": {
		"folderType": "value"
	}
}    

Parameters

Param

Variable

Description

In

folderType

Special folder type (see BwApiSpecialFolderType enum)

Out

folderPath

Path to a special folder

SettingsGet

Get settings of the system.

Python C++ C# VS Server

Python

BwApi.SettingsGet()

C++

BwApiSettingsGet();

C#

BwApi.SettingsGet();

VS Server

{
	"id": "API processing order number",
	"function": "SettingsGet",
	"params": {}
}    

Parameters

Param

Variable

Description

Out

settings

Settings JSON object as string containing all the settings information (see Schema/v1/settings.json schema)

SettingsUpdate

Update settings of the system.

Python C++ C# VS Server

Python

BwApi.SettingsUpdate(settings)

C++

BwApiSettingsUpdate(settings);

C#

BwApi.SettingsUpdate(settings);

VS Server

{
	"id": "API processing order number",
	"function": "SettingsUpdate",
	"params": {
		"settings": "value"
	}
}    

Parameters

Param

Variable

Description

In

settings

Settings JSON object as string containing all the settings information (see Schema/v3.5/settings.json schema)

The update is only for the current session and it's not persistent.

DefaultAssetsGet

None

Python C++ C# VS Server

Python

BwApi.DefaultAssetsGet()

C++

BwApiDefaultAssetsGet();

C#

BwApi.DefaultAssetsGet();

VS Server

{
	"id": "API processing order number",
	"function": "DefaultAssetsGet",
	"params": {}
}    

Parameters

Param

Variable

Description

Out

defaultAssetsJson

DefaultAssetsJson JSON object as string containing all the default assets in VS/Lotta

Did this answer your question?