-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Remove scene/3d/model_*.h
from FBX pull request
#88680
Conversation
e41fee1
to
b1fb7c4
Compare
b1fb7c4
to
0c01996
Compare
c8991bf
to
d0e5cf3
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.
Mostly approving topmost commit (Remove scene/3d/model_*.h from FBX commit.)
consolidating ModelDocument back into GLTFDocument (and same for ModelState) drastically simplifies the code and avoids any compatibility breakage.
The only change I would like to request is to have FBXDocument inherit from Resource (really it should be RefCounted but it doesn't matter) instead of GLTFDocument, and re-declare the three public methods rather than relying on inheritance.
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.
Ah, I missed that some of the common code ended up back in GLTFDocument. I don't want to complicate this change, so I think it's fine to have FBXDocument extend GLTFDocument.
LGTM
This update introduces a new import method for FBX files using ufbx. If the fbx2gltf import fails, it will use the most recently cached scene from the ufbx import. The process is sped up by introducing threads to load the ufbx portion. Key changes include: - Support for importing geometry helper nodes in FBX files. - Addition of cameras and lights with updated names. - Removal of the fbx importer manager. - Introduction of ModelDocument3D and updates to its methods. - Changes to FBX import options and visibility. - Updating the documentation and handling some errors. - Store the original non-unique node, mesh and animation names in FBX and glTF. Co-Authored-By: bqqbarbhg <bqqbarbhg@gmail.com>
- ModelDocument3D is completely dependent on gltf, so we can't have it in `scene`, it breaks the build with gltf disabled, and is super hacky. It was even depending on the FBX module, so I copied a helper method to work it around. * So I moved it back to the gltf module. Needs further work to actually make it a proper abstraction, but currently this is not it. - The gltf module should NOT depend on fbx. Modules are meant to be MODULAR, they can't have circular dependencies like this. In theory, the fbx module should also not depend on gltf, but I see we're far from that goal, so I made the dependency explicit (fbx can't be enabled if gltf is disabled). - Thus, I renamed and moved the FBX2glTF importer to the fbx module. The hack used to find which importer to use, where each importer refers to the other one, is really hacky... This also will need to be fixed. But I'm aware it's dependent on a bug report, which I linked in a comment. - Renamed `filesystem/import/fbx/enabled` to `fbx2gltf`, since it doesn't control ufbx. - Please please pay attention to includes, I'm tired of having to clean them up. I didn't do a full review but I finally noticed that the forward declares of core types in `gltf_defines.h`, combined with your IWYU-style IDE plugin that always re-adds all includes, is a very cursed combo. So I nuked the forward declares, if you want to always include everything, let's not do it twice...
d0e5cf3
to
6bd1a34
Compare
Updated to fix merge conflict in |
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.
I am confused on what exactly this is about but the docs are almost just fine.
Update GLTFDocument inheritance, method names, and parameters. Refactor FBXDocument methods for consistency with GLTFDocument. Update FBX and GLTF importers to use boolean flag for helper nodes.
6bd1a34
to
e376762
Compare
Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>
scene/3d/model_*.h
from FBX pull request
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.
Looks good to me. This should be merged back into #81746, and squashed before merge.
ClassDB::bind_method(D_METHOD("write_to_filesystem_from_data", "state", "path"), | ||
&ModelDocument3D::write_to_filesystem_from_data); | ||
} | ||
} |
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.
Missing \n
at end of file.
}; | ||
|
||
#endif // MODEL_DOCUMENT_3D_H | ||
#endif // SKIN_TOOL_H |
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.
Same here.
#include "modules/gltf/structures/gltf_node.h" | ||
#include "modules/gltf/structures/gltf_skeleton.h" | ||
#include "modules/gltf/structures/gltf_skin.h" |
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.
The module's own includes should be relative paths.
#include "modules/gltf/structures/gltf_node.h" | |
#include "modules/gltf/structures/gltf_skeleton.h" | |
#include "modules/gltf/structures/gltf_skin.h" | |
#include "structures/gltf_node.h" | |
#include "structures/gltf_skeleton.h" | |
#include "structures/gltf_skin.h" |
#include "core/io/resource.h" | ||
|
||
#include "../gltf_defines.h" | ||
|
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.
This should be changed back, the convention for includes in modules is:
- Module-scoped includes first
- Rest of the engine (core, scene, etc.)
- Thirdparty
Merged into #81746 with the edits I listed above. |
As mentioned in #81746 (comment) here's the stacked commits.