Avatars
Avatars are the human body respresentation that you dress with garments in 3D. Use the Avatars API to get the current avatar, set the current avatar, get the list of all the avatars in VStitcher/Lotta, and so on.
For more information about the feature, please visit here.
To learn more about the rest of the API, please refer to Avatar in the repository.
Sample Plugin
Sample plugin for Avatars is available here
Getting Current Avatar
Code Snippet
Python C++ C#
Python
current_avatar_id = BwApi.AvatarCurrentGet()
C++
BwApiString* avatarId = BwApiStringCerate(); BwApiAvatarCurrentGet(avatarId);
C#
string avatarId; BwApi.AvatarCurrentGet(out avatarId);
Result
The id of the current avatar
Importing an Avatar
Code Snippet
Note: the avatar file must be FBX, OBJ, or AVA.
Python C++ C#
Python
# assuming the path is valid and the file format is valid avatarId = BwApi.AvatarImport(path)
C++
// assuming the path is valid and the file format is valid BwApiString* avatarId = BwApiStringCreate(); BwApiAvatarImport(path, avatarId);
C#
string avatarId; BwApi.AvatarImport(path, out avatarId);
Result
Importing a VSA file
Code Snippet
Python C++ C#
Python
# assuming the path is valid and the file format is valid avatarIds = BwApi.AvatarImportVSA(path)
C++
// assuming the path is valid and the file format is valid BwApiVectorString* avatarIds = BwApiVectorStringCreate(); BwApiAvatarImportVSA(path, avatarIds);
C#
BwApiVectorString avatarIds = new BwApiVectorString(); BwApi.AvatarImportVSA(path, out avatarIds);