
# Class: AuWidget3DViewer

A widget that is used to render 3D previews based on DAE models.

The following example illustrates how you can use proof images obtained from the [`DesignEditor`](../classes/auwidgetdesigneditor.md) to visualize a model in the `3D-Viewer` widget.
```
{
  "widgets": [
   {
     "name": "previewer",
     "type": "3d-viewer",
     "params": {
       "showAnimationButtons": false,
       "showCameraButtons": true,
       "items": [
         {
           "images": "{{ $['editor'].proofImageUrls }}",
           "model": "models/trifold.dae"
         }
       ]
     }
   }
 ]
}
```

## Hierarchy

  ↳ [Au3dViewerBase](au3dviewerbase.md)

  ↳ **AuWidget3DViewer**

## Implements

* [IWidget](../interfaces/iwidget.md)

## Index

### Properties

* [image](auwidget3dviewer.md#image)
* [params](auwidget3dviewer.md#params)
* [paused](auwidget3dviewer.md#paused)
* [speed](auwidget3dviewer.md#speed)

### Methods

* [GetAnimationDuration](auwidget3dviewer.md#getanimationduration)
* [PauseAnimation](auwidget3dviewer.md#pauseanimation)
* [PlayAnimation](auwidget3dviewer.md#playanimation)
* [SetAnimationAt](auwidget3dviewer.md#setanimationat)
* [SetAnimationSpeed](auwidget3dviewer.md#setanimationspeed)
* [checkInitDependenciesWidgets](auwidget3dviewer.md#checkinitdependencieswidgets)
* [closeBox](auwidget3dviewer.md#closebox)
* [openBox](auwidget3dviewer.md#openbox)
* [resetPreloaderState](auwidget3dviewer.md#resetpreloaderstate)
* [showPreloader](auwidget3dviewer.md#showpreloader)
* [showToast](auwidget3dviewer.md#showtoast)

## Properties

###  image

• **image**: *string*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[image](au3dviewerbase.md#image)*

A base64 URL that links to the rendered model image in the initial position.

___

###  params

• **params**: *any*

*Implementation of [IWidget](../interfaces/iwidget.md).[params](../interfaces/iwidget.md#optional-params)*

*Inherited from [AuBaseWidget](aubasewidget.md).[params](aubasewidget.md#params)*

Compiled widget configuration.

___

###  paused

• **paused**: *boolean* = false

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[paused](au3dviewerbase.md#paused)*

If `true`, animation is paused.

___

###  speed

• **speed**: *number* = 1

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[speed](au3dviewerbase.md#speed)*

The current animation speed.

## Methods

###  GetAnimationDuration

▸ **GetAnimationDuration**(): *number*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[GetAnimationDuration](au3dviewerbase.md#getanimationduration)*

Gets the longest animation time in the model.

**`constructor`** 

**Returns:** *number*

___

###  PauseAnimation

▸ **PauseAnimation**(): *void*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[PauseAnimation](au3dviewerbase.md#pauseanimation)*

Pauses animation.

**Returns:** *void*

___

###  PlayAnimation

▸ **PlayAnimation**(): *void*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[PlayAnimation](au3dviewerbase.md#playanimation)*

Plays animation.

**Returns:** *void*

___

###  SetAnimationAt

▸ **SetAnimationAt**(`value`: number): *void*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[SetAnimationAt](au3dviewerbase.md#setanimationat)*

Navigates to animation time.

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`value` | number | The animation time.  |

**Returns:** *void*

___

###  SetAnimationSpeed

▸ **SetAnimationSpeed**(`value`: number): *void*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[SetAnimationSpeed](au3dviewerbase.md#setanimationspeed)*

Sets the animation speed.

`1` - the default speed.

`<0` - reverse animation.

`-1` - the default speed for reverse animation.

`0` - pause.

`>1` - increments speed.

**Parameters:**

Name | Type |
------ | ------ |
`value` | number |

**Returns:** *void*

___

###  checkInitDependenciesWidgets

▸ **checkInitDependenciesWidgets**(): *string[]*

*Inherited from [AuBaseWidget](aubasewidget.md).[checkInitDependenciesWidgets](aubasewidget.md#checkinitdependencieswidgets)*

Returns an array of widget names, due to which the current widget cannot receive parameters.

**Returns:** *string[]*

___

###  closeBox

▸ **closeBox**(): *void*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[closeBox](au3dviewerbase.md#closebox)*

Closes the dynamic model.

**Returns:** *void*

___

###  openBox

▸ **openBox**(): *void*

*Inherited from [Au3dViewerBase](au3dviewerbase.md).[openBox](au3dviewerbase.md#openbox)*

Opens the dynamic model.

**Returns:** *void*

___

###  resetPreloaderState

▸ **resetPreloaderState**(): *void*

*Inherited from [AuBaseWidget](aubasewidget.md).[resetPreloaderState](aubasewidget.md#resetpreloaderstate)*

**Returns:** *void*

___

###  showPreloader

▸ **showPreloader**(`isPreload`: boolean, `message`: string | string[], `timeout`: number): *void*

*Inherited from [AuBaseWidget](aubasewidget.md).[showPreloader](aubasewidget.md#showpreloader)*

Shows a preloader.

```
"onClick": [
  "{{#function main.showPreloader(true, 'Creating print files...')}}",
  "{{#function $['editor'].getHiResImages(800,800)}}",
  "{{#function main.showPreloader(false)}}"
]
```

**Parameters:**

Name | Type | Default | Description |
------ | ------ | ------ | ------ |
`isPreload` | boolean | - | If `true`, enables the preloader. |
`message` | string &#124; string[] |  [""] | A text message that appears next to the preloader.  |
`timeout` | number | 5 | - |

**Returns:** *void*

___

###  showToast

▸ **showToast**(`data?`: string, `duration?`: number): *void*

*Inherited from [AuBaseWidget](aubasewidget.md).[showToast](aubasewidget.md#showtoast)*

Shows a toast.

```
return editor.loadUserInfo(data)
    .catch(err => {
        this.widget.showToast("Error: Invalid data");
        console.log(err);
    });
```

**Parameters:**

Name | Type | Description |
------ | ------ | ------ |
`data?` | string | A string message to display in the toast. |
`duration?` | number | Defines how long to show the toast for.  |

**Returns:** *void*
