August 24Aug 24 Localization I am attempting to write a Blender add-on for models from the PS2 release of Bob the Builder: Festival of Fun. However, I cannot figure out how primitives are generated from the vertices. It seems to store multiple positions for each vertex for some reason. I tried generating triangle strips from one of the position fields, but I think there is more to it than that. I've attached the Blender add-on, a Python script I wrote a while ago for unpacking DATA2.BIN, and a couple of sample files. Also, here is a partial ImHex pattern for the models:struct Vec2f { float x; float y; } [[single_color]]; struct Vec3f { float x; float y; float z; } [[single_color]]; struct Matrix { float row_0[4]; float row_1[4]; float row_2[4]; float row_3[4]; } [[single_color]]; struct Vertex { Vec3f; float; Vec3f; float; Vec3f; float; Vec3f; u8 indices_0[4]; Vec3f normal; u8 indices_1[4]; Vec2f uv; u8 color[4]; u8 indices_2[4]; } [[single_color]]; struct Mesh { u32 vert_count; u32; u32; u32; u32; u32; u32; u32; Vertex vertices[vert_count]; }; struct MeshInfo { u32 offset; u32; u32; u32; Mesh mesh @ offset; }; struct MeshTable<T, auto MeshCount> { MeshInfo mesh_info_entries[MeshCount]; }; struct ModelInfo { u16 mesh_count; u16 bone_count; u32 mesh_table_off; u32 unk_off; u32 name_off; MeshTable<u32, mesh_count> mesh_table @ mesh_table_off; }; struct Header { u32; u16 model_count; u16 bone_count; u32 models_off; u32 pids_off; u32 transforms_off; ModelInfo models[model_count] @ models_off; s16 pids[bone_count] @ pids_off; Matrix bone_transforms[bone_count] @ transforms_off; }; Header header_at_0x00 @ 0x00; btb_ps2_importer.zip btb_ps2_unpacker.py BTB PS2 Samples.zip
Create an account or sign in to comment