Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » W3D Blender  () 3 Votes
Re: W3D Blender [message #480676 is a reply to message #467704] Wed, 08 May 2013 18:08 Go to previous messageGo to previous message
yesfish is currently offline  yesfish
Messages: 16
Registered: May 2012
Karma:
Recruit
Here is a working prototype of the xml<->w3d python module I mentioned in the last post. The purpose of being a standard library and reference for the format...

https://github.com/huwpascoe/w3d/blob/master/w3d_elem.py

Currently can only w3d->XML files. The code is much nicer than what I was doing last year but I know the format well now.

Every chunk is defined in a simple array and read with a small set of functions. Once it's done you'll be able to both use it to read-write w3d files (if you have a python project) or use it as a reference for the format.

So neat and clear!
    {
        'name'          : 'mesh_user_text',
        'code'          : 0x0000000C,
        'attrib'        : [['', 'string']]
    },
    {
        'name'          : 'vertex_influences',
        'code'          : 0x0000000E,
        'subname'       : 'id',
        'subattrib'     : [['', 'uint16'], ['_padding', 'uint8', 6]]
    },
    {
        'name'          : 'mesh_header3',
        'code'          : 0x0000001F,
        'attrib'        : [
            ['Version', 'version'],
            ['Attributes', 'uint32'],
            ['MeshName', 'name'],
            ['ContainerName', 'name'],
            ['NumTris', 'uint32'],
            ['NumVertices', 'uint32'],
            ['NumMaterials', 'uint32'],
            ['NumDamageStages', 'uint32'],
            ['SortLevel', 'sint32'],
            ['PrelitVersion', 'version'],
            ['FutureCounts', 'uint32'],
            ['VertexChannels', 'uint32'],
            ['FaceChannels', 'uint32'],
            ['Min', 'vector3'],
            ['Max', 'vector3'],
            ['SphCenter', 'vector3'],
            ['SphRadius', 'float32']
        ]
    },


Still todo:

enter and/or figure out remaining unimplemented chunks (52 left to go)
verify that I correctly guessed the format of the vaguely commented chunks
check data formats (right now everything is barfed out as a string)
XML -> w3d function
utility functions, make it a module.

I don't know when it will be finished.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Is anyone still producing maps/etc for this game?
Next Topic: White Smoke Effect
Goto Forum:
  


Current Time: Sun Dec 22 05:04:55 MST 2024

Total time taken to generate the page: 0.01353 seconds