summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/fbx/doc_classes/EditorSceneImporterFBX.xml32
-rw-r--r--modules/fbx/editor_scene_importer_fbx.cpp22
-rw-r--r--modules/fbx/editor_scene_importer_fbx.h8
-rw-r--r--modules/fbx/register_types.cpp4
-rw-r--r--modules/gltf/doc_classes/EditorSceneImporterGLTF.xml9
-rw-r--r--modules/gltf/editor_scene_importer_gltf.cpp8
-rw-r--r--modules/gltf/editor_scene_importer_gltf.h4
-rw-r--r--modules/gltf/gltf_document.cpp8
-rw-r--r--modules/gltf/register_types.cpp4
9 files changed, 29 insertions, 70 deletions
diff --git a/modules/fbx/doc_classes/EditorSceneImporterFBX.xml b/modules/fbx/doc_classes/EditorSceneImporterFBX.xml
deleted file mode 100644
index 6f83871772..0000000000
--- a/modules/fbx/doc_classes/EditorSceneImporterFBX.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="EditorSceneImporterFBX" inherits="EditorSceneImporter" version="4.0">
- <brief_description>
- FBX 3D asset importer.
- </brief_description>
- <description>
- This is an FBX 3D asset importer with full support for most FBX features.
- If exporting a FBX scene from Autodesk Maya, use these FBX export settings:
- [codeblock]
- - Smoothing Groups
- - Smooth Mesh
- - Triangluate (for meshes with blend shapes)
- - Bake Animation
- - Resample All
- - Deformed Models
- - Skins
- - Blend Shapes
- - Curve Filters
- - Constant Key Reducer
- - Auto Tangents Only
- - *Do not check* Constraints (as it will break the file)
- - Can check Embed Media (embeds textures into the exported FBX file)
- - Note that when importing embedded media, the texture and mesh will be a single immutable file.
- - You will have to re-export then re-import the FBX if the texture has changed.
- - Units: Centimeters
- - Up Axis: Y
- - Binary format in FBX 2017
- [/codeblock]
- </description>
- <tutorials>
- </tutorials>
-</class>
diff --git a/modules/fbx/editor_scene_importer_fbx.cpp b/modules/fbx/editor_scene_importer_fbx.cpp
index 879f281292..9bdeafbf91 100644
--- a/modules/fbx/editor_scene_importer_fbx.cpp
+++ b/modules/fbx/editor_scene_importer_fbx.cpp
@@ -56,7 +56,7 @@
#include <string>
-void EditorSceneImporterFBX::get_extensions(List<String> *r_extensions) const {
+void EditorSceneFormatImporterFBX::get_extensions(List<String> *r_extensions) const {
// register FBX as the one and only format for FBX importing
const String import_setting_string = "filesystem/import/fbx/";
const String fbx_str = "fbx";
@@ -65,7 +65,7 @@ void EditorSceneImporterFBX::get_extensions(List<String> *r_extensions) const {
_register_project_setting_import(fbx_str, import_setting_string, exts, r_extensions, true);
}
-void EditorSceneImporterFBX::_register_project_setting_import(const String generic,
+void EditorSceneFormatImporterFBX::_register_project_setting_import(const String generic,
const String import_setting_string,
const Vector<String> &exts,
List<String> *r_extensions,
@@ -79,11 +79,11 @@ void EditorSceneImporterFBX::_register_project_setting_import(const String gener
}
}
-uint32_t EditorSceneImporterFBX::get_import_flags() const {
+uint32_t EditorSceneFormatImporterFBX::get_import_flags() const {
return IMPORT_SCENE;
}
-Node3D *EditorSceneImporterFBX::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, 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()) {
@@ -232,7 +232,7 @@ Node3D *EditorSceneImporterFBX::import_scene(const String &p_path, uint32_t p_fl
}
template <class T>
-struct EditorSceneImporterAssetImportInterpolate {
+struct EditorSceneFormatImporterAssetImportInterpolate {
T lerp(const T &a, const T &b, float c) const {
return a + (b - a) * c;
}
@@ -258,7 +258,7 @@ struct EditorSceneImporterAssetImportInterpolate {
//thank you for existing, partial specialization
template <>
-struct EditorSceneImporterAssetImportInterpolate<Quaternion> {
+struct EditorSceneFormatImporterAssetImportInterpolate<Quaternion> {
Quaternion lerp(const Quaternion &a, const Quaternion &b, float c) const {
ERR_FAIL_COND_V(!a.is_normalized(), Quaternion());
ERR_FAIL_COND_V(!b.is_normalized(), Quaternion());
@@ -282,7 +282,7 @@ struct EditorSceneImporterAssetImportInterpolate<Quaternion> {
};
template <class T>
-T EditorSceneImporterFBX::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, float p_time,
+T EditorSceneFormatImporterFBX::_interpolate_track(const Vector<float> &p_times, const Vector<T> &p_values, float p_time,
AssetImportAnimation::Interpolation p_interp) {
//could use binary search, worth it?
int idx = -1;
@@ -293,7 +293,7 @@ T EditorSceneImporterFBX::_interpolate_track(const Vector<float> &p_times, const
idx++;
}
- EditorSceneImporterAssetImportInterpolate<T> interp;
+ EditorSceneFormatImporterAssetImportInterpolate<T> interp;
switch (p_interp) {
case AssetImportAnimation::INTERP_LINEAR: {
@@ -352,7 +352,7 @@ T EditorSceneImporterFBX::_interpolate_track(const Vector<float> &p_times, const
ERR_FAIL_V(p_values[0]);
}
-Node3D *EditorSceneImporterFBX::_generate_scene(
+Node3D *EditorSceneFormatImporterFBX::_generate_scene(
const String &p_path,
const FBXDocParser::Document *p_document,
const uint32_t p_flags,
@@ -1294,7 +1294,7 @@ Node3D *EditorSceneImporterFBX::_generate_scene(
return scene_root;
}
-void EditorSceneImporterFBX::BuildDocumentBones(Ref<FBXBone> p_parent_bone,
+void EditorSceneFormatImporterFBX::BuildDocumentBones(Ref<FBXBone> p_parent_bone,
ImportState &state, const FBXDocParser::Document *p_doc,
uint64_t p_id) {
const std::vector<const FBXDocParser::Connection *> &conns = p_doc->GetConnectionsByDestinationSequenced(p_id, "Model");
@@ -1383,7 +1383,7 @@ void EditorSceneImporterFBX::BuildDocumentBones(Ref<FBXBone> p_parent_bone,
}
}
-void EditorSceneImporterFBX::BuildDocumentNodes(
+void EditorSceneFormatImporterFBX::BuildDocumentNodes(
Ref<PivotTransform> parent_transform,
ImportState &state,
const FBXDocParser::Document *p_doc,
diff --git a/modules/fbx/editor_scene_importer_fbx.h b/modules/fbx/editor_scene_importer_fbx.h
index 4a3b78480b..7845e079c2 100644
--- a/modules/fbx/editor_scene_importer_fbx.h
+++ b/modules/fbx/editor_scene_importer_fbx.h
@@ -57,9 +57,9 @@
#define CONVERT_FBX_TIME(time) static_cast<double>(time) / 46186158000LL
-class EditorSceneImporterFBX : public EditorSceneImporter {
+class EditorSceneFormatImporterFBX : public EditorSceneFormatImporter {
private:
- GDCLASS(EditorSceneImporterFBX, EditorSceneImporter);
+ GDCLASS(EditorSceneFormatImporterFBX, EditorSceneFormatImporter);
struct AssetImportAnimation {
enum Interpolation {
@@ -122,8 +122,8 @@ private:
void _register_project_setting_import(const String generic, const String import_setting_string, const Vector<String> &exts, List<String> *r_extensions, const bool p_enabled) const;
public:
- EditorSceneImporterFBX() {}
- ~EditorSceneImporterFBX() {}
+ EditorSceneFormatImporterFBX() {}
+ ~EditorSceneFormatImporterFBX() {}
virtual void get_extensions(List<String> *r_extensions) const override;
virtual uint32_t get_import_flags() const override;
diff --git a/modules/fbx/register_types.cpp b/modules/fbx/register_types.cpp
index a75da8f3a9..d5e520a060 100644
--- a/modules/fbx/register_types.cpp
+++ b/modules/fbx/register_types.cpp
@@ -35,7 +35,7 @@
#ifdef TOOLS_ENABLED
static void _editor_init() {
- Ref<EditorSceneImporterFBX> import_fbx;
+ Ref<EditorSceneFormatImporterFBX> import_fbx;
import_fbx.instantiate();
ResourceImporterScene::get_singleton()->add_importer(import_fbx);
}
@@ -46,7 +46,7 @@ void register_fbx_types() {
ClassDB::APIType prev_api = ClassDB::get_current_api();
ClassDB::set_current_api(ClassDB::API_EDITOR);
- GDREGISTER_CLASS(EditorSceneImporterFBX);
+ GDREGISTER_CLASS(EditorSceneFormatImporterFBX);
ClassDB::set_current_api(prev_api);
diff --git a/modules/gltf/doc_classes/EditorSceneImporterGLTF.xml b/modules/gltf/doc_classes/EditorSceneImporterGLTF.xml
deleted file mode 100644
index c85fce7b9d..0000000000
--- a/modules/gltf/doc_classes/EditorSceneImporterGLTF.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="EditorSceneImporterGLTF" inherits="EditorSceneImporter" version="4.0">
- <brief_description>
- </brief_description>
- <description>
- </description>
- <tutorials>
- </tutorials>
-</class>
diff --git a/modules/gltf/editor_scene_importer_gltf.cpp b/modules/gltf/editor_scene_importer_gltf.cpp
index 25875e7396..1a172877a0 100644
--- a/modules/gltf/editor_scene_importer_gltf.cpp
+++ b/modules/gltf/editor_scene_importer_gltf.cpp
@@ -38,16 +38,16 @@
#include "scene/animation/animation_player.h"
#include "scene/resources/animation.h"
-uint32_t EditorSceneImporterGLTF::get_import_flags() const {
+uint32_t EditorSceneFormatImporterGLTF::get_import_flags() const {
return ImportFlags::IMPORT_SCENE | ImportFlags::IMPORT_ANIMATION;
}
-void EditorSceneImporterGLTF::get_extensions(List<String> *r_extensions) const {
+void EditorSceneFormatImporterGLTF::get_extensions(List<String> *r_extensions) const {
r_extensions->push_back("gltf");
r_extensions->push_back("glb");
}
-Node *EditorSceneImporterGLTF::import_scene(const String &p_path,
+Node *EditorSceneFormatImporterGLTF::import_scene(const String &p_path,
uint32_t p_flags, int p_bake_fps,
List<String> *r_missing_deps,
Error *r_err) {
@@ -56,7 +56,7 @@ Node *EditorSceneImporterGLTF::import_scene(const String &p_path,
return doc->import_scene_gltf(p_path, p_flags, p_bake_fps, Ref<GLTFState>(), r_missing_deps, r_err);
}
-Ref<Animation> EditorSceneImporterGLTF::import_animation(const String &p_path,
+Ref<Animation> EditorSceneFormatImporterGLTF::import_animation(const String &p_path,
uint32_t p_flags,
int p_bake_fps) {
return Ref<Animation>();
diff --git a/modules/gltf/editor_scene_importer_gltf.h b/modules/gltf/editor_scene_importer_gltf.h
index 90663612a1..28963adc28 100644
--- a/modules/gltf/editor_scene_importer_gltf.h
+++ b/modules/gltf/editor_scene_importer_gltf.h
@@ -41,8 +41,8 @@
class Animation;
-class EditorSceneImporterGLTF : public EditorSceneImporter {
- GDCLASS(EditorSceneImporterGLTF, EditorSceneImporter);
+class EditorSceneFormatImporterGLTF : public EditorSceneFormatImporter {
+ GDCLASS(EditorSceneFormatImporterGLTF, EditorSceneFormatImporter);
public:
virtual uint32_t get_import_flags() const override;
diff --git a/modules/gltf/gltf_document.cpp b/modules/gltf/gltf_document.cpp
index 11f30be5a4..70df62de6a 100644
--- a/modules/gltf/gltf_document.cpp
+++ b/modules/gltf/gltf_document.cpp
@@ -5684,7 +5684,7 @@ void GLTFDocument::_generate_skeleton_bone_node(Ref<GLTFState> state, Node *scen
}
template <class T>
-struct EditorSceneImporterGLTFInterpolate {
+struct EditorSceneFormatImporterGLTFInterpolate {
T lerp(const T &a, const T &b, float c) const {
return a + (b - a) * c;
}
@@ -5710,7 +5710,7 @@ struct EditorSceneImporterGLTFInterpolate {
// thank you for existing, partial specialization
template <>
-struct EditorSceneImporterGLTFInterpolate<Quaternion> {
+struct EditorSceneFormatImporterGLTFInterpolate<Quaternion> {
Quaternion lerp(const Quaternion &a, const Quaternion &b, const float c) const {
ERR_FAIL_COND_V_MSG(!a.is_normalized(), Quaternion(), "The quaternion \"a\" must be normalized.");
ERR_FAIL_COND_V_MSG(!b.is_normalized(), Quaternion(), "The quaternion \"b\" must be normalized.");
@@ -5749,7 +5749,7 @@ T GLTFDocument::_interpolate_track(const Vector<float> &p_times, const Vector<T>
idx++;
}
- EditorSceneImporterGLTFInterpolate<T> interp;
+ EditorSceneFormatImporterGLTFInterpolate<T> interp;
switch (p_interp) {
case GLTFAnimation::INTERP_LINEAR: {
@@ -6833,7 +6833,7 @@ Node *GLTFDocument::import_scene_gltf(const String &p_path, uint32_t p_flags, in
r_state.instantiate();
}
r_state->use_named_skin_binds =
- p_flags & EditorSceneImporter::IMPORT_USE_NAMED_SKIN_BINDS;
+ p_flags & EditorSceneFormatImporter::IMPORT_USE_NAMED_SKIN_BINDS;
Ref<GLTFDocument> gltf_document;
gltf_document.instantiate();
diff --git a/modules/gltf/register_types.cpp b/modules/gltf/register_types.cpp
index 0aceb838f7..5a60c2d328 100644
--- a/modules/gltf/register_types.cpp
+++ b/modules/gltf/register_types.cpp
@@ -52,7 +52,7 @@
#ifndef _3D_DISABLED
#ifdef TOOLS_ENABLED
static void _editor_init() {
- Ref<EditorSceneImporterGLTF> import_gltf;
+ Ref<EditorSceneFormatImporterGLTF> import_gltf;
import_gltf.instantiate();
ResourceImporterScene::get_singleton()->add_importer(import_gltf);
}
@@ -64,7 +64,7 @@ void register_gltf_types() {
#ifdef TOOLS_ENABLED
ClassDB::APIType prev_api = ClassDB::get_current_api();
ClassDB::set_current_api(ClassDB::API_EDITOR);
- GDREGISTER_CLASS(EditorSceneImporterGLTF);
+ GDREGISTER_CLASS(EditorSceneFormatImporterGLTF);
GDREGISTER_CLASS(GLTFMesh);
EditorPlugins::add_by_type<SceneExporterGLTFPlugin>();
ClassDB::set_current_api(prev_api);