Class Model
Represents a Unity GameObject and its properties for export.
Inherited Members
Namespace: TriLibExporter.Objects
Assembly: Assembly-CSharp.dll
Syntax
public class Model : ObjectBase
Constructors
Model(AssetWriterContext, GameObject)
Initializes a new instance of the Model class.
Declaration
public Model(AssetWriterContext assetWriterContext, GameObject gameObject)
Parameters
| Type | Name | Description |
|---|---|---|
| AssetWriterContext | assetWriterContext | The asset writer context. |
| GameObject | gameObject | The Unity GameObject to represent. |
Fields
BindPosition
The bind pose position of the model.
Declaration
public Vector3 BindPosition
Field Value
| Type | Description |
|---|---|
| Vector3 |
BindRotation
The bind pose rotation of the model.
Declaration
public Quaternion BindRotation
Field Value
| Type | Description |
|---|---|
| Quaternion |
BindScale
The bind pose scale of the model.
Declaration
public Vector3 BindScale
Field Value
| Type | Description |
|---|---|
| Vector3 |
Bones
A list of bones associated with the model.
Declaration
public List<Model> Bones
Field Value
| Type | Description |
|---|---|
| List<Model> |
Camera
The camera representation associated with the model, if applicable.
Declaration
public Camera Camera
Field Value
| Type | Description |
|---|---|
| Camera |
Children
A collection of child models of this model.
Declaration
public IList<Model> Children
Field Value
| Type | Description |
|---|---|
| IList<Model> |
CustomAttributes
Custom attributes associated with the model.
Declaration
public CustomAttributes CustomAttributes
Field Value
| Type | Description |
|---|---|
| CustomAttributes |
GameObject
The Unity GameObject this model represents.
Declaration
public GameObject GameObject
Field Value
| Type | Description |
|---|---|
| GameObject |
GeometryGroup
The geometry group associated with the model, if applicable.
Declaration
public GeometryGroup GeometryGroup
Field Value
| Type | Description |
|---|---|
| GeometryGroup |
GlobalPosition
The global position of the model.
Declaration
public Vector3 GlobalPosition
Field Value
| Type | Description |
|---|---|
| Vector3 |
GlobalRotation
The global rotation of the model.
Declaration
public Quaternion GlobalRotation
Field Value
| Type | Description |
|---|---|
| Quaternion |
GlobalScale
The global scale of the model.
Declaration
public Vector3 GlobalScale
Field Value
| Type | Description |
|---|---|
| Vector3 |
IsBone
Indicates whether the model is a bone.
Declaration
public bool IsBone
Field Value
| Type | Description |
|---|---|
| bool |
IsRootBone
Indicates whether the model is the root bone.
Declaration
public bool IsRootBone
Field Value
| Type | Description |
|---|---|
| bool |
Light
The light representation associated with the model, if applicable.
Declaration
public Light Light
Field Value
| Type | Description |
|---|---|
| Light |
LocalPosition
The local position of the model.
Declaration
public Vector3 LocalPosition
Field Value
| Type | Description |
|---|---|
| Vector3 |
LocalRotation
The local rotation of the model.
Declaration
public Quaternion LocalRotation
Field Value
| Type | Description |
|---|---|
| Quaternion |
LocalScale
The local scale of the model.
Declaration
public Vector3 LocalScale
Field Value
| Type | Description |
|---|---|
| Vector3 |
MaterialGroup
The material group associated with the model, if applicable.
Declaration
public MaterialGroup MaterialGroup
Field Value
| Type | Description |
|---|---|
| MaterialGroup |
Parent
The parent model of this model, if applicable.
Declaration
public Model Parent
Field Value
| Type | Description |
|---|---|
| Model |
RootBone
The root bone associated with the model, if applicable.
Declaration
public Model RootBone
Field Value
| Type | Description |
|---|---|
| Model |
Static
Indicates whether the model is static.
Declaration
public bool Static
Field Value
| Type | Description |
|---|---|
| bool |
Visible
Indicates whether the model is visible in the hierarchy.
Declaration
public bool Visible
Field Value
| Type | Description |
|---|---|
| bool |
Methods
FixNegativeScale()
Adjusts the scale of the model to remove negative values and updates children accordingly.
Declaration
public void FixNegativeScale()
GetAllChildren()
Retrieves all descendants of the model, including itself, in a recursive manner.
Declaration
public IEnumerable<Model> GetAllChildren()
Returns
| Type | Description |
|---|---|
| IEnumerable<Model> | An enumerable collection of all descendants. |
GetChildCount(Model)
Recursively counts the number of children and descendants of the specified parent model.
Declaration
public static int GetChildCount(Model parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | parent | The parent model. |
Returns
| Type | Description |
|---|---|
| int | The total count of children and descendants. |
GetLocalMatrix()
Gets the local transformation matrix of the model.
Declaration
public Matrix4x4 GetLocalMatrix()
Returns
| Type | Description |
|---|---|
| Matrix4x4 | The local transformation matrix. |
GetLocalToWorldMatrix()
Gets the local-to-world transformation matrix of the model.
Declaration
public Matrix4x4 GetLocalToWorldMatrix()
Returns
| Type | Description |
|---|---|
| Matrix4x4 | The local-to-world transformation matrix. |
GetWorldToLocalMatrix()
Gets the world-to-local transformation matrix of the model.
Declaration
public Matrix4x4 GetWorldToLocalMatrix()
Returns
| Type | Description |
|---|---|
| Matrix4x4 | The world-to-local transformation matrix. |
SetParent(Model)
Sets the parent of the model and updates its local transformation accordingly.
Declaration
public void SetParent(Model parent)
Parameters
| Type | Name | Description |
|---|---|---|
| Model | parent | The new parent model. |
ToString()
Returns the string representation of the model.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The name of the model. |
Overrides
UpdateBindPose()
Updates the bind pose properties for bones associated with the model.
Declaration
public void UpdateBindPose()
UpdateGlobalPosition(Vector3)
Updates the global position of the model and adjusts its local position accordingly.
Declaration
public void UpdateGlobalPosition(Vector3 globalPosition)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector3 | globalPosition | The new global position of the model. |