2020-01-31 19:38:20 +01:00
|
|
|
/*
|
2022-01-12 21:59:58 +01:00
|
|
|
Copyright (c) 2019-2022 Péter Magyar
|
2020-01-31 19:38:20 +01:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2019-12-20 16:14:37 +01:00
|
|
|
#include "register_types.h"
|
|
|
|
|
|
|
|
#include "mesh_data_resource.h"
|
2020-07-26 14:51:53 +02:00
|
|
|
#include "mesh_data_resource_collection.h"
|
2020-07-03 13:04:17 +02:00
|
|
|
#include "nodes/mesh_data_instance.h"
|
2022-02-25 14:44:57 +01:00
|
|
|
#include "nodes/mesh_data_instance_2d.h"
|
2019-12-20 16:14:37 +01:00
|
|
|
|
|
|
|
#ifdef TOOLS_ENABLED
|
|
|
|
#include "editor/editor_plugin.h"
|
|
|
|
|
2020-01-14 23:13:16 +01:00
|
|
|
#include "plugin_collada/editor_plugin_collada_mdr.h"
|
2019-12-20 16:14:37 +01:00
|
|
|
|
2020-01-14 23:13:16 +01:00
|
|
|
#include "plugin_gltf/editor_plugin_gltf_mdr.h"
|
|
|
|
#endif
|
2019-12-20 16:14:37 +01:00
|
|
|
|
2020-07-05 14:53:45 +02:00
|
|
|
#if PROPS_PRESENT
|
|
|
|
#include "../props/singleton/prop_utils.h"
|
2020-07-05 18:48:13 +02:00
|
|
|
#include "props/prop_data_mesh_data.h"
|
2020-07-05 14:53:45 +02:00
|
|
|
#endif
|
|
|
|
|
2022-02-25 14:04:51 +01:00
|
|
|
#if PROPS_2D_PRESENT
|
|
|
|
#include "../props_2d/singleton/prop_2d_utils.h"
|
|
|
|
#include "props_2d/prop_2d_data_mesh_data.h"
|
|
|
|
#endif
|
|
|
|
|
2023-01-08 15:55:50 +01:00
|
|
|
void initialize_mesh_data_resource_module(ModuleInitializationLevel p_level) {
|
|
|
|
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
|
|
|
|
GDREGISTER_CLASS(MeshDataResource);
|
|
|
|
GDREGISTER_CLASS(MeshDataResourceCollection);
|
2019-12-20 16:14:37 +01:00
|
|
|
|
2023-01-08 15:55:50 +01:00
|
|
|
GDREGISTER_CLASS(MeshDataInstance);
|
|
|
|
GDREGISTER_CLASS(MeshDataInstance2D);
|
2020-06-27 21:44:45 +02:00
|
|
|
|
2020-07-05 14:53:45 +02:00
|
|
|
#if PROPS_PRESENT
|
2023-01-08 15:55:50 +01:00
|
|
|
GDREGISTER_CLASS(PropDataMeshData);
|
|
|
|
Ref<PropDataMeshData> processor = Ref<PropDataMeshData>(memnew(PropDataMeshData));
|
|
|
|
PropUtils::add_processor(processor);
|
2020-07-05 14:53:45 +02:00
|
|
|
#endif
|
|
|
|
|
2022-02-25 14:04:51 +01:00
|
|
|
#if PROPS_2D_PRESENT
|
2023-01-08 15:55:50 +01:00
|
|
|
GDREGISTER_CLASS(Prop2DDataMeshData);
|
|
|
|
Ref<Prop2DDataMeshData> prop_2d_processor = Ref<Prop2DDataMeshData>(memnew(Prop2DDataMeshData));
|
|
|
|
Prop2DUtils::add_processor(prop_2d_processor);
|
2022-02-25 14:04:51 +01:00
|
|
|
#endif
|
2023-01-08 15:55:50 +01:00
|
|
|
}
|
2022-02-25 14:04:51 +01:00
|
|
|
|
2020-01-14 23:13:16 +01:00
|
|
|
#ifdef TOOLS_ENABLED
|
2023-01-08 15:55:50 +01:00
|
|
|
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
|
|
|
|
EditorPlugins::add_by_type<EditorPluginColladaMdr>();
|
2020-01-14 23:13:16 +01:00
|
|
|
|
2023-01-08 15:55:50 +01:00
|
|
|
EditorPlugins::add_by_type<EditorPluginGLTFMdr>();
|
|
|
|
}
|
2020-01-14 23:13:16 +01:00
|
|
|
#endif
|
2019-12-20 16:14:37 +01:00
|
|
|
}
|
|
|
|
|
2023-01-09 01:17:26 +01:00
|
|
|
void uninitialize_mesh_data_resource_module(ModuleInitializationLevel p_level) {
|
2019-12-20 16:14:37 +01:00
|
|
|
}
|