Modelclass
A model.
Methods29
Showing 29 methods
public System.Collections.Generic.Dictionary`2<Sandbox.BoneCollection.Bone,Sandbox.GameObject> CreateBoneObjects(Sandbox.GameObject root)
Creates a dictionary of bone names to game objects, where each game object is a bone object in the scene.
| Parameter | Type | Description |
|---|---|---|
| root | GameObject | — |
public string GetAnimationName(int animationIndex)
Returns name of an animation at given animation index.
| Parameter | Type | Description |
|---|---|---|
| animationIndex | int | Animation index to get name of, starting at 0. |
stringName of the animation.Exceptions
| Exception | Condition |
|---|---|
ArgumentOutOfRangeException | Thrown when given index exceeds range of [0,AnimationCount-1] |
public string GetAttachmentName(int index)
Returns name of an attachment at given index.
Obsolete: This API member is obsolete.
| Parameter | Type | Description |
|---|---|---|
| index | int | Index of the attachment to look up, starting at 0. |
stringThe name of the attachment at given index.Exceptions
| Exception | Condition |
|---|---|
ArgumentOutOfRangeException | Thrown when given index exceeds range of [0,AttachmentCount-1] |
public int GetBaseVertex(int drawcall)
| Parameter | Type | Description |
|---|---|---|
| drawcall | int | — |
int—public string GetBoneName(int boneIndex)
Returns name of a bone at given bone index.
| Parameter | Type | Description |
|---|---|---|
| boneIndex | int | Bone index to get name of, starting at 0. |
stringName of the bone.Exceptions
| Exception | Condition |
|---|---|
ArgumentOutOfRangeException | Thrown when given index exceeds range of [0,BoneCount-1] |
public int GetBoneParent(int boneIndex)
Returns the id of given bone's parent bone.
| Parameter | Type | Description |
|---|---|---|
| boneIndex | int | The bone to look up parent of. |
intThe id of the parent bone, or -1 if given bone has no parent.Exceptions
| Exception | Condition |
|---|---|
ArgumentOutOfRangeException | Thrown when given index exceeds range of [0,BoneCount-1] |
public System.Collections.Generic.Dictionary`2<string,string[]> GetBreakCommands()
Internal function used to get a list of break commands the model has.
Dictionary<string,string[]>—public T GetData()
Extracts data from model based on the given type's ModelDoc.GameDataAttribute.
T—public int GetIndexCount(int drawcall)
| Parameter | Type | Description |
|---|---|---|
| drawcall | int | — |
int—public int GetIndexStart(int drawcall)
| Parameter | Type | Description |
|---|---|---|
| drawcall | int | — |
int—public uint[] GetIndices()
Experimental!
uint[]—public int GetMaterialGroupIndex(string groupIndex)
Retrieves the index of a material group given its name.
| Parameter | Type | Description |
|---|---|---|
| groupIndex | string | The name of the material group. |
intThe index of the material group, or a negative value if the group does not exist.public string GetMaterialGroupName(int groupIndex)
Returns name of a material group at given group index.
| Parameter | Type | Description |
|---|---|---|
| groupIndex | int | Group index to get name of, starting at 0. |
stringName of the group.Exceptions
| Exception | Condition |
|---|---|
ArgumentOutOfRangeException | Thrown when given index exceeds range of [0,MaterialGroupCount-1] |
public string GetMorphName(int morph)
Returns name of a morph controller at given index.
| Parameter | Type | Description |
|---|---|---|
| morph | int | Morph controller index to get name of, starting at 0. |
stringName of the morph controller at given index.Exceptions
| Exception | Condition |
|---|---|
ArgumentOutOfRangeException | Thrown when given index exceeds range of [0,MorphCount-1] |
public Sandbox.Vertex[] GetVertices()
Experimental!
public float GetVisemeMorph(string viseme, int morph)
Get morph weight for viseme.
| Parameter | Type | Description |
|---|---|---|
| viseme | string | — |
| morph | int | — |
float—public bool HasData()
Tests if this model has generic data based on given type's ModelDoc.GameDataAttribute. This will be faster than testing this via GetData]]>()
bool—public static Sandbox.Model Load(string filename)
Load a model by file path.
| Parameter | Type | Description |
|---|---|---|
| filename | string | The file path to load as a model. |
public static System.Threading.Tasks.Task`1<Sandbox.Model> LoadAsync(string filename)
Load a model by file path.
| Parameter | Type | Description |
|---|---|---|
| filename | string | The file path to load as a model. |
public byte[] SaveToVmdl()
byte[]—public System.Threading.Tasks.Task`1<byte[]> SaveToVmdlAsync()
Task<byte[]>—No results match this filter.
Properties33
Showing 33 properties
public int Sandbox.Model.AnimationCount { get; set; }
Number of animations this model has.
int—public System.Collections.Generic.IReadOnlyList`1<string> Sandbox.Model.AnimationNames { get; set; }
IReadOnlyList<string>—public Sandbox.AnimationGraph Sandbox.Model.AnimGraph { get; set; }
Get the animgraph this model uses.
public int Sandbox.Model.AttachmentCount { get; set; }
Returns amount of attachment points this model has.
Obsolete: This API member is obsolete.
int—public Sandbox.ModelAttachments Sandbox.Model.Attachments { get; set; }
Access to bones of this model.
public int Sandbox.Model.BodyGroupCount { get; set; }
Obsolete: Use Parts
int—public System.Collections.Generic.IEnumerable`1<Sandbox.Model.BodyPart> Sandbox.Model.BodyParts { get; set; }
Obsolete: Use Parts
public int Sandbox.Model.BoneCount { get; set; }
Number of bones this model has.
int—public Sandbox.BoneCollection Sandbox.Model.Bones { get; set; }
Access to bones of this model.
public static Sandbox.ModelBuilder Sandbox.Model.Builder { get; set; }
Returns a static `Sandbox.ModelBuilder` instance, allowing for runtime model creation.
public Sandbox.Model.CommonData Sandbox.Model.Data { get; set; }
public ulong Sandbox.Model.DefaultBodyGroupMask { get; set; }
Obsolete: Use Parts
ulong—public Sandbox.HitboxSet Sandbox.Model.HitboxSet { get; set; }
Access to default hitbox set of this model
public bool Sandbox.Model.IsError { get; set; }
Whether this model is an error model or invalid or not.
bool—public bool Sandbox.Model.IsProcedural { get; set; }
Whether this model is procedural, i.e. it was created at runtime via `Sandbox.ModelBuilder.Create`.
bool—public virtual bool Sandbox.Model.IsValid { get; set; }
bool—public int Sandbox.Model.MaterialGroupCount { get; set; }
Number of material groups this model has.
int—public System.Collections.Immutable.ImmutableArray`1<Sandbox.Material> Sandbox.Model.Materials { get; set; }
Retrieves an enumerable collection of all Materials on the meshes. This is fast, and cached. The order of these items is the same order used in ModelRenderer.Materials etc
public int Sandbox.Model.MeshCount { get; set; }
Total number of meshes this model is made out of.
int—public Sandbox.Model.ModelMeshInfo Sandbox.Model.MeshInfo { get; set; }
All mesh and draw call information for this model.
public int Sandbox.Model.MorphCount { get; set; }
Number of morph controllers this model has.
int—public Sandbox.ModelMorphs Sandbox.Model.Morphs { get; set; }
Access to bones of this model.
public string Sandbox.Model.Name { get; set; }
Name of the model, usually being its file path.
string—public Sandbox.ModelParts Sandbox.Model.Parts { get; set; }
Access to body parts of this model.
public Sandbox.PhysicsGroupDescription Sandbox.Model.Physics { get; set; }
public Sandbox.Engine.Utility.RayTrace.MeshTraceRequest Sandbox.Model.Trace { get; set; }
Trace against the triangles in this mesh
No results match this filter.