Jump to content

Recommended Posts

Posted

can anybody help me with reversing a skeleton file 

what to look for in hex and how to identify the values i should look for to understand structure of the rig file

Posted
51 minutes ago, shak-otay said:

That's not explained in one post because it requires 2nd level knowledge, imho, after having done the basic stuff for reversing  meshes.

If you've done so already: for the skeleton you could try use Durik's skelfinder, I'd suggest to read the two posts here.

How to use this tool ?

  • Engineers
Posted (edited)

edit 3: ok, the tool SkelFinder on Durik's Github page and the script (tool_SkelFinder.py) are different things. Sorry for the confusion.

Maybe there was a tutorial on xentax, don't remember, so the best way, imho, is learning by doing:

link1 link2 link3

Of course you'll need to read/understand the whole threads behind these links, more or less.

(If you don't want to start now I strongly suggest to download the samples in each starting post because links may expire when you hesitate too long...)

 

edit 2: for AXE please do a forum search.

Edited by shak-otay
Posted (edited)
21 minutes ago, shak-otay said:

Maybe there was a tutorial on xentax, don't remember, so the best way, imho, is learning by doing:

link1 link2 link3

Of course you'll need to read/understand the whole threads behind these links, more or less.

(If you don't want to start now I strongly suggest to download the samples in each starting post because links may expire when you hesitate too long...)

edit: ok, seems I missed the most important info, using skelfinder with Noesis, wait a moment

Is there any available tutorials for AXE too ?

Also, thank you very much

Edited by haruse31
Posted
34 minutes ago, shak-otay said:

Maybe there was a tutorial on xentax, don't remember, so the best way, imho, is learning by doing:

link1 link2 link3

Of course you'll need to read/understand the whole threads behind these links, more or less.

(If you don't want to start now I strongly suggest to download the samples in each starting post because links may expire when you hesitate too long...)

edit: ok, seems I missed the most important info, using skelfinder with Noesis, wait a moment

Name of the script is tool_SkelFinder.py (see Github page of Durik256)

After having copied it to Noesis\plugins\python\

in Noesis, Tools check menue point Display Plugin Tools

click line Skel Finder and this window should pop up:

Skel Finder.png

edit 2: for AXE please do a forum search.

Could you please give me a link for the plugin tool_SkelFinder.py as I can't find it on Durik256's GitHub

  • Engineers
Posted
4 minutes ago, haruse31 said:

Could you please give me a link for the plugin tool_SkelFinder.py as I can't find it on Durik256's GitHub

Guess, the script is outdated. Use the tool on Github as it's the one which Durik used in the above mentioned 3 links.

Posted (edited)
1 hour ago, shak-otay said:

Guess, the script is outdated. Use the tool on Github as it's the one which Durik used in the above mentioned 3 links.

Sorry to bother, I identified bone count and the marker FF FF FF FF at the end of a block, but still I get no good results, only errors. Can you help please? How to identify rotation matrix

Edited by haruse31
  • Engineers
Posted
22 minutes ago, haruse31 said:

Sorry to bother, I identified bone count and the marker FF FF FF FF at the end of a block, but still I get no good results, only errors. Can you help please?

Which sample?

Quote

How to identify rotation matrix

I assume you know what "floats" are and know their hex representation?

Posted (edited)
7 minutes ago, shak-otay said:

Which sample?

I assume you know what "floats" are and know their hex representation?

Okay I found this in hex, bone count is 0x5C at offset 0x8, i guess these "00 00 80 3F" is rotation matrix ?

There's this "FF FF FF FF" marker tooimage.png.0355269c8e13a6db83efce9a902228c9.png

image.png.e97f0061e6a6ffa62792a306166cc79a.png

Edited by haruse31
  • Engineers
Posted

Thanks!

Problems: the FFFF isn't part of a bone indices block.  And on a quick glance I don't see the bones' (parenting) IDs blocks.

There's no bone names.

Is there a mesh file for the wolverine?

Posted
4 minutes ago, shak-otay said:

Thanks!

Problems: the FFFF isn't part of a bone indices block.  And on a quick glance I don't see the bones' (parenting) IDs blocks.

There's no bone names.

Is there a mesh file for the wolverine?

Yes, but as far as I know it doesn't have bones. Here it is.


Component 0 has header, mesh declarations, FVF Declarations
 

Component 1 has vertex buffer and index buffer

s1_wolverine000.component0.zip

Do you want me to provide more details? I have full structure of the model file and an import script for Blender

  • Engineers
Posted

A blender outliner screenshot where all the wolverine sub meshes/elements are displayed would be nice.

The full structure would be helpful, too, to assure that there's no skeleton related data "hidden" somewhere.

Posted (edited)
52 minutes ago, shak-otay said:

A blender outliner screenshot where all the wolverine sub meshes/elements are displayed would be nice.

The full structure would be helpful, too, to assure that there's no skeleton related data "hidden" somewhere.

 

Quote


mesh count: 0xc (2 in case of wolverine)
bmin: 0x24
bmax: 0x30
mesh table start: 0x50 (mesh count * 8 bytes) (16 in case of wolverine)
then alignment to 16-byte boundary



MeshDecl_1
starts at 0x60
skips 32 bytes (0x20)
reaches 0x80
reads 14 unsigned ints (56 bytes, 0x38 bytes)
count3 (bone palette count) , count 6 (vertex count), count 10(index count)
after reading 56 bytes
reads bone palette
which is (count 3* 2) bytes (count3 is 25 in case of wolverine mesh 1)
bone palette = 25 * 2 bytes = 50
then alignment to 4-byte boundary
afterwards read stride, mag1, and mag2 (3*4 = 12 bytes)

FVF_Declarations 1
read fvf delcarations [8 bytes each] until terminator sentinel (FF 00 00 00 11 00 00 00)

then alignment to 16-byte boundary

MeshDecl_2
starts at 0x140
skips 32 bytes (0x20)
reaches 0x160
reads 14 unsigned ints (56 bytes, 0x38 bytes)
count3 (bone palette count) , count 6 (vertex count), count 10(index count)
after reading 56 bytes
reads bone palette
which is count 3 * 2 bytes (count3 is 46 in case of wolverine mesh 2)
bone palette = 46 * 2 bytes = 92
afterwards read stride, mag1, and mag2 (3*4 = 12 bytes)


FVF_Declarations 2 
read fvf declarations [8 bytes each] until terminator sentinel (FF 00 00 00 11 00 00 00)

then alignment to 16-byte boundary

 

Edit 1: Yes read bone palette is part of the script but i am not sure what they are actually and if they get read or not by the script

 

 

Edit 2: Added Importer Script

 

 

image.thumb.png.ac67e5adff3b463cc18eb4aaf609e01a.png

SMWOS_MESH_Importer (2) (3).py

Edited by haruse31
  • Thanks 1
  • Engineers
Posted (edited)

Where did you get bone count?

Quote

Problems: the FFFF isn't part of a bone indices block.

This is most probably bone id and in most cases it is a root. But I may be wrong...

This is my guess-work...

//------------------------------------------------
//--- 010 Editor v14.0 Binary Template
//
//      File: 
//   Authors: 
//   Version: 
//   Purpose: 
//  Category: 
// File Mask: 
//  ID Bytes: 
//   History: 
//------------------------------------------------
LittleEndian();OutputPaneClear();

uint16 Unknown_0;
uint16 Unknown_1;
uint32 Unknown_2;
uint32 BoneCount;
uint32 Unknown_3;

struct 
{
    float Unknown_0[16];
    struct
    {
        float Mat00,Mat01,Mat02,Mat03,
              Mat10,Mat11,Mat12,Mat13,
              Mat20,Mat21,Mat22,Mat23,
              Mat30,Mat31,Mat32,Mat33;
    }Matrix4x4;
    uint16 Unknown_1;
    uint16 Unknown_2;
    uint32 Unknown_3;
    uint32 Unknown_4;
    uint32 Unknown_5;
}BoneInfo[BoneCount]<optimize=false>;

 

Edited by h3x3r
  • Engineers
Posted (edited)

@haruse31: thanks. But you should expand the outliner to the details, of course.

Are there vertex groups?

In the structure it reads "reads bone palette". Is this part of the script?

So yes, the script would be helpful, since I get bogus with hex2obj:

(seems I need to subtract an offset when x coordinates exceeds some value,

so I need the averages but for performance reasons I calculated them only for VertexBlock_VShort_UVs_Word() )

mesh_viewer_SyJLDtf75G.png

mesh_viewer_iRULCIE7gH.png

Edited by shak-otay
Posted
20 minutes ago, shak-otay said:

@haruse31: thanks. But you should expand the outliner to the details, of course.

Are there vertex groups?

In the structure it reads "reads bone palette". Is this part of the script?

So yes, the script would be helpful, since I get bogus with hex2obj:

mesh_viewer_SyJLDtf75G.png

mesh_viewer_iRULCIE7gH.png

Red herring info on the offsets/counts/etc?

  • Engineers
Posted (edited)

ok, the script from mariokart64n reads two bone palettes from the ..0.MESH file.

That's the bone IDS I wrote of. So one palette for each mesh, highest bone IDs are 86 and67.

Some ids are missing, some appear in both palettes. Strange.

There's several RAW FVF tuples. FVF usually means "flexible vertex format", afaik (so should not be related to bone ids?)

 

edit: sadly the bone palettes (which I thought to be bone ID hierarchy tables) in the ..0.mesh file were totally misleading.

All IDs can be found in the .SKEL file instead.

Edited by shak-otay
Posted (edited)
15 hours ago, shak-otay said:

ok, the script from mariokart64n reads two bone palettes from the ..0.MESH file.

That's the bone IDS I wrote of. So one palette for each mesh, highest bone IDs are 86 and67.

Some ids are missing, some appear in both palettes. Strange.

There's several RAW FVF tuples. FVF usually means "flexible vertex format", afaik (so should not be related to bone ids?)

Okay, so someone helped me and figured out the skeleton.
Here's a Noesis script
image.png.4fff1143c7082570716fc73a0fe24668.png

 

fmt_spidermanskel.py

Edited by haruse31
  • Thanks 1
  • Engineers
Posted

I assume it's from Durik256.

For a tutorial it's required to change it like so, imho, to make understandable where the parentIDs come from:

        parentID = bs.readInt(); print(i, parentID)
        joints.append(NoeBone(i, "joint_"+ str(i), jMat, None, parentID))   

 

Posted
4 minutes ago, shak-otay said:

I assume it's from Durik256.

For a tutorial it's required to change it like so, imho, to make understandable where the parentIDs come from:

        parentID = bs.readInt(); print(i, parentID)
        joints.append(NoeBone(i, "joint_"+ str(i), jMat, None, parentID))   

 

It is from Joschka. 
By the way, could you please give me a brief explanation of the structure based on the Noesis script? I'm trying to fully understand it so I can make a Blender import script.

  • Thanks 1
  • Engineers
Posted (edited)
52 minutes ago, haruse31 said:

It is from Joschka.

Joschka from former Xentax? Great to see he's still active. Somewhere.

Quote

By the way, could you please give me a brief explanation of the structure based on the Noesis script? I'm trying to fully understand it so I can make a Blender import script.

I'm not too familiar with Noesis details. But since it's a very short script it should be doable. I'd insert a print line like so to get the addresses of the bone matrices.

        bs.readBytes(0x40)
        print(i, "addr mat", hex(bs.tell())) 

Basically it's 92 bones (or "joints") with their matrices (rotation and position).

You'll need to handle a "matrix 4x4 to a matrix 4x3 transformation" including inversion.

From Noesis you could export the skeleton to .smd to see the bones' structure (last number in line is parenting bone id, first bone has no parent, thus -1) :

nodes
  0 "joint_0"  -1
  1 "joint_1"  0
  2 "joint_2"  1

...

edit: I strongly recommend to start with the positions only and care for the rotations in a second step.

Edited by shak-otay
  • Thanks 1
Posted
23 hours ago, shak-otay said:

Joschka from former Xentax? Great to see he's still active. Somewhere.

I'm not too familiar with Noesis details. But since it's a very short script it should be doable. I'd insert a print line like so to get the addresses of the bone matrices.

        bs.readBytes(0x40)
        print(i, "addr mat", hex(bs.tell())) 

Basically it's 92 bones (or "joints") with their matrices (rotation and position).

You'll need to handle a "matrix 4x4 to a matrix 4x3 transformation" including inversion.

From Noesis you could export the skeleton to .smd to see the bones' structure (last number in line is parenting bone id, first bone has no parent, thus -1) :

nodes
  0 "joint_0"  -1
  1 "joint_1"  0
  2 "joint_2"  1

...

edit: I strongly recommend to start with the positions only and care for the rotations in a second step.

Hi i come from the same place as him, its a discord server

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...