Class Avatar
Definition
- Assembly:
- Tizen.AIAvatar.dll
The Avatar class displays 3D avatars and provides easy access to their animations. This class is a sub-class of the Model class which allows us to easily control the Avatar's animations. Avatar also supports AR Emoji for humanoid-based 3D models.
public class Avatar : Model, IDynamicResourceHandler, INameScope, System.IDisposable, IResourcesProvider
- Inheritance
- Implements
-
System.IDisposable
Constructors
View SourceAvatar()
Create an initialized AvatarModel.
Declaration
public Avatar()
Avatar(string, string)
Create an initialized Avatar.
Declaration
public Avatar(string avatarUrl, string resourceDirectoryUrl = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | avatarUrl | avatar file url.(e.g. glTF). |
| string | resourceDirectoryUrl | The url to derectory containing resources: binary, image etc. |
Remarks
If resourceDirectoryUrl is empty, the parent directory url of avatarUrl is used for resource url.
http://tizen.org/privilege/mediastorage for local files in media storage. http://tizen.org/privilege/externalstorage for local files in external storage.
Avatar(Avatar)
Copy constructor.
Declaration
public Avatar(Avatar avatar)
Parameters
| Type | Name | Description |
|---|---|---|
| Avatar | avatar | Source object to copy. |
Avatar(AvatarInfo)
Create an initialized AREmojiDefaultAvatar.
Declaration
public Avatar(AvatarInfo avatarInfo)
Parameters
| Type | Name | Description |
|---|---|---|
| AvatarInfo | avatarInfo |
Properties
View SourceProperties
The AvatarProperties property gets or sets the AvatarProperties object containing various information about the Avatar.
Declaration
public AvatarProperties Properties { get; set; }
Property Value
| Type | Description |
|---|---|
| AvatarProperties |
Methods
View SourcePauseEyeBlink()
Pauses the eye blink animation for the current avatar.
Declaration
public void PauseEyeBlink()
PauseMotionAnimation()
Pauses the currently playing avatar animation.
Declaration
public void PauseMotionAnimation()
PlayAnimation(int, int, bool, int)
Plays the specified avatar animation based on its index within the available animations and an optional duration and loop count.
Declaration
public void PlayAnimation(int index, int duration = 3000, bool isLooping = false, int loopCount = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | The zero-based index of the desired avatar animation within the list of available animations. |
| int | duration | The duration of the animation in milliseconds (default is 3000). |
| bool | isLooping | A boolean indicating whether the animation should be looped or not. |
| int | loopCount | The number of times to repeat the animation if it's set to loop. |
PlayAnimation(AnimationInfo, int, bool, int)
Plays the specified avatar animation with an optional duration and loop count.
Declaration
public void PlayAnimation(AnimationInfo animationInfo, int duration = 3000, bool isLooping = false, int loopCount = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| AnimationInfo | animationInfo | The AnimationInfo object containing information about the desired avatar animation. |
| int | duration | The duration of the animation in milliseconds (default is 3000). |
| bool | isLooping | A boolean indicating whether the animation should be looped or not. |
| int | loopCount | The number of times to repeat the animation if it's set to loop. |
PlayAnimation(MotionData, int, bool, int)
Plays the specified avatar animation with MotionData and an optional duration and loop count.
Declaration
public void PlayAnimation(MotionData motionData, int duration = 3000, bool isLooping = false, int loopCount = 1)
Parameters
| Type | Name | Description |
|---|---|---|
| MotionData | motionData | The MotionData object containing information about the desired avatar animation. |
| int | duration | The duration of the animation in milliseconds (default is 3000). |
| bool | isLooping | A boolean indicating whether the animation should be looped or not. |
| int | loopCount | The number of times to repeat the animation if it's set to loop. |
StartEyeBlink()
Starts the eye blink animation for the current avatar.
Declaration
public void StartEyeBlink()
StopEyeBlink()
Stops the eye blink animation for the current avatar.
Declaration
public void StopEyeBlink()
StopMotionAnimation()
Stops the currently playing avatar animation.
Declaration
public void StopMotionAnimation()