Closed TJYSunset closed 3 months ago
Yeah sounds about right, or more precisely it should return the components for the ufbx_node.local_transform
, which you can of course convert to a matrix using ufbx_transform_to_matrix()
(or manually for that matter).
Sorry for the lack of documentation, this is quite a new feature I've added. I wrote some initial descriptions but didn't have time to merge them yet:
https://github.com/ufbx/ufbx/blob/edb6c505e50d5aed13740add09c8026c2c49c2fe/ufbx.h#L4210-L4285
I haven't encountered the issue you're seeing yet myself though, and there's not that much that can go wrong. I'd recommend double checking that you're not mixing up element_id
(refers to ufbx_scene.elements[]
) and typed_id
(refers to ufbx_scene.nodes[]
). The dual ID setup is a bit confusing, but I'm not sure how it could be improved.
Another thing you can try is seeing if ufbx_evaluate_transform()
returns reasonable values, or even ufbx_evaluate_scene()
, in case the animations in the file itself are broken. Let me know if you find anything, otherwise I'd need more context to tell what could be going wrong.
Turns out it's yet another exporter problem...
node_to_world
s can't be mapped to actual coordinates at all).geometry_to_bone
s under some configurations (they can be mapped to actual coordinates, but things just don't work).Changing the exporter settings and constructing bone matrices using ufbx_skin_cluster.geometry_to_bone
instead of ufbx_node.node_to_world
solved my particular issue. Ironic how FBX is still the exchange format with the least compatibility problems.
I could provide a sample of funny FBX later if you're interested. (By "later" I mean I have to make a new dummy model, because I sculpted my own "production" model and I'm not proud enough of how ugly it looks to share publicly.)
Interesting, thanks for the update! I try to mitigate the FBX issues as much as I can but the format/exporters always finds a way to surprise.. Using geometry_to_bone
is the correct thing to do for skinning, hopefully it'll be more clear when I get the real documentation done.
As for funny FBXs, I'm always interested, more cursed the better :D If you don't want to share models publicly you can also send them to bqqbarbhg
gmail.com
and I can put it in my private dataset. However, if you're feeling extra generous and can share it as CC-BY (or CC0), I can add it to the public dataset that gets run on CI. No pressure about the file though, no need to spend too much time on it.
Here's a dummy mesh generated with Skinify Rig on Auto-Rig Pro 3.69.13*'s default human armature, with a linear IK interpolation from T-Pose to a random pose, exported with all default presets and two whacky configurations.
* Not the latest version (3.69.43) available, I haven't updated for a while while working on my engine.
Public Domain / CC0, if this thing is actually copyrightable.
Not tested in my engine to not work, because the engine is currently a multi-part dumpster fire that doesn't accept arbitrary meshes, not yet committed to Git because that whole submodules crap... If these all look normal, I'll try generating something backed by code.
Feel free to close this issue if deemed appropriate (apparently the last time I closed too arbitrarily...)
Thanks, I'll take a look at it when I have time!
And no sweat about closing issues, etc. I just have a habit of following up on resolved issues just in case there's an angle that can be used to improve ufbx in the future. I'll keep this one open until I can check the file in case there's something actually off with ufbx.
Thanks a ton again for the files, finally managed to get them to the dataset tests! (upgraded the physical machine from RPI4 to RPI5 yesterday and added some threading, runtime went from 24min to ~3min)
Seems like the files work just fine using check_fbx.c, which is used to compare it to a reference .obj file exported from Maya in this case. Ran the tests both with ufbx_bake_anim()
and without.
Is it correct to assert
ufbx_bake_anim()
returns the effectivenode_to_parent
s at each specific keyframe, that already haven taken space conversions into account?Sorry for my stupidity, but I'm getting Lovecraftian deities for my skeletal animation playback (while getting the correct T-pose when using the original
node_to_parent
), and would appreciate some concrete info on how this library works to narrow down the cause.