Skip to content

Commit

Permalink
FBX Importer Rewrite
Browse files Browse the repository at this point in the history
Co-authored-by: Gordon MacPherson <[email protected]>
Co-authored-by: Andrea Catania <[email protected]>
Co-authored-by: K. S. Ernest (iFire) Lee <[email protected]>

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 <[email protected]>

Additional fixes made before upstreaming:
- fixed memory leak
- 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
- correct culling settings on materials
  • Loading branch information
RevoluPowered committed Aug 20, 2020
1 parent 9bf5a0b commit 9947061
Show file tree
Hide file tree
Showing 284 changed files with 12,451 additions and 71,282 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# Documentation generated by doxygen or from classes.xml
doc/_build/

# Clangd for vim
.clangd/

# Javascript specific
*.bc

Expand All @@ -15,7 +18,6 @@ cmake-build-debug
.gradle
local.properties
*.iml
.idea
.gradletasknamecache
project.properties
platform/android/java/app/libs/*
Expand Down
3 changes: 2 additions & 1 deletion editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const {

const VariantContainer *v = props.getptr(*k);

if (v->hide_from_editor)
if (v->hide_from_editor) {
continue;
}

_EVCSort vc;
vc.name = *k;
Expand Down
2 changes: 0 additions & 2 deletions editor/import/resource_importer_scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ Ref<Animation> EditorSceneImporter::import_animation(const String &p_path, uint3
//and you want to load the resulting file

Node *EditorSceneImporter::import_scene_from_other_importer(const String &p_path, uint32_t p_flags, int p_bake_fps) {

return ResourceImporterScene::get_singleton()->import_scene_from_other_importer(this, p_path, p_flags, p_bake_fps);
}

Expand Down Expand Up @@ -185,7 +184,6 @@ String ResourceImporterScene::get_resource_type() const {
}

bool ResourceImporterScene::get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const {

if (p_option.begins_with("animation/")) {
if (p_option != "animation/import" && !bool(p_options["animation/import"]))
return false;
Expand Down
4 changes: 3 additions & 1 deletion main/tests/test_basis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ Basis EulerToBasis(RotOrder mode, const Vector3 &p_rotation) {
}

Vector3 BasisToEuler(RotOrder mode, const Basis &p_rotation) {

switch (mode) {
case EulerXYZ:
return p_rotation.get_euler_xyz();
Expand Down Expand Up @@ -135,6 +136,7 @@ String get_rot_order_name(RotOrder ro) {
}

bool test_rotation(Vector3 deg_original_euler, RotOrder rot_order) {

// This test:
// 1. Converts the rotation vector from deg to rad.
// 2. Converts euler to basis.
Expand Down Expand Up @@ -316,7 +318,7 @@ void test_euler_conversion() {
}

MainLoop *test() {
OS::get_singleton()->print("Start euler conversion checks.\n");
OS::get_singleton()->print("Start euler conversion check.\n");
test_euler_conversion();

return NULL;
Expand Down
5 changes: 5 additions & 0 deletions main/tests/test_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const char **tests_get_names() {
"gd_bytecode",
"ordered_hash_map",
"astar",
"basis",
NULL
};

Expand Down Expand Up @@ -150,6 +151,10 @@ MainLoop *test_main(String p_test, const List<String> &p_args) {
return TestAStar::test();
}

if (p_test == "basis") {
return TestBasis::test();
}

print_line("Unknown test: " + p_test);
return NULL;
}
Expand Down
94 changes: 0 additions & 94 deletions modules/assimp/SCsub

This file was deleted.

Loading

0 comments on commit 9947061

Please sign in to comment.