JLouis-B / RedTools

Unpack and convert 3D models from CD Projekt games
http://jlouisb.users.sourceforge.net/
74 stars 10 forks source link

add an animation to the X file output #16

Open yisikawa opened 2 years ago

yisikawa commented 2 years ago

Request: Could you please add an animation to the X file output?

// Start of Animation AnimationSet idl { Animation { {Bone000} AnimationKey { 2; 2; 0; 3; 0.000000, 0.000000, 0.000000;;, 1; 3; 0.000000, 0.000000, 0.000000;;; } AnimationOptions { 0; 1; } ... }

Animation { {Bone001} ...

yisikawa commented 1 year ago

I did some research and found the following: else if (c == ABOCM_PackIn64bitsW) { b1 = readU8(dataFile); b2 = readU8(dataFile); b3 = readU8(dataFile); b4 = readU8(dataFile); b5 = readU8(dataFile); b6 = readU8(dataFile); b7 = readU8(dataFile); b8 = readU8(dataFile); x = y = z = w = 0; x = (irr::u16)(b2<<8 | b1); y = (irr::u16)(b4<<8 | b3); z = (irr::u16)(b6<<8 | b5); w = (irr::u16)(b8<<8 | b7);

                    fx = bits16ToFloat(x);
                    fy = bits16ToFloat(y);
                    fz = bits16ToFloat(z);
                    fw = -bits16ToFloat(w);
                }
yisikawa commented 1 year ago

The default seems to be Compression above

JLouis-B commented 1 year ago

Hello, sorry for the late reply. Indeed the code above is used to load the animations in the engine The problem is that the .x export (which is part of the assimp library) does not support animations. However, I would have to update assimp and my wrapper in the software to correct problems related to animation exports (but this will not solve the problem for DirectX export, it is still not supported by Assimp, and this format is no longer widely used I doubt that it is part of their roadmap) Unfortunately I don't have much time at the moment to work on this project

Do you have a particular reason to use this format rather than another one like fbx/gltf ? This format is almost dead so I'm curious if you need it or if you just need a format to export animations, whatever it is. If you ever want to investigate in the code and try to improve it, you have to look in the XFileExporter.cpp of the assimp library

yisikawa commented 1 year ago

Thank you for contacting me. I was wondering how this software achieves the animation? I was curious, but the only format I could understand was X. So I am not particular about the format. I will take a look at the source code you recommend.

I am Japanese so my English is not easy to understand, sorry.