Class ModelExtract
- Namespace
- ValveResourceFormat.IO
- Assembly
- ValveResourceFormat.dll
Extracts Source 2 models to editable vmdl/dmx format.
public class ModelExtractInheritance
Inherited Members
Constructors
ModelExtract(Resource, IFileLoader)
Initializes a new instance of the ValveResourceFormat.IO.ModelExtract class.
public ModelExtract(Resource modelResource, IFileLoader fileLoader)Parameters
modelResourceResourcefileLoaderIFileLoader
ModelExtract(Mesh, string)
Initializes a new instance of the ValveResourceFormat.IO.ModelExtract class.
public ModelExtract(Mesh mesh, string fileName)Parameters
ModelExtract(PhysAggregateData, string)
Initializes a new instance of the ValveResourceFormat.IO.ModelExtract class.
public ModelExtract(PhysAggregateData physAggregateData, string fileName)Parameters
physAggregateDataPhysAggregateDatafileNamestring
Properties
AnimationsToExtract
Gets the list of animations to be extracted with their output file names.
public List<(Animation Anim, string FileName)> AnimationsToExtract { get; }Property Value
MaterialInputSignatures
Gets the material input signatures for mapping DirectX semantic names.
public Dictionary<string, Material.VsInputSignature> MaterialInputSignatures { get; }Property Value
ModelName
Gets the model name from either the model resource or the file name.
public string ModelName { get; }Property Value
PhysHullsToExtract
Gets the list of physics hulls to be extracted with their output file names.
public List<(HullDescriptor Hull, string FileName)> PhysHullsToExtract { get; }Property Value
PhysMeshesToExtract
Gets the list of physics meshes to be extracted with their output file names.
public List<(MeshDescriptor Mesh, string FileName)> PhysMeshesToExtract { get; }Property Value
PhysicsCollisionTags
Gets the physics collision tag sets associated with the current aggregate data.
public HashSet<string>[] PhysicsCollisionTags { get; }Property Value
PhysicsSurfaceNames
Gets the physics surface property names discovered in the aggregate data.
public string[] PhysicsSurfaceNames { get; }Property Value
- string[]
PhysicsToRenderMaterialNameProvider
Gets or initializes the function to provide render material names for physics surface tags.
public Func<ModelExtract.SurfaceTagCombo, string> PhysicsToRenderMaterialNameProvider { get; init; }Property Value
RenderMeshesToExtract
Gets the list of render meshes to be extracted.
public List<ModelExtract.RenderMeshExtractConfiguration> RenderMeshesToExtract { get; }Property Value
SurfaceTagCombos
Gets the set of surface tag combinations.
public HashSet<ModelExtract.SurfaceTagCombo> SurfaceTagCombos { get; }Property Value
Translation
Gets or sets the translation offset for the model.
public Vector3 Translation { get; set; }Property Value
Type
Gets the extraction type to apply when generating assets.
public ModelExtract.ModelExtractType Type { get; init; }Property Value
Methods
ConvertMeshToDatamodelMesh(Mesh, string, DatamodelRenderMeshExtractOptions)
Converts a mesh to a datamodel mesh representation.
public static Datamodel ConvertMeshToDatamodelMesh(Mesh mesh, string name, ModelExtract.DatamodelRenderMeshExtractOptions options)Parameters
meshMeshnamestringoptionsModelExtract.DatamodelRenderMeshExtractOptions
Returns
- Datamodel
GetContentFiles_DrawCallSplit(Resource, IFileLoader, Vector3[], int)
Extracts content files from an aggregate model resource, splitting by draw calls.
public static IEnumerable<ContentFile> GetContentFiles_DrawCallSplit(Resource aggregateModelResource, IFileLoader fileLoader, Vector3[] drawOrigins, int drawCallCount)Parameters
aggregateModelResourceResourcefileLoaderIFileLoaderdrawOriginsVector3[]drawCallCountint
Returns
GetFragmentModelName(string, int)
Gets the fragment model name for a draw call index.
public static string GetFragmentModelName(string aggModelName, int drawCallIndex)Parameters
Returns
ToContentFile()
Converts the model to a content file with associated meshes and animations.
public ContentFile ToContentFile()Returns
ToDmxAnim(Model, Animation)
Converts an animation to DMX format.
public static byte[] ToDmxAnim(Model model, Animation anim)Parameters
Returns
- byte[]
ToDmxAnim(Skeleton, FlexController[], Animation)
Converts an animation to DMX format using skeleton and flex controllers.
public static byte[] ToDmxAnim(Skeleton skeleton, FlexController[] flexControllers, Animation anim)Parameters
skeletonSkeletonflexControllersFlexController[]animAnimation
Returns
- byte[]
ToDmxMesh(Mesh, string, DatamodelRenderMeshExtractOptions)
Converts a mesh to DMX format.
public static byte[] ToDmxMesh(Mesh mesh, string name, ModelExtract.DatamodelRenderMeshExtractOptions options = default)Parameters
meshMeshnamestringoptionsModelExtract.DatamodelRenderMeshExtractOptions
Returns
- byte[]
ToDmxMesh(HullDescriptor)
Converts a physics hull descriptor to DMX format.
public byte[] ToDmxMesh(HullDescriptor hull)Parameters
hullHullDescriptor
Returns
- byte[]
ToDmxMesh(MeshDescriptor)
Converts a physics mesh descriptor to DMX format.
public byte[] ToDmxMesh(MeshDescriptor mesh)Parameters
meshMeshDescriptor
Returns
- byte[]
ToDmxMesh(Hull, string, string, HashSet<string>, bool)
Converts a Rubikon hull shape to DMX mesh format.
public static byte[] ToDmxMesh(Hull hull, string name, string uniformSurface, HashSet<string> uniformCollisionTags, bool appendVertexNormalStream = false)Parameters
hullHullnamestringuniformSurfacestringuniformCollisionTagsHashSet<string>appendVertexNormalStreambool
Returns
- byte[]
ToDmxMesh(Mesh, string, string, HashSet<string>, string[], bool)
Converts a Rubikon mesh shape to DMX mesh format.
public static byte[] ToDmxMesh(Mesh mesh, string name, string uniformSurface, HashSet<string> uniformCollisionTags, string[] surfaceList, bool appendVertexNormalStream = false)Parameters
meshMeshnamestringuniformSurfacestringuniformCollisionTagsHashSet<string>surfaceListstring[]appendVertexNormalStreambool
Returns
- byte[]
ToValveModel()
Converts the model to Valve model format as a string.
public string ToValveModel()