Skip to main content

MeshPacker

A static class in Root.Township, Alta.Customization.

Merges the meshes of all cosmetic parts into a character's skinned meshes, one per LOD, remapping UVs into each part's place in the texture atlas. Used by CosmeticPacker.

Fields​

12 private and internal fields
MemberWhat it is
private static List<BoneWeight> boneWeightsShared buffer for merged bone weights.
private static List<int> indicesShared buffer for merged triangle indices.
private static Logger loggerNLog logger for this class.
private static List<Vector3> normalsShared buffer for merged normals.
private static List<Vector4> tangentsShared buffer for merged tangents.
private static List<Vector2> uvsShared buffer for merged, atlas-remapped UVs.
private static List<Vector3> verticesShared buffer for merged vertices.
private static List<BoneWeight> workingBoneWeightScratch buffer for one mesh's bone weights.
private static List<int> workingIntScratch buffer for one mesh's triangles.
private static List<Vector2> workingVector2Scratch buffer for one mesh's UVs.
private static List<Vector3> workingVector3Scratch buffer for one mesh's vertices and normals.
private static List<Vector4> workingVector4Scratch buffer for one mesh's tangents.

Methods​

MemberWhat it is
static async Task Pack(Dictionary<CosmeticPacker.PartId, ICosmeticMeshPartBase> map, Matrix4x4[] defaultBindposes, IEnumerable<CosmeticPacker.Input> parts, Mesh[] targetMeshes, bool? isUsingHeadParts, bool isAlphaBlending, int startingLOD, CancellationToken cancellation)Merges matching parts (by alpha blending and head or body) into the target meshes; with a head flag it only packs startingLOD. Uses impeded LODs when a part is impeded.