Parik27 / DragonFF

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

exporting ped bones doesnt work correctly #345

Open riizom opened 2 weeks ago

riizom commented 2 weeks ago

Currently I am trying to export a custom object using GTA:SA standard bone set-up, which i took from a PED, because I am trying to create a map with custom animations in it. I realigned the bones to fit the object, added weight paint and everything needed to animate it. The current orientation in Blender looks like this: https://prnt.sc/-YD0ELLQg4rx When exporting the mesh with its bones selected, the ped in-game looks like this: https://prnt.sc/yp2bVH7TXNG1 Reimporting the freshly exported .dff with DragonFF shows, the the bone orientation is handled differntly from the mesh I assume. https://prnt.sc/okc8DruGlBIO Depending on the angle i set the bones to, the mesh is rotated with it since i parented them (Bones are the Parent object, Mesh is the child object (otherwise I get a crash) Of course applying transformations for both bones and mesh were done and tested on different axis, but each export shifts the mesh into another angle. I also tried to keep the original bone orientation when importing PEDs and taking their bone set-up and aligned the mesh to it. But when reimporting the .dff, the bones flip and the mesh shift away from the world origin. I took care of applying all transformation and setting correct pivot point: https://prnt.sc/LV28W_vvwT3K A solution for this could have been rotating the bones in edit mode and adjust the mesh again to it. I tried that out. But after reimporting the .dff after trying out that method, the mesh shifts again: https://prnt.sc/LUjPZFjMoIM5 That reimport, as any others, created an empty which stays in the correct posXYZ, but the object shifts to another location and also changes its rotation. When I select the mesh and change its posXYZ and rotXYZ transformations from this: https://prnt.sc/i2EHMgzBLBIT to zero on every transformation, then the object is alinged correct again. Another export/import creates the same problem. Changing the rotation order from XYZ to YXZ or ZYX or any other doesnt affect the export. Ingame, there isnt a change either: https://prnt.sc/HF1xPsPzhp9U The last thing i tried is keeping everything in positon after the last import and aligning the mesh in edit mode and keeping its changed transformations. Another reimport shows, that the bone orientation is correct now: https://prnt.sc/WGUQMDdTLOEL But importing the object into GTA resolves in this: https://prnt.sc/jp5rOx3Bzpp3

I really do not know what to do tbh. Rotatiting bones doesnt help, Wether in Object, nor edit mode. Same goes for the mesh itself. I mean, it wouldnt be a problem to keep the original bone rotation and adjust the weight paint to make proper animations, but the mesh just doesnt go along with it. every export is rigged as hell

Psycrow101 commented 2 weeks ago

@riizom can you send me the .blend project file?

riizom commented 2 weeks ago

For Psycrow101.zip

Try Exporting the Object and its bones both selected and just reimport it in Blender. The bones kinda stay the same but the mesh moves. Bone Transformations (pos and rot) stays on 0 but mesh transformations changes. Changing everything manually to zero repositions it correctly but another saves shifts it again resloving in the objects being imported wrong into the game

Psycrow101 commented 2 weeks ago

@riizom try to uncheck "Export As Frame" option for the mesh object

image

riizom commented 2 weeks ago

https://www.youtube.com/watch?v=YiK7IeJ9WjI&ab_channel=RizomTV

Unchecking works great, because the mesh does not get rotated, but somehow the game has other plans. A reimport into Blender works great. I tried to change the angles in the viewport and applied rotations but still get results like in the video

riizom commented 2 weeks ago

https://www.youtube.com/watch?v=DR9YaGHpGtU&ab_channel=RizomTV

More Info

Psycrow101 commented 2 weeks ago

I think it depends on the angles of the root bone. Try rotating the Root bone in Edit Mode

Psycrow101 commented 2 weeks ago

I noticed that you set the root bone as the parent of the mesh. Clear parent for GhostRay_red_quad and set the armature as parent again