-
-
Notifications
You must be signed in to change notification settings - Fork 19.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.3] FBX importer rewrite #42941
[3.3] FBX importer rewrite #42941
Conversation
c113e52
to
18cde7f
Compare
5af73c3
to
621398b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't look in depth at the actual code as it's not my area of expertise, so I mostly left formatting/style comments.
Please also amend thirdparty/README.md
to properly document the provenance of the thirdparty/assimp_fbx/
files, which commit they're from, and how to sync with upstream.
Similarly, COPYRIGHT.txt
should have a change from ./thirdparty/assimp/
to ./thirdparty/assimp_fbx/
.
@akien-mga This can never ever be sync'd with assimp this is our own parser there is literally no way to merge them, I will mention this in the readme. It is heavily rewritten in some areas and can't be patched from assimp. We heavily customised the document parser to remove:
Will get on the rest of the review stuff though thanks, I appreciate you spending time doing this, as it's a lot to review I will get on these today. The only reason it still exists in third party is the licensing requirements. |
82db4e6
to
76aea78
Compare
OK ready for review again @akien-mga Tested with bistro too @reduz so should be good :) Will put a trailer out for this too. (video/YT) |
76aea78
to
0551b7f
Compare
Removed some dead code I found while I was doing my own review |
0551b7f
to
0b3052b
Compare
Static checks are gonna fail this is WIP now for the refactoring required |
b762b97
to
a355e0f
Compare
Okay ready for round 2 reviews! @akien-mga @reduz |
a355e0f
to
f87d7a0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are not really using Assimp, I would probably get rid of the namespace.
17767dc
to
3ba7994
Compare
Done :) |
Co-authored-by: Gordon MacPherson <gordon@gordonite.tech> Co-authored-by: Andrea Catania <info@andreacatania.com> Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com> This is a complete rewrite of the importer. It will give more deterministic behaviour and has been sponsored by IMVU inc, over 1 year has gone into the development of this importer to remove the burden of the FBX SDK. This was my project for 1 entire year and I really enjoyed the opportunity to add to Godot. Along the road of implementing fixes we implemented fbx pivots, animations and inheritance type handling, which in most cases works properly. We have implemented animation and mesh skinning too this should work out of the box, if there are issues let us know. It's designed so that you can expand this with ease, and fix bugs easily too. It can import from Autodesk Maya and import into Godot, with pivots. There are bits we could polish but for now this is good enough. Additional fixes made before upstreaming: - fixed memory leaks - ensure consistent ordering on mac linux and windows for fbx tree. (very important for material import to be deterministic) - disabled incorrect warnings for fbx_material - added compatibility code for /RootNode/ so compat is not broken - Optimise FBX - directly import triangles - remove debug messages - add messages for mesh id, mesh re-import is sometimes slow and we need to know what mesh is being worked on - Document no longer uses unordered maps - Removed some usages of &GetRequiredToken replaced with safe *GetRequiredToken() function - Added parser debugging - Added ERR_FAIL_CONDS for unsupported mesh formats (we can add these later super easy to do now) - Add memory debugging for the Tokens and the TokenParser to make it safe - Add memory initialisation to mesh.cpp surface_tool.h and mesh.h - Initialise boolean flags properly - Refactored to correct naming for the fbx_mesh_data.h so you know what data you are working on - Disabled corruption caused by the FIXME: - Fixed document reading indexes and index_to_direct vs indexes mode - Fixed UV1 and UV2 coordinates - Fixed importer failing to import version 7700 files - Replaced memory handling in the FBX Document with pointers, before it was dereferencing invalid memory. - Fixed typed properties - Improved Document API - Fixed bug with ProcessDOMConnection() not working with the bool flag set to true. - Fixed FBX skinning not deforming for more than one single mesh - Fixed FBX skeleton mapping and skin mapping not being applied properly (now retrieved from document skin list) - Fixed set_bone_pose being used in final version() - Fixed material properties exceeding 1.0. - FBX Document parser revamped to use safe memory practices, and with graceful error messages. - ScopePtr, TokenPtr and various internal types have been fleshed out to use proper typedefs across the codebase. - Fixed memory leaks caused by token cleanup failing (now explicit cleanup step, no shared_ptr, etc) - Fixed bug with PropertyTable not reading all properties and not cleaning up properly. - Fixed smoothing groups not working - Fixed normal duplications - Fixed duplication check for pre-existing coordinates. - Fixed performance of vertex lookup in large meshes being slow, using lookup table separate to the data for indexing, this reduces import time from 10 minutes of bistro down to 30 seconds. - Fixed includes requiring absolute path in headers and cpp files using CPPPath. Bugs/Features wish list: - locator bones - quat anim key interpolation (most fbx maya files have euler rotations from blender and maya, nobody uses this) - some rigs skins scale up when SSC enabled inconsistently per bone - some skins can disappear entirely - material mapping needs expanded, but this will be done for 4.0 as it requires rewrite. Workarounds for issues found until we patch them: - mesh -> clear skin can resolve most of the bugs above. - locators can be worked around by removing them before exporting your rig. - some material properties wont always import, this is okay to override in the material properties. **If you are having issues or need support fear not!** Please provide minimal rigs which can reproduce issues as we can't spend a lot of time investigating each rig. We need a small example which breaks and we can then sort the problem. In some cases this is not possible so its okay to privately send models to us via IRC or a ticket and we can provide an email address, we won't reveal or disclose privately sent rig files to any companies, or to companies I work for, they will not be shared, only tested and bugs will be drawn up from the conclusions. Also include identifying information about what you did and how it didn't work. Please file each file separately in a bug report, unless the problem is the same. This was sponsored by IMVU, and a special thanks to everyone who supported this project. Signed-off-by: Gordon MacPherson <gordon@gordonite.tech>
3ba7994
to
8197a61
Compare
Fixed file-format (i added newlines to make the file width better for git) in README.md |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good!
Thanks a ton for this huge and amazing improvement! |
<3 so happy |
Yes, awesome job!!! |
Any of this going to be upstreamed to mainline assimp? |
great work !, does gltf also depend on assimp ? and if so is there going to be a rewrite for gltf aswel ? |
Why was this PR merged into 3.2 instead of master? This is a huge change so it's extremely likely to cause regressions (and it has). Such things are not really appropriate for a stable branch. Additionally, regardless of whether it would be accepted into 3.2, PRs should target master as that's where development happens and the source of all future stable release branches (see here). |
@aaronfranke Because we decided to make an exception. I know the policy, I wrote it. There's a matching PR for the Godot 4.0 changes things significantly around the import pipeline, which makes the two versions of the PR difficult to keep in sync at all times, and there are outstanding issues that @RevoluPowered needs to solve in the TL;DR: @reduz and I agreed to make an exception to the policy. That doesn't change the policy. |
Why should I have to justify release management decisions all the time? |
Geez guys, can you have a bit more common sense instead of wasting time discussing rules for the sake of it? FBX is almost unusable in its current state. Anything not a box will most likely break when you import it. This PR fixes pretty much every problem and lets you import massively complex scenes without issue. Yes, it may break compatibility a bit, but do you think any user really cares about that when in exchange they can have an importer that will work with anything they throw at? It also needs testing as soon as possible because there is a company paying for it that will fix any further problem that users have wit it. If we wait until 4.0 is out, it may no longer be the case by then. This is why the PR is aimed mainly at 3.2 and then it will be ported to 4.0 as an exception. Really, just try to make an effort to see the whole picture before going into pointless rants. This is not the first time it happens, so If you need us explaining you the decisions all the time while others seem to grasp them fine, either try to get more involved in the development process so you can understand them better too or, if this is not possible, then at least try to assume that those deciding on these things have a good judgment and trust them. If you have any doubts about it, simply ask them privately or better yet, on IRC,, so any other contributor can answer you too. |
The same can be said about the new navigation system, but this wasn't backported to 3.2. @akien-mga As you said, this is an exception. I am not questioning whether or not you know the policy you wrote, I am questioning the exceptions. The explanation you gave is perfectly fine. @reduz I don't really see the problem with asking this publicly on GitHub, other people may have the same concerns and not everyone uses IRC. For archival purposes, it's also much more difficult to dig up an IRC log instead of just looking at the PR. Sometimes @akien-mga posts IRC snippets on GitHub, perhaps this should be done more often? |
The navigation system, while not really usable for complex use cases in 3.2.x, is still relied on by many people in production for various needs. The new NavigationServer API isn't quite comparable at all, so upgrading can take a while. It's a bit different from the current FBX support, as I believe nobody was relying on it beforehand. |
@Calinou The new navigation system can be used in roughly the same manner as it is today. Bake navmesh -> call With the announcement that 4.0 will only have Vulkan, users who cannot use Vulkan and will be stuck on 3.x version will not have this until they can update to 4.1 which will be 2022 at best. |
This is not the topic, but I don't remember ever saying that the new NavigationServer API couldn't be backported to the So if a contributor wants to make a backport that doesn't break compatibility for 3.2 users, then it can be considered to be integrated in a 3.2.x release eventually. (Not making any promise here, but it can be assessed in the PR.) |
Is embedded collision support being planned? Example, mymodel, mymodel_collision .. mymodel2, mymodel2_collision and so on.,,,, will embedded standard pbr maps be detected automatically? |
The FBX importer currently doesn't have any active maintainer, so I wouldn't expect new features to be added to it anytime soon (not for 4.0 at least). |
Co-authored-by: Gordon MacPherson gordon@gordonite.tech
Co-authored-by: Andrea Catania info@andreacatania.com
Co-authored-by: K. S. Ernest (iFire) Lee ernest.lee@chibifire.com
This is a complete rewrite of the importer. It will give more deterministic behaviour and has been sponsored by IMVU inc, over 1 year has gone into the development of this importer to remove the burden of the FBX SDK.
This was my project for 1 entire year and I really enjoyed the opportunity to add to Godot.
Along the road of implementing fixes we implemented FBX pivots, animations and inheritance type handling, which in most cases works properly.
We have implemented animation and mesh skinning too this should work out of the box, if there are issues let us know.
It's designed so that you can expand this with ease, and fix bugs easily too.
It can import from Autodesk Maya and import into Godot, with pivots.
There are bits we could polish but for now this is good enough.
This was sponsored by IMVU, and a special thanks to everyone who supported this project.
Signed-off-by: Gordon MacPherson gordon@gordonite.tech
Additional fixes made before upstreaming:
Bugs/Features wish list:
Workarounds for issues found until we patch them:
If you are having issues or need support fear not!
Please provide minimal rigs which can reproduce issues as we can't spend a lot of time investigating each rig. We need a small example which breaks and we can then sort the problem. In some cases this is not possible so its okay to privately send models to us via IRC or a ticket and we can provide an email address, we won't reveal or disclose privately sent rig files to any companies, or to companies I work for, they will not be shared, only tested and bugs will be drawn up from the conclusions. Also include identifying information about what you did and how it didn't work. Please file each file separately in a bug report, unless the problem is the same.