Parik27 / DragonFF

Blender Add-on to edit RenderWare and GTA Formats
GNU General Public License v3.0
366 stars 128 forks source link

Armature bones are broken from exported from DragonFF - (Multi-Mesh) and not from 3Ds Max. #236

Closed Redberd36 closed 1 year ago

Redberd36 commented 1 year ago

Hey @Psycrow101 or even Parik27 if they have an idea of what's going on with this issue, but rn I'm trying to get functioning .DFF animations to play decently for a mod I'm creating for SpongeBob Movie game. The idea is to make a custom Simple Object that has a rig attached to it.

While it exports just fine enough from 3Ds Max's .DFF exporter, the Blender Addon that I use to make everything creates a broken version of it. This is the same .DFF exported from Max, but then exported through the Blender Addon (Multi-Mesh) version. Even when not exported again from Max, it still has the same issues with some bones. (Maybe something to do with the bone_id and type Custom Properties idk.)

image image

My working theory is that somehow the bones are being displaced within the game and not in blender when previewing it. Can even see it here when importing the .DFF from blender that the bones are spread out.

image (1)

Anyways, hope someone can give me a rundown of how the bones are being exported since I could try to figure it out by myself to fix the coordinates to match more with Max.

Redberd36 commented 1 year ago

Update:

I figured out a way to fully export the model using only Blender with weight painting stuff, but it requires the "type" values to be set correctly on some bones. If one of you could explain to me how the .DFF Importer converts the exported Max .DFF properties "childNum" / "tag" into "types", if there's some other calculation method that determines it would be awesome to know!

Here's some stuff I've stumbled upon researching, but since you wrote the code for it I'm sure you already know it front to back lol:

image (2)

Maybe

Parik27 commented 1 year ago

The bone type is imported and exported as-is from the DFF file. They are stored in the custom properties of the bone. See:

image

Redberd36 commented 1 year ago

I don't really believe you considering that there is somewhere in the python .DFF importer where it is converting the "tag" and "childNum" properties into "bone_id" and "type" unless you're using a reference table or something lol.

In any case I figured out the pattern for giving the parent and child bones the correct values every time now. Still would've been cool to know how those scripts worked, but this also does the job. Thanks for the response at least!

image

Parik27 commented 1 year ago

I don't really believe you considering that there is somewhere in the python .DFF importer where it is converting the "tag" and "childNum" properties into "bone_id" and "type" unless you're using a reference table or something lol.

That code isn't in DragonFF (at least not on the main repository).