summaryrefslogtreecommitdiff
path: root/modules/fbx
diff options
context:
space:
mode:
Diffstat (limited to 'modules/fbx')
-rw-r--r--modules/fbx/data/fbx_mesh_data.cpp4
-rw-r--r--modules/fbx/editor_scene_importer_fbx.cpp7
-rw-r--r--modules/fbx/editor_scene_importer_fbx.h5
3 files changed, 12 insertions, 4 deletions
diff --git a/modules/fbx/data/fbx_mesh_data.cpp b/modules/fbx/data/fbx_mesh_data.cpp
index 2b29f4d97e..643a74f83e 100644
--- a/modules/fbx/data/fbx_mesh_data.cpp
+++ b/modules/fbx/data/fbx_mesh_data.cpp
@@ -1092,7 +1092,7 @@ HashMap<int, R> FBXMeshData::extract_per_vertex_data(
const int vertex_index = get_vertex_from_polygon_vertex(p_mesh_indices, polygon_vertex_index);
ERR_FAIL_COND_V_MSG(vertex_index < 0, (HashMap<int, R>()), "FBX file corrupted: #ERR05");
ERR_FAIL_COND_V_MSG(vertex_index >= p_vertex_count, (HashMap<int, R>()), "FBX file corrupted: #ERR06");
- const int index_to_direct = p_mapping_data.index[polygon_vertex_index];
+ const int index_to_direct = get_vertex_from_polygon_vertex(p_mapping_data.index, polygon_vertex_index);
T value = p_mapping_data.data[index_to_direct];
aggregate_vertex_data[vertex_index].push_back({ polygon_id, value });
}
@@ -1297,7 +1297,7 @@ HashMap<int, T> FBXMeshData::extract_per_polygon(
} else {
ERR_FAIL_INDEX_V_MSG(polygon_index, (int)p_fbx_data.index.size(), (HashMap<int, T>()), "FBX file is corrupted: #ERR62");
- const int index_to_direct = p_fbx_data.index[polygon_index];
+ const int index_to_direct = get_vertex_from_polygon_vertex(p_fbx_data.index, polygon_index);
T value = p_fbx_data.data[index_to_direct];
aggregate_polygon_data[polygon_index].push_back(value);
}
diff --git a/modules/fbx/editor_scene_importer_fbx.cpp b/modules/fbx/editor_scene_importer_fbx.cpp
index e03680010b..4cca907bf2 100644
--- a/modules/fbx/editor_scene_importer_fbx.cpp
+++ b/modules/fbx/editor_scene_importer_fbx.cpp
@@ -83,7 +83,7 @@ uint32_t EditorSceneFormatImporterFBX::get_import_flags() const {
return IMPORT_SCENE;
}
-Node3D *EditorSceneFormatImporterFBX::import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps,
+Node3D *EditorSceneFormatImporterFBX::import_scene(const String &p_path, uint32_t p_flags, const Map<StringName, Variant> &p_options, int p_bake_fps,
List<String> *r_missing_deps, Error *r_err) {
// done for performance when re-importing lots of files when testing importer in verbose only!
if (OS::get_singleton()->is_stdout_verbose()) {
@@ -1468,3 +1468,8 @@ void EditorSceneFormatImporterFBX::BuildDocumentNodes(
}
}
}
+Ref<Animation> EditorSceneFormatImporterFBX::import_animation(const String &p_path,
+ uint32_t p_flags, const Map<StringName, Variant> &p_options,
+ int p_bake_fps) {
+ return Ref<Animation>();
+}
diff --git a/modules/fbx/editor_scene_importer_fbx.h b/modules/fbx/editor_scene_importer_fbx.h
index a6ea8058a7..eebcb86409 100644
--- a/modules/fbx/editor_scene_importer_fbx.h
+++ b/modules/fbx/editor_scene_importer_fbx.h
@@ -127,7 +127,10 @@ public:
virtual void get_extensions(List<String> *r_extensions) const override;
virtual uint32_t get_import_flags() const override;
- virtual Node3D *import_scene(const String &p_path, uint32_t p_flags, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = nullptr) override;
+ virtual Node3D *import_scene(const String &p_path, uint32_t p_flags, const Map<StringName, Variant> &p_options, int p_bake_fps, List<String> *r_missing_deps, Error *r_err = nullptr) override;
+ virtual Ref<Animation> import_animation(const String &p_path,
+ uint32_t p_flags, const Map<StringName, Variant> &p_options,
+ int p_bake_fps) override;
};
#endif // TOOLS_ENABLED