Gildor's Forums

Author Topic: StaticMesh format  (Read 4078 times)
peterbjornx
Newbie
*
Posts: 11


View Profile WWW
StaticMesh format
« on: October 23, 2011, 03:44 »

I'm writing my own staticmesh exporter, but i've run into a problem, my reference reader is a bit vague:

- I do not have the code for UnObject so i dont know what super::serialize usually reads/writes
- BodySetup and CollisionModel are pointers, how does << treat them  (are they fully written) ??

Code:
Super::Serialize(Ar);

Ar << Bounds;
Ar << BodySetup;
Ar << CollisionModel;
Ar << kDOPTree;

if(Ar.IsSaving() && !RawTriangles.Num())
RawTriangles.Load();
Ar << RawTriangles;

if( Ar.IsLoading() )
    {
Ar << InternalVersion;
}
    else if( Ar.IsSaving() )
    {
InternalVersion = STATICMESH_VERSION;
Ar << InternalVersion;
    }

Ar << Materials;
Ar << Vertices;

PositionVertexBuffer.Update();
TangentVertexBuffer.Update();

Ar << UVBuffers << IndexBuffer << WireframeIndexBuffer << Edges;
Ar << ShadowTriangleDoubleSided;
Ar << ThumbnailAngle;

if( Ar.Ver() < 182 )
{
INT DeprecatedStreamingTextureFactor;
Ar << DeprecatedStreamingTextureFactor;
}
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7975



View Profile WWW
Re: StaticMesh format
« Reply #1 on: October 23, 2011, 09:59 »

I can see you've obtained old UE3 source somewhere (note - it is not compatible with either UE2 nor UE3 Wink).

"Super" is a typedef, see DECLARE_CLASS macro for details. It points to the parent class.
"<<" for pointers is an UObject link serialization operator. Look for operator<<(..., UObject*) in FArchive and ULinkerLoad.
Logged
peterbjornx
Newbie
*
Posts: 11


View Profile WWW
Re: StaticMesh format
« Reply #2 on: October 23, 2011, 13:31 »

can you help me out on the staticmesh format used by the udk then?
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7975



View Profile WWW
Re: StaticMesh format
« Reply #3 on: October 23, 2011, 13:48 »

It's very complex. Plus, umodel can handle a lot of different versions of the mesh formats (even UDK has a lot of format variations during its development).

Your question does not look like "help me", it's more close to "do this for me" Sad

Again, if you want to make a CONVERTER from one package format to another (despite I've told you that this is impossible), you'll need to read a COMPLETE mesh (and a lot of other Unreal engine classes too), while I'm reading only the first half of data until acquire everything needed for mesh representation. I'm not handling collision, physics, data for shadow generation etc.
Logged
peterbjornx
Newbie
*
Posts: 11


View Profile WWW
Re: StaticMesh format
« Reply #4 on: October 23, 2011, 14:27 »

i've dropped the converter idea, although i managed to extract scripts and materials from the converted packages but mesh and texture format had changed so i am trying to make a simple extracter now, ill fix the format differences via debugging like i did before, also, does StaticMesh have any properties that get saved by SerializeTaggedProperties?
« Last Edit: October 23, 2011, 14:37 by peterbjornx » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7975



View Profile WWW
Re: StaticMesh format
« Reply #5 on: October 23, 2011, 15:37 »

i am trying to make a simple extracter now
do you really think umodel is simple application??
Quote
does StaticMesh have any properties that get saved by SerializeTaggedProperties?
Umodel reads oly materials array property from the StaticMesh.
Logged
peterbjornx
Newbie
*
Posts: 11


View Profile WWW
Re: StaticMesh format
« Reply #6 on: October 23, 2011, 16:07 »

whoa , dont feel insulted, i never said umodel was simple, i said I am going to make a simple exporter for myself, and on the subject: how do you determine how many bytes to skip to get to the begin of whats written in staticmesh::Serialize
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7975



View Profile WWW
Re: StaticMesh format
« Reply #7 on: October 23, 2011, 19:07 »

whoa , dont feel insulted
I'm not insulted Wink
Quote
I am going to make a simple exporter for myself
you can easily make something like my "extractor" tool (which do not perform data analysis), but implementation of the something like "umodel -export ..." is complex
Quote
how do you determine how many bytes to skip to get to the begin of whats written in staticmesh::Serialize
it is not possible, you should analyze property data in order to skip them (that's side effect of Unreal serialization architecture)
Logged
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS