Directors Cut Wiki : MeshFiles

DirectorsCutModdingFoundry Categories PageIndex RecentChanges RecentlyCommented Login/Register
Trail: CategoryTutorials FlmExtras MeshManip BusStopWilly PageIndex HeadFiles PasswordForgotten MeshFiles

Most recent edit on 2009-02-17 12:56:06 by Gleem! [Added the original code back in. Effit, CBA to modify it.]

Additions:
These are the data files that hold all information about the 3D Data the game uses to draw everything, from actors to props to sets.

Technical File Info



010 Editor v2.1.3 Binary Template

File: LH The Movies Mesh file format (.msh)
Author: Glen Rickey (Adapted wholly from Rob Ashton & Mark Andrews work)
Revision: 0.01
Purpose: To parse msh files, for the purpose of troubleshooting

#include "VecMatrix.bt"
#include "CompressedU16.bt"
struct TMMesh
{
struct Head
{
int32 Magic;
int32 TextureCount;
int32 MaterialCount;
int32 SubMeshCount;


struct {

ubyte RESERVED : 1;
ubyte ContainsFootprint : 1;
ubyte ContainsPhysic : 1;
ubyte RemoveHeadFromCostume : 1;
ubyte RemoveHairFromCostume : 1;
ubyte IsAutoAnimated : 1;
ubyte ReplaceDummyTexByFace : 1;
ubyte ContainsConvexHull : 1;
} Flags1;

struct {
ubyte ContainsFootprint2 : 1;
ubyte ContainsShapes : 1;
ubyte ContainsAntiPhysic : 1;
ubyte ContainsShadow : 1;
ubyte ContainsCollision : 1;
ubyte ContainsBlue : 1;
ubyte ContainsChildMesh : 1;
ubyte ContainsRooms : 1;
} Flags2;

struct {




} head;

struct
{
struct Texture
{
char TextureName[32];
} Textures[head.TextureCount] <optimize=false>;
} TextureList;

struct
{
struct Materials

struct {

ubyte WrapU;
ubyte WrapV;
ubyte IsAlphaTextured;

ubyte IsAlphaTestEnable;
ubyte IsGlass;
ubyte IsWater;
ubyte IsDeadWater;


struct {
ubyte IsInvisible : 1;
ubyte IsNotZWrite : 1;
ubyte ContainsUV : 1;
ubyte IsSelfIluminated : 1;
ubyte DontCastShadowOnFloor : 1;
ubyte DontDelayDrawIfTransparent : 1;
ubyte NeedTriangleSorting : 1;
ubyte IsAdditive : 1;
} Flags1;

ubyte ALIGN;

#include "ColorRGBA.bt"
color Diffuse;


ubyte SpeedU;
ubyte SpeedV;
ubyte SpeedRotUV;
ubyte ALIGN2;
}
} MaterialList[head.MaterialCount] <optimize=false>;

} MaterialList;

LOW POLY MESH DEF

struct LowPolyMesh
{
struct LowPolyMeshHeader
{
uint16 CountVertices;
uint16 TypeLandscapeTexture;
uint16 CountTriangle;
uint16 ALIGN;

} LPMHead;
V3 Vertices[LPMHead.CountVertices];
int16 Indexes[LPMHead.CountTriangle * 3];

if ((LPMHead.CountTriangle & 1))
{
uint16 ALIGN;
}


} ;


Load any Low Poly Meshes
if ( head.ContainsSelection > 0 )
{
LowPolyMesh Selection;
}

if ( head.Flags2.ContainsCollision > 0 )
{
LowPolyMesh Collision;
}

if ( head.Flags2.ContainsShadow > 0 )
{
LowPolyMesh Shadow;
}

if ( head.Flags1.ContainsPhysic > 0 )
{
LowPolyMesh Physic;
}

if ( head.Flags2.ContainsAntiPhysic > 0 )

if ( head.Flags1.ContainsFootprint > 0 )
{
LowPolyMesh Footprint;
}

if ( head.Flags2.ContainsFootprint2 > 0 )

if ( head.Flags2.ContainsRooms > 0 )
{
if ( head.CountRooms > 0 )
{
struct Room
{
char RoomName[32];
LowPolyMesh Room;
} Rooms[head.CountRooms] <optimize=false>;
}
}

if (head.SubMeshCount > 0 )
{
struct SubMesh
{
ubyte CountPrimitives;
ubyte REMOVED;
struct
{
ubyte IsStaticAnimated : 1;
ubyte IsLeaderForCarriableObject : 1;
ubyte : 0;
} Flags1;
struct
{
ubyte REMOVED2 : 1;
ubyte REMOVED3 : 1;
ubyte IsLand : 1;
ubyte IsHideReflection : 1;
ubyte ContainsHiddenPart : 1;
ubyte : 0;
} Flags2;

Matrix34 Pivot;

if ( Flags2.ContainsHiddenPart > 0 )
{
uint16 HiddenPartOn;
uint16 HiddenPartOff;
}

struct Primitive
{
struct
{
ubyte IsBoned : 1;
ubyte IsReflectiveFloor : 1;
ubyte IsNotSupportingOutLine : 1;
ubyte IsLandscapeLayer : 1;
ubyte ContainsPrimitiveID : 1;
ubyte IsCompressed : 1;
ubyte ContainsNeckInfo : 1;
ubyte IsReceivingPeopleShadow : 1;
ubyte : 0;
} Flags1;

struct
{
ubyte IsUV2 : 1;
ubyte IsClockNeedle : 2; 0: no, 1 short, 2
long ubyte IsNonAnimatedBackdrop : 1;
ubyte : 0;
} Flags2;

ubyte BonePerVertex;
ubyte IsWebCam;

if (Flags1.ContainsPrimitiveID > 0)
{
int32 ID_Indices;
int32 ID_Vertices;
int32 ID_Bones;
}

if (Flags1.IsCompressed > 0 )
{
V3 PosMin;
V3 PosMax;
V2 UVMin;
V2 UVMax;
V2 UV2Min;
V2 UV2Max;
}


Triangles (faces)
uint16 FaceIDs[CountTriangle * 3];

if (CountTriangle & 1)
{
uint16 ALIGN;
}
struct Vert
{
U16F x;
U16F y;
U16F z;
} Vertices [CountVertices];
struct Norm
{
U16F x;
U16F y;
U16F z;
} Normals [CountVertices];
struct UV
{
U16F x;
U16F y;
} UVs [CountVertices];


if (Flags2.IsUV2)
{
struct UV2
{
U16F x;
U16F y;
} UV2s [CountVertices];
}
Bone Weights
if (Flags1.IsBoned)
{
struct Weight
{
float weightval[4];
ubyte BoneID[4];
} Weights[CountVertices];
}

Neck Data
if (Flags1.ContainsNeckInfo > 0)
{
if (CountNeckInfo > 0)
{
struct
{
int Index;
int Position;
} NeckInfo [CountNeckInfo];
}
}
} Primitives[CountPrimitives] <optimize=false>;

} SubMeshes[head.SubMeshCount] <optimize=false>;

}

Bones
if (head.ContainsSkeleton > 0)
{

struct
{

struct Bone
{
char BoneName[32];
int IndexFather;
Matrix34 Pose;
} Bones[CountBones];
} Skeleton;

}
/*
Static Anims ?
if (head.ContainsStaticAnimated > 0)
{
struct StaticAnimatedHeader
{
char Name[32];


struct {
ubyte IsCarriable : 1;
ubyte ContainsScale : 1;
ubyte IndexLikeMe : 4;
ubyte IsMoreThanOneLikeMe : 1;
} Flags1;

ubyte IndexSkeleton; valid for carriable object only
uint16 ALIGN;
if (Flags1.ContainsScale > 0 )
{
float Scale;
}
} StaticAnim;
}
*/
Submesh Names (Groups)
if (head.Flags3.ContainsNameSubMeshes > 0 | head.ContainsStaticAnimated > 0)
{
struct
{
char GroupName[32];
} Groups[head.SubMeshCount];
}

Locations ?
if (head.CountLocations > 0)
{
struct
{
char Name[32];
Matrix34 Pos3D;

} Locations[head.CountLocations];
}

Convex Hull ?
if (head.Flags1.ContainsConvexHull > 0 )
{
struct
{
int Size;
int16 Count1;
int16 Count2;
U16F flt[4];
float Pos[6];
struct t1
{
U16F x;
U16F y;
} thing [Count1];
struct t2
{
int16 Count3;
int16 Count4;
float fl[4];
U16F Iflt[2];
float fl1[Count3 * 3];
} thing2[Count1 + 1] <optimize=false>;


if (head.Flags2.ContainsShapes > 0)
{
struct
{
int Unknown;
Matrix34 PosMatrix;
V3 Pos;
} Shapes [head.CountShapes];
}
} MshFile;


Deletions:
These are the data files that hold all information about the 3D Data the game uses to draw everything, from actors to props to sets.

Technical File Info

%%




Oldest known version of this page was edited on 2007-12-11 12:56:32 by Gleem! [Added 010 Template]
Page view:
These are the data files that hold all information about the 3D Data the game uses to draw everything, from actors to props to sets.

Technical File Info

Valid XHTML 1.0 Transitional Valid CSS Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0905 seconds