You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This webapp renders an interactive 3D preview of a wearable or an avatar. It can be configured via query params or via `postMessage`:
4
-
5
-
-`contract`: The contract address of the wearable collection.
6
-
-`item`: The id of the item in the collection.
7
-
-`token`: The id of the token (to preview a specific NFT).
8
-
-`profile`: an ethereum address of a profile to load as the base avatar. It can be set to `default` or a numbered default profile like `default15` to use a default profile.
9
-
-`urn`: a URN of a wearable or an emote to load. If it is a wearable, it will override anything loaded from a profile. It can be used many times.
10
-
-`url`: a URL of a wearable or an emote to load. If it is a wearable, it will override anything loaded from a profile. It can be used many times. The url will be fetched and must return a valid definition following the [`WearableDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/wearable-definition.ts) or [`EmoteDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/emote-definition.ts) types.
11
-
-`base64`: a wearable or an emote to load, encoded in base64. If it is a wearable, it will override anything loaded from a profile. It can be used many times. Once parsed it should be a valid definition following the [`WearableDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/wearable-definition.ts) or [`EmoteDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/emote-definition.ts) types.
12
-
-`skin`: a color to be used by the skin material, it must be in hex.
13
-
-`hair`: a color to be used by the hair material, it must be in hex.
14
-
-`eyes`: a color to be used by the eyes tint, it must be in hex.
15
-
-`bodyShape`: which body shape to use, possible values are `urn:decentraland:off-chain:base-avatars:BaseMale` or `urn:decentraland:off-chain:base-avatars:BaseFemale`.
16
-
-`emote`: the emote that the avatar will play. Default value is `idle`, other possible values are: `clap`, `dab`, `dance`, `fashion`, `fashion-2`, `fashion-3`,`fashion-4`, `love`, `money`, `fist-pump` and `head-explode`.
17
-
-`socialEmote`: when specified, duplicates the avatar and plays different animations on each avatar to create a social interaction scenario. The structure should be a JSON object with the following properties:
18
-
-`title` (required): a string describing the social emote (e.g., `"High Five"`)
19
-
-`loop` (required): a boolean indicating if the animation should loop (e.g., `true`)
20
-
-`audio` (optional): a string URL for audio to play with the animation
21
-
-`Armature` (optional): animation for the main avatar (e.g., `{"animation": "HighFive_Start"}`)
22
-
-`Armature_Prop` (optional): animation for props/objects (e.g., `{"animation": "HighFive_Prop_Start"}`)
23
-
-`Armature_Other` (optional): animation for the duplicated avatar using AvatarOther\_ nodes (e.g., `{"animation": "HighFive_Other_Start"}`)
-`zoom`: the level of zoom, it must be a number between 1 and 100.
26
-
-`zoomScale`: a multiplier for the zoom level. By default is `1` but it can be increased to get extra zoom.
27
-
-`camera`: which camera type to use, either `interactive` or `static`. By default it uses the `interactive` one.
28
-
-`projection`: which projection type to use, either `orthographic` or `perspective`. By default it uses the `perspective` one.
29
-
-`offsetX`: apply an offset in the X position of the scene. By default is `0`.
30
-
-`offsetY`: apply an offset in the Y position of the scene. By default is `0`.
31
-
-`offsetZ`: apply an offset in the Z position of the scene. By default is `0`.
32
-
-`cameraX`: set the X position of the camera.
33
-
-`cameraY`: set the Y position of the camera.
34
-
-`cameraZ`: set the Z position of the camera.
35
-
-`wheelZoom`: a multiplier of how much the user can zoom with the mouse wheel. By default is `1`, which means the wheel doesn't do any zoom. If the value were `2` the user would be able to zoom up to 2x.
36
-
-`wheelPrecision`: the higher the value, the slower the wheel zooms when scrolled. By default is `100`.
37
-
-`wheelStart`: a value between 0 and 100 which determines how zoomed in or out the wheel starts. By default is `50`, so the user can zoom in or out. If the value were `0` the zoom would start at minimum and the user would be able to zoom in. If the value were `100` the zoom would start at max and the user would be able to zoom out.
38
-
-`background`: the color of the background in hex, ie: `ff0000`.
39
-
-`peerUrl`: set a custom url for a Catalyst peer.
40
-
-`marketplaceServerUrl`: set a custom url for the Marketplace API
41
-
-`nftServerUrl`: set a custom url for the Marketplace API (legacy, marketplaceServerUrl takes priority)
42
-
-`type`: set a custom PreviewType to render standalone items passed as urn, url or base64. currently only supports `wearable`.
43
-
-`disableBackground`: if `true` it will make the background transparent.
44
-
-`disableAutoRotate`: if `true` it will disable the auto-rotate behaviour of the camera.
45
-
-`disableAutoCenter`: if `true` it will disable the auto-center around the bounding box.
46
-
-`disableFace`: if `true` it will disable the facial features.
47
-
-`disableDefaultWearables`: if `true` it will not load the default wearables (it will only load the base body shape).
48
-
-`disableFadeEffect`: if `true` it will disable css transitions (the fade in / fade out effect). This is useful for automation tests.
49
-
-`disableDefaultEmotes`: if `true` and `emote` is not passed, it will not load the default IDLE emote.
50
-
-`showSceneBoundaries`: if `true` it will show a cylinder representing the recommended scene boundaries.
51
-
-`showThumbnailBoundaries`: if `true` it will show a square representing the thumbnail boundaries.
52
-
-`panning`: If `true`, enables the panning capability. By default it's `true`.
53
-
-`lockAlpha`: If `true`, locks the alpha rotation, preventing the users from rotating the camera around alpha (in simpler terms, "horizontally").
54
-
-`lockBeta`: If `true`, locks the beta rotation, preventing the users from rotating the camera around beta (in simpler terms, "vertically").
55
-
-`lockRadius`: If `true`, locks the radius rotation, preventing the users from rotating the camera around radius (in simpler terms, "how far or close it is").
56
-
-`env`: The environment to use, it can be `prod` (uses mainnet wearables and catalysts) or `dev` (uses testnet wearables and catalysts).
A webapp that renders interactive 3D previews of Decentraland wearables, emotes, and avatars. It can be embedded as an iframe and controlled via query parameters or `postMessage` API.
4
+
5
+
## Table of Contents
6
+
7
+
-[Features](#features)
8
+
-[Dependencies & Related Services](#dependencies--related-services)
9
+
-[Getting Started](#getting-started)
10
+
-[Prerequisites](#prerequisites)
11
+
-[Installation](#installation)
12
+
-[Development](#development)
13
+
-[Build](#build)
14
+
-[Usage](#usage)
15
+
-[Query Parameters](#query-parameters)
16
+
-[iframe API](#iframe-api)
17
+
-[iframe Events](#iframe-events)
18
+
-[Controller RPC](#controller-rpc)
19
+
-[Testing](#testing)
20
+
21
+
## Features
22
+
23
+
-**3D Avatar Preview**: Render full avatars with equipped wearables
24
+
-**Wearable Preview**: Preview individual wearables on an avatar
25
+
-**Emote Preview**: Play and control emote animations
26
+
-**Social Emotes**: Preview two-person social interaction emotes
27
+
-**Interactive Camera**: Pan, zoom, and rotate around the preview
28
+
-**Screenshot Capture**: Programmatically capture screenshots via RPC
29
+
-**iframe Embeddable**: Easy integration via iframe with postMessage API
30
+
-**Multiple Input Sources**: Load items via URN, URL, base64, or contract/item IDs
31
+
32
+
## Dependencies & Related Services
33
+
34
+
This webapp interacts with the following services:
35
+
36
+
-**[Peer/Catalyst Server](https://github.com/decentraland/catalyst)**: Fetches wearable/emote entities, profiles, and content
37
+
-**[Marketplace API](https://github.com/decentraland/marketplace)**: Retrieves item and NFT data by contract address
38
+
39
+
## Getting Started
40
+
41
+
### Prerequisites
42
+
43
+
-**Node.js**: Version 22.x
44
+
-**npm**: Latest version compatible with Node.js 22.x
|`contract`| The contract address of the wearable collection |
79
+
|`item`| The id of the item in the collection |
80
+
|`token`| The id of the token (to preview a specific NFT) |
81
+
|`profile`| An ethereum address of a profile to load as the base avatar. It can be set to `default` or a numbered default profile like `default15`|
82
+
|`urn`| A URN of a wearable or emote to load. If it is a wearable, it will override anything loaded from a profile. Can be used multiple times |
83
+
|`url`| A URL of a wearable or emote to load. Must return a valid [`WearableDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/wearable-definition.ts) or [`EmoteDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/emote-definition.ts). Can be used multiple times |
84
+
|`base64`| A wearable or emote encoded in base64. Once parsed it should be a valid [`WearableDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/wearable-definition.ts) or [`EmoteDefinition`](https://github.com/decentraland/common-schemas/blob/main/src/dapps/preview/emote-definition.ts). Can be used multiple times |
|`emote`| The emote that the avatar will play. Default: `idle`. Options: `clap`, `dab`, `dance`, `fashion`, `fashion-2`, `fashion-3`, `fashion-4`, `love`, `money`, `fist-pump`, `head-explode`|
100
+
|`socialEmote`| When specified, duplicates the avatar and plays different animations on each to create a social interaction. JSON object with: `title` (required), `loop` (required), `audio` (optional), `Armature`, `Armature_Prop`, `Armature_Other` (optional animation configs) |
0 commit comments