Skip to content

Commit 67f54bd

Browse files
committed
Merge pull request #101531 from akien-mga/scene-import-remove-unused-_get_import_flags
Remove unused `EditorSceneFormatImporter::_get_import_flags`
2 parents 19bb441 + 21fcb56 commit 67f54bd

16 files changed

+8
-52
lines changed

doc/classes/EditorSceneFormatImporter.xml

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
Return supported file extensions for this scene importer.
1717
</description>
1818
</method>
19-
<method name="_get_import_flags" qualifiers="virtual const" deprecated="Unused by the engine, and will be removed in a future version. Implementing this has no effect.">
20-
<return type="int" />
21-
<description>
22-
</description>
23-
</method>
2419
<method name="_get_import_options" qualifiers="virtual">
2520
<return type="void" />
2621
<param index="0" name="path" type="String" />

editor/import/3d/editor_import_collada.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -1796,10 +1796,6 @@ void ColladaImport::create_animation(int p_clip, bool p_import_value_tracks) {
17961796
/*************************************** SCENE ***********************************/
17971797
/*********************************************************************************/
17981798

1799-
uint32_t EditorSceneFormatImporterCollada::get_import_flags() const {
1800-
return IMPORT_SCENE | IMPORT_ANIMATION;
1801-
}
1802-
18031799
void EditorSceneFormatImporterCollada::get_extensions(List<String> *r_extensions) const {
18041800
r_extensions->push_back("dae");
18051801
}

editor/import/3d/editor_import_collada.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class EditorSceneFormatImporterCollada : public EditorSceneFormatImporter {
3737
GDCLASS(EditorSceneFormatImporterCollada, EditorSceneFormatImporter);
3838

3939
public:
40-
virtual uint32_t get_import_flags() const override;
4140
virtual void get_extensions(List<String> *r_extensions) const override;
4241
virtual Node *import_scene(const String &p_path, uint32_t p_flags, const HashMap<StringName, Variant> &p_options, List<String> *r_missing_deps = nullptr, Error *r_err = nullptr) override;
4342

editor/import/3d/resource_importer_obj.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838
#include "scene/resources/mesh.h"
3939
#include "scene/resources/surface_tool.h"
4040

41-
uint32_t EditorOBJImporter::get_import_flags() const {
42-
return IMPORT_SCENE;
43-
}
44-
4541
static Error _parse_material_library(const String &p_path, HashMap<String, Ref<StandardMaterial3D>> &material_map, List<String> *r_missing_deps) {
4642
Ref<FileAccess> f = FileAccess::open(p_path, FileAccess::READ);
4743
ERR_FAIL_COND_V_MSG(f.is_null(), ERR_CANT_OPEN, vformat("Couldn't open MTL file '%s', it may not exist or not be readable.", p_path));

editor/import/3d/resource_importer_obj.h

-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class EditorOBJImporter : public EditorSceneFormatImporter {
3737
GDCLASS(EditorOBJImporter, EditorSceneFormatImporter);
3838

3939
public:
40-
virtual uint32_t get_import_flags() const override;
4140
virtual void get_extensions(List<String> *r_extensions) const override;
4241
virtual Node *import_scene(const String &p_path, uint32_t p_flags, const HashMap<StringName, Variant> &p_options, List<String> *r_missing_deps, Error *r_err = nullptr) override;
4342

editor/import/3d/resource_importer_scene.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,6 @@
5757
#include "scene/resources/packed_scene.h"
5858
#include "scene/resources/resource_format_text.h"
5959

60-
uint32_t EditorSceneFormatImporter::get_import_flags() const {
61-
uint32_t ret;
62-
if (GDVIRTUAL_CALL(_get_import_flags, ret)) {
63-
return ret;
64-
}
65-
66-
ERR_FAIL_V(0);
67-
}
68-
6960
void EditorSceneFormatImporter::get_extensions(List<String> *r_extensions) const {
7061
Vector<String> arr;
7162
if (GDVIRTUAL_CALL(_get_extensions, arr)) {
@@ -118,7 +109,6 @@ void EditorSceneFormatImporter::_bind_methods() {
118109
ClassDB::bind_method(D_METHOD("add_import_option", "name", "value"), &EditorSceneFormatImporter::add_import_option);
119110
ClassDB::bind_method(D_METHOD("add_import_option_advanced", "type", "name", "default_value", "hint", "hint_string", "usage_flags"), &EditorSceneFormatImporter::add_import_option_advanced, DEFVAL(PROPERTY_HINT_NONE), DEFVAL(""), DEFVAL(PROPERTY_USAGE_DEFAULT));
120111

121-
GDVIRTUAL_BIND(_get_import_flags);
122112
GDVIRTUAL_BIND(_get_extensions);
123113
GDVIRTUAL_BIND(_import_scene, "path", "flags", "options");
124114
GDVIRTUAL_BIND(_get_import_options, "path");
@@ -3281,10 +3271,6 @@ void ResourceImporterScene::get_scene_importer_extensions(List<String> *p_extens
32813271

32823272
///////////////////////////////////////
32833273

3284-
uint32_t EditorSceneFormatImporterESCN::get_import_flags() const {
3285-
return IMPORT_SCENE;
3286-
}
3287-
32883274
void EditorSceneFormatImporterESCN::get_extensions(List<String> *r_extensions) const {
32893275
r_extensions->push_back("escn");
32903276
}

editor/import/3d/resource_importer_scene.h

-3
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ class EditorSceneFormatImporter : public RefCounted {
5858
Node *import_scene_wrapper(const String &p_path, uint32_t p_flags, const Dictionary &p_options);
5959
Ref<Animation> import_animation_wrapper(const String &p_path, uint32_t p_flags, const Dictionary &p_options);
6060

61-
GDVIRTUAL0RC(uint32_t, _get_import_flags)
6261
GDVIRTUAL0RC(Vector<String>, _get_extensions)
6362
GDVIRTUAL3R(Object *, _import_scene, String, uint32_t, Dictionary)
6463
GDVIRTUAL1(_get_import_options, String)
@@ -77,7 +76,6 @@ class EditorSceneFormatImporter : public RefCounted {
7776

7877
void add_import_option(const String &p_name, const Variant &p_default_value);
7978
void add_import_option_advanced(Variant::Type p_type, const String &p_name, const Variant &p_default_value, PropertyHint p_hint = PROPERTY_HINT_NONE, const String &p_hint_string = String(), int p_usage_flags = PROPERTY_USAGE_DEFAULT);
80-
virtual uint32_t get_import_flags() const;
8179
virtual void get_extensions(List<String> *r_extensions) const;
8280
virtual Node *import_scene(const String &p_path, uint32_t p_flags, const HashMap<StringName, Variant> &p_options, List<String> *r_missing_deps, Error *r_err = nullptr);
8381
virtual void get_import_options(const String &p_path, List<ResourceImporter::ImportOption> *r_options);
@@ -322,7 +320,6 @@ class EditorSceneFormatImporterESCN : public EditorSceneFormatImporter {
322320
GDCLASS(EditorSceneFormatImporterESCN, EditorSceneFormatImporter);
323321

324322
public:
325-
virtual uint32_t get_import_flags() const override;
326323
virtual void get_extensions(List<String> *r_extensions) const override;
327324
virtual Node *import_scene(const String &p_path, uint32_t p_flags, const HashMap<StringName, Variant> &p_options, List<String> *r_missing_deps, Error *r_err = nullptr) override;
328325
};

misc/extension_api_validation/4.3-stable.expected

+8
Original file line numberDiff line numberDiff line change
@@ -301,3 +301,11 @@ Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/uniform_b
301301
Validate extension JSON: Error: Field 'classes/RenderingDevice/methods/vertex_buffer_create/arguments': size changed value in new API, from 3 to 4.
302302

303303
Optional argument added. Compatibility methods registered.
304+
305+
306+
GH-101531
307+
---------
308+
Validate extension JSON: API was removed: classes/EditorSceneFormatImporter/methods/_get_import_flags
309+
310+
This virtual method, and the internal public `get_import_flags`, were never used by the engine, since it was open sourced.
311+
So we're removing it despite the compat breakage as there's no way for users to rely on this affecting engine behavior.

modules/fbx/editor/editor_scene_importer_fbx2gltf.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,6 @@
3838

3939
#include "modules/gltf/gltf_document.h"
4040

41-
uint32_t EditorSceneFormatImporterFBX2GLTF::get_import_flags() const {
42-
return ImportFlags::IMPORT_SCENE | ImportFlags::IMPORT_ANIMATION;
43-
}
44-
4541
void EditorSceneFormatImporterFBX2GLTF::get_extensions(List<String> *r_extensions) const {
4642
r_extensions->push_back("fbx");
4743
}

modules/fbx/editor/editor_scene_importer_fbx2gltf.h

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class EditorSceneFormatImporterFBX2GLTF : public EditorSceneFormatImporter {
4242
GDCLASS(EditorSceneFormatImporterFBX2GLTF, EditorSceneFormatImporter);
4343

4444
public:
45-
virtual uint32_t get_import_flags() const override;
4645
virtual void get_extensions(List<String> *r_extensions) const override;
4746
virtual Node *import_scene(const String &p_path, uint32_t p_flags,
4847
const HashMap<StringName, Variant> &p_options,

modules/fbx/editor/editor_scene_importer_ufbx.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@
3737

3838
#include "core/config/project_settings.h"
3939

40-
uint32_t EditorSceneFormatImporterUFBX::get_import_flags() const {
41-
return ImportFlags::IMPORT_SCENE | ImportFlags::IMPORT_ANIMATION;
42-
}
43-
4440
void EditorSceneFormatImporterUFBX::get_extensions(List<String> *r_extensions) const {
4541
r_extensions->push_back("fbx");
4642
}

modules/fbx/editor/editor_scene_importer_ufbx.h

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class EditorSceneFormatImporterUFBX : public EditorSceneFormatImporter {
4646
FBX_IMPORTER_UFBX,
4747
FBX_IMPORTER_FBX2GLTF,
4848
};
49-
virtual uint32_t get_import_flags() const override;
5049
virtual void get_extensions(List<String> *r_extensions) const override;
5150
virtual Node *import_scene(const String &p_path, uint32_t p_flags,
5251
const HashMap<StringName, Variant> &p_options,

modules/gltf/editor/editor_scene_importer_blend.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,6 @@ static bool _get_blender_version(const String &p_path, int &r_major, int &r_mino
102102
return true;
103103
}
104104

105-
uint32_t EditorSceneFormatImporterBlend::get_import_flags() const {
106-
return ImportFlags::IMPORT_SCENE | ImportFlags::IMPORT_ANIMATION;
107-
}
108-
109105
void EditorSceneFormatImporterBlend::get_extensions(List<String> *r_extensions) const {
110106
r_extensions->push_back("blend");
111107
}

modules/gltf/editor/editor_scene_importer_blend.h

-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class EditorSceneFormatImporterBlend : public EditorSceneFormatImporter {
6767
BLEND_MODIFIERS_ALL
6868
};
6969

70-
virtual uint32_t get_import_flags() const override;
7170
virtual void get_extensions(List<String> *r_extensions) const override;
7271
virtual Node *import_scene(const String &p_path, uint32_t p_flags,
7372
const HashMap<StringName, Variant> &p_options,

modules/gltf/editor/editor_scene_importer_gltf.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@
3535
#include "../gltf_defines.h"
3636
#include "../gltf_document.h"
3737

38-
uint32_t EditorSceneFormatImporterGLTF::get_import_flags() const {
39-
return ImportFlags::IMPORT_SCENE | ImportFlags::IMPORT_ANIMATION;
40-
}
41-
4238
void EditorSceneFormatImporterGLTF::get_extensions(List<String> *r_extensions) const {
4339
r_extensions->push_back("gltf");
4440
r_extensions->push_back("glb");

modules/gltf/editor/editor_scene_importer_gltf.h

-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ class EditorSceneFormatImporterGLTF : public EditorSceneFormatImporter {
4242
GDCLASS(EditorSceneFormatImporterGLTF, EditorSceneFormatImporter);
4343

4444
public:
45-
virtual uint32_t get_import_flags() const override;
4645
virtual void get_extensions(List<String> *r_extensions) const override;
4746
virtual Node *import_scene(const String &p_path, uint32_t p_flags,
4847
const HashMap<StringName, Variant> &p_options,

0 commit comments

Comments
 (0)