s&box docs

public sealed class Sandbox.SceneModel : Sandbox.SceneObject

A model scene object that supports animations and can be rendered within a `Sandbox.SceneWorld`.

Broader workflow and conceptual references connected to this API.

Constructors

Showing 2 constructors

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

Properties

Showing 11 properties

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.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

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.SceneModel

On this page

Constructorspublic SceneModel(Sandbox.SceneWorld sceneWorld, Sandbox.Model model, Transform transform)public SceneModel(Sandbox.SceneWorld sceneWorld, System.String model, Transform transform)Methodspublic System.Void ClearBoneOverrides()public System.Void DispatchTagEvents()public System.Nullable`1<Transform> GetAttachment(System.String name, System.Boolean worldspace = True)public Transform GetBoneLocalTransform(System.Int32 boneIndex)public Transform GetBoneLocalTransform(System.String boneName)public System.Void GetBoneVelocity(System.Int32 boneIndex, Vector3 linear, Vector3 angular)public Transform GetBoneWorldTransform(System.Int32 boneIndex)public Transform GetBoneWorldTransform(System.String boneName)public System.Boolean GetBool(System.String name)public System.Single GetFloat(System.String name)public System.Int32 GetInt(System.String name)public Transform GetParentSpaceBone(System.Int32 i)public Rotation GetRotation(System.String name)public Vector3 GetVector3(System.String name)public System.Boolean HasBoneOverrides()public System.Void MergeBones(Sandbox.SceneModel parent)public System.Void ResetAnimParameters()public System.Void RunPendingEvents()public System.Void SetAnimGraph(System.String name)public System.Void SetAnimParameter(System.String name, Rotation value)public System.Void SetAnimParameter(System.String name, System.Boolean value)public System.Void SetAnimParameter(System.String name, System.Int32 value)public System.Void SetAnimParameter(System.String name, System.Single value)public System.Void SetAnimParameter(System.String name, Vector3 value)public System.Void SetBodyGroup(System.String name, System.Int32 value)public System.Void SetBoneOverride(System.Int32 boneIndex, Transform transform)public System.Void SetBoneWorldTransform(System.Int32 boneIndex, Transform transform)public System.Void SetMaterialGroup(System.String name)public System.Void Update(System.Single delta)public System.Void UpdateToBindPose()Propertiespublic Sandbox.AnimationGraph Sandbox.SceneModel.AnimationGraph { get; set; }public Sandbox.AnimationSequence Sandbox.SceneModel.CurrentSequence { get; set; }public Sandbox.AnimGraphDirectPlayback Sandbox.SceneModel.DirectPlayback { get; set; }public Sandbox.MorphCollection Sandbox.SceneModel.Morphs { get; set; }public System.Action`1<Sandbox.SceneModel.AnimTagEvent> Sandbox.SceneModel.OnAnimTagEvent { get; set; }public System.Action`1<Sandbox.SceneModel.FootstepEvent> Sandbox.SceneModel.OnFootstepEvent { get; set; }public System.Action`1<Sandbox.SceneModel.GenericEvent> Sandbox.SceneModel.OnGenericEvent { get; set; }public System.Action`1<Sandbox.SceneModel.SoundEvent> Sandbox.SceneModel.OnSoundEvent { get; set; }public System.Single Sandbox.SceneModel.PlaybackRate { get; set; }public Transform Sandbox.SceneModel.RootMotion { get; set; }public System.Boolean Sandbox.SceneModel.UseAnimGraph { get; set; }Metadata