Skip to main content

High Fidelity API Reference

Tools Used: JavaScript, JSDoc, GitHub Pages, Markdown, HTML, CSS


AvatarBookmarks

The AvatarBookmarks API provides facilities for working with avatar bookmarks ("favorites" in the Avatar app). An avatar bookmark associates a name with an avatar model, scale, and avatar entities (wearables).

Supported Script Types: Interface Scripts • Client Entity Scripts • Avatar Scripts


Methods

NameReturn ValueSummary

addBookmark

None

Adds a new (or updates an existing) avatar bookmark with your current avatar model, scale, and avatar entities.

deleteBookmark

None

Performs no action.

Deprecated: This function is deprecated and will be removed.

getBookmark

AvatarBookmarks.BookmarkData | Object

Gets the details of an avatar bookmark.

getBookmarks

Object.<string, AvatarBookmarks.BookmarkData>

Gets the details of all avatar bookmarks.

loadBookmark

None

Loads an avatar bookmark, setting your avatar model, scale, and avatar entities (or attachments if an old bookmark) to those in the bookmark.

removeBookmark

None

Deletes an avatar bookmark.

saveBookmark

None

Updates an existing bookmark with your current avatar model, scale, and wearables. No action is taken if the bookmark doesn't exist.

updateAvatarEntities

None

Updates the avatar entities and their properties. Current avatar entities not included in the list provided are deleted.

Deprecated: This function is deprecated and will be removed. Use the MyAvatar API instead.


Signals

NameSummary

bookmarkAdded

Triggered when a new avatar bookmark is added or an existing avatar bookmark is updated with the addBookmark method.

bookmarkDeleted

Triggered when an avatar bookmark is deleted.

bookmarkLoaded

Triggered when an avatar bookmark is loaded, setting your avatar model, scale, and avatar entities (or attachments if an old bookmark) to those in the bookmark.


Type Definitions

BookmarkData

BookmarkData

Type: object

Details of an avatar bookmark.

Properties

NameTypeAttributesSummary
version

number

The version of the bookmark data format.

avatarUrl

string

The URL of the avatar model.

avatarScale

number

The target scale of the avatar.

avatarEntites

Array.<Object.<"properties", Entities.EntityProperties>>

<optional>

The avatar entities included with the bookmark.

attachments

Array.<MyAvatar.AttachmentData>

<optional>

The attachments included with the bookmark.

Deprecated: Use avatar entities instead.


Method Details

addBookmark

(static) addBookmark( bookmarkName )

Adds a new (or updates an existing) avatar bookmark with your current avatar model, scale, and avatar entities.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark (case sensitive).

Add a new avatar bookmark and report the bookmark data
var bookmarkName = "New Bookmark";
AvatarBookmarks.addBookmark(bookmarkName);
var bookmarkData = AvatarBookmarks.getBookmark(bookmarkName);
print("Bookmark data: " + JSON.stringify(bookmarkData));

deleteBookmark

(static) deleteBookmark( )

Performs no action.

Deprecated: This function is deprecated and will be removed.

(static) getBookmark( bookmarkName ) → { AvatarBookmarks.BookmarkData|Object }

Returns: The bookmark data if the bookmark exists, {} if it doesn't.

Gets the details of an avatar bookmark.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark (case sensitive).

getBookmarks

(static) getBookmarks( ) → { Object.<string, AvatarBookmarks.BookmarkData> }

Returns: The current avatar bookmarks in an object where the keys are the bookmark names and the values are the bookmark details.

Gets the details of all avatar bookmarks.

Example: List the names and URLs of all the avatar bookmarks
var bookmarks = AvatarBookmarks.getBookmarks();
print("Avatar bookmarks:");
for (var key in bookmarks) {
print("- " + key + " " + bookmarks[key].avatarUrl);
};

loadBookmarks

(static) loadBookmark( bookmarkName )

Loads an avatar bookmark, setting your avatar model, scale, and avatar entities (or attachments if an old bookmark) to those in the bookmark.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark to load (case sensitive).

removeBookmark

(static) removeBookmark( bookmarkName )

Deletes an avatar bookmark.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark to delete (case sensitive).

saveBookmark

(static) saveBookmark( bookmarkName )

Updates an existing bookmark with your current avatar model, scale, and wearables. No action is taken if the bookmark doesn't exist.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark (case sensitive).

updateAvatarEntities

(static) updateAvatarEntities( avatarEntities )

Updates the avatar entities and their properties. Current avatar entities not included in the list provided are deleted.

Deprecated: This function is deprecated and will be removed. Use the MyAvatar API instead.


Signal Details

bookmarkAdded

bookmarkAdded( bookmarkName )

Returns: Signal

Triggered when a new avatar bookmark is added or an existing avatar bookmark is updated, using addBookmark.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark added or updated.

bookmarkDeleted

bookmarkDeleted( bookmarkName )

Returns: Signal

Triggered when an avatar bookmark is deleted.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark deleted.

Example: Report when a bookmark is deleted
AvatarBookmarks.bookmarkDeleted.connect(function (bookmarkName) {
print("Bookmark deleted: " + bookmarkName);
});

bookmarkLoaded

bookmarkLoaded( bookmarkName )

Returns: Signal

Triggered when an avatar bookmark is loaded, setting your avatar model, scale, and avatar entities (or attachments if an old bookmark) to those in the bookmark.

Parameters

NameTypeDescription
bookmarkName

string

The name of the avatar bookmark loaded.