Class AnimatedModelPreview
Animated model asset preview editor viewport.
Inheritance
Implements
Namespace: FlaxEditor.Viewport.Previews
Assembly: FlaxEngine.CSharp.dll
Syntax
public class AnimatedModelPreview : AssetPreview, IComparable, IDrawable, IEditorPrimitivesOwner
Constructors
AnimatedModelPreview(Boolean)
Initializes a new instance of the AnimatedModelPreview class.
Declaration
public AnimatedModelPreview(bool useWidgets)
Parameters
System.Boolean
useWidgets
if set to |
Fields
_snapToOrigin
Snaps the preview actor to the world origin.
Declaration
protected bool _snapToOrigin
Field Value
System.Boolean
|
Properties
NodesMask
Gets or sets the custom mask for the skeleton nodes. Nodes missing from this list will be skipped during rendering. Works only if ShowNodes is set to true and the array matches the attached SkinnedModel nodes hierarchy.
Declaration
public bool[] NodesMask { get; set; }
Property Value
System.Boolean[]
|
PlayAnimation
Gets or sets a value indicating whether play the animation in editor.
Declaration
public bool PlayAnimation { get; set; }
Property Value
System.Boolean
|
PlaySpeed
Gets or sets the animation playback speed.
Declaration
public float PlaySpeed { get; set; }
Property Value
System.Single
|
PreviewActor
Gets the skinned model actor used to preview selected asset.
Declaration
public AnimatedModel PreviewActor { get; }
Property Value
AnimatedModel
|
ScaleToFit
Gets or sets a value indicating whether scale the model to the normalized bounds.
Declaration
public bool ScaleToFit { get; set; }
Property Value
System.Boolean
|
ShowBounds
Gets or sets a value indicating whether show animated model bounding box debug view.
Declaration
public bool ShowBounds { get; set; }
Property Value
System.Boolean
|
ShowFloor
Gets or sets a value indicating whether show floor model.
Declaration
public bool ShowFloor { get; set; }
Property Value
System.Boolean
|
ShowNodes
Gets or sets a value indicating whether show animated model skeleton nodes debug view.
Declaration
public bool ShowNodes { get; set; }
Property Value
System.Boolean
|
ShowNodesNames
Gets or sets a value indicating whether show animated model skeleton nodes names debug view.
Declaration
public bool ShowNodesNames { get; set; }
Property Value
System.Boolean
|
SkinnedModel
Gets or sets the skinned model asset to preview.
Declaration
public SkinnedModel SkinnedModel { get; set; }
Property Value
SkinnedModel
|
Methods
GetBounds()
Gets the skinned model bounds. Handles skeleton-only assets.
Declaration
public BoundingBox GetBounds()
Returns
BoundingBox
The local bounds. |
OnDebugDraw(GPUContext, ref RenderContext)
Called when drawing debug shapes with DebugDraw for this viewport.
Declaration
protected override void OnDebugDraw(GPUContext context, ref RenderContext renderContext)
Parameters
GPUContext
context
The GPU context. |
RenderContext
renderContext
The render context. |
Overrides
OnDestroy()
OnKeyDown(KeyboardKeys)
When key goes down
Declaration
public override bool OnKeyDown(KeyboardKeys key)
Parameters
KeyboardKeys
key
Key value |
Returns
System.Boolean
True if event has been handled, otherwise false |
Overrides
Pause()
Pauses the animation playback.
Declaration
public void Pause()
Play()
Starts the animation playback.
Declaration
public void Play()
ResetCamera()
Resets the camera to focus on a object.
Declaration
public void ResetCamera()
SetBlendShapeWeight(String, Single)
Sets the weight of the blend shape and updates the preview model (if not animated right now).
Declaration
public void SetBlendShapeWeight(string name, float value)
Parameters
System.String
name
The blend shape name. |
System.Single
value
The normalized weight of the blend shape (in range -1:1). |
Stop()
Stops the animation playback.
Declaration
public void Stop()
Update(Single)
Perform control update and all its children
Declaration
public override void Update(float deltaTime)
Parameters
System.Single
deltaTime
Delta time in seconds |
Overrides
Events
PlayAnimationChanged
Occurs when animation playback state gets changed.
Declaration
public event Action PlayAnimationChanged
Event Type
System.Action
|