public sealed class Sandbox.SceneModel : Sandbox.SceneObject
A model scene object that supports animations and can be rendered within a `Sandbox.SceneWorld`.
Related Guides
Broader workflow and conceptual references connected to this API.
Constructors
Showing 2 constructors
No results match this filter.
Methods
Showing 30 methods
public void ClearBoneOverrides()
Clears all bone transform overrides.
public void DispatchTagEvents()
public System.Nullable`1<Transform> GetAttachment(string name, bool worldspace = True)
Get attachment transform by name.
Parameters
name: Name of the attachment to calculate transform of.worldspace: Whether the transform should be in world space (relative to the scene world), or local space (relative to the scene object) Default: True
public void GetBoneVelocity(int boneIndex, Vector3 linear, Vector3 angular)
Calculates the velocity from the previous and current bone transforms.
public bool GetBool(string name)
Get an animated parameter
public float GetFloat(string name)
Get an animated parameter
public int GetInt(string name)
Get an animated parameter
public Transform GetParentSpaceBone(int i)
Returns the parent space transform of a bone by its index.
Parameters
i: Index of the bone to calculate transform of.
Returns
The parent space transform, or an identity transform on failure.
public Rotation GetRotation(string name)
Get an animated parameter
public Vector3 GetVector3(string name)
Get an animated parameter
public bool HasBoneOverrides()
Whether any bone transforms have been overridden.
public void MergeBones(Sandbox.SceneModel parent)
Update our bones to match the target's bones. This is a manual bone merge.
public void ResetAnimParameters()
Reset all animgraph parameters to their default values.
public void RunPendingEvents()
public void SetAnimGraph(string name)Obsolete
Override the anim graph this scene model uses
Obsolete: Can use AnimationGraph directly
public void SetBodyGroup(string name, int value)
Set which body group to use.
public void SetBoneOverride(int boneIndex, Transform transform)
Manually override the final bone transform.
Parameters
transform: Local coordinates based on the SceneModel's transform
public void SetBoneWorldTransform(int boneIndex, Transform transform)
Sets the world space bone transform of a bone by its index.
Parameters
boneIndex: Bone index to set transform of.
public void SetMaterialGroup(string name)
Set material group to replace materials of the model as set up in ModelDoc.
public void Update(float delta)
Update this animation. Delta is the time you want to advance, usually RealTime.Delta
public void UpdateToBindPose()
Update all of the bones to the bind pose
No results match this filter.
Properties
Showing 11 properties
public Sandbox.AnimationGraph Sandbox.SceneModel.AnimationGraph { get; set; }
public Sandbox.AnimationSequence Sandbox.SceneModel.CurrentSequence { get; set; }
Allows playback of sequences directly, rather than using an animation graph. Requires `Sandbox.SceneModel.UseAnimGraph` disabled if the scene model has one.
public Sandbox.AnimGraphDirectPlayback Sandbox.SceneModel.DirectPlayback { get; set; }
Access this sceneobject's direct playback. Direct playback is used to control the direct playback node in an animgraph to play sequences directly in code
public Sandbox.MorphCollection Sandbox.SceneModel.Morphs { get; set; }
Access this sceneobject's morph collection. Morphs are generally used in the model to control the face, for things like emotions and lip sync.
public System.Action`1<Sandbox.SceneModel.AnimTagEvent> Sandbox.SceneModel.OnAnimTagEvent { get; set; }
Called when a anim tag event happens
public System.Action`1<Sandbox.SceneModel.FootstepEvent> Sandbox.SceneModel.OnFootstepEvent { get; set; }
Called when a footstep event happens
public System.Action`1<Sandbox.SceneModel.GenericEvent> Sandbox.SceneModel.OnGenericEvent { get; set; }
Called when a generic event happens
public System.Action`1<Sandbox.SceneModel.SoundEvent> Sandbox.SceneModel.OnSoundEvent { get; set; }
Called when a sound event happens
public float Sandbox.SceneModel.PlaybackRate { get; set; }
public Transform Sandbox.SceneModel.RootMotion { get; set; }
Get the calculated motion from animgraph since last frame
public bool Sandbox.SceneModel.UseAnimGraph { get; set; }
Allows the scene model to not use the anim graph so it can play sequences directly
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.SceneModel |