From 06f0c3fef6a548a047f4f461f84a971167252911 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Fri, 18 Jul 2025 19:55:58 -0700 Subject: [PATCH] Move Material3D conversion editor plugins to their own folder --- editor/editor_node.cpp | 1 + .../3d/material_3d_conversion_plugins.cpp | 153 ++++++++++++++++++ .../scene/3d/material_3d_conversion_plugins.h | 87 ++++++++++ editor/scene/material_editor_plugin.cpp | 144 ++--------------- editor/scene/material_editor_plugin.h | 123 ++++---------- 5 files changed, 289 insertions(+), 219 deletions(-) create mode 100644 editor/scene/3d/material_3d_conversion_plugins.cpp create mode 100644 editor/scene/3d/material_3d_conversion_plugins.h diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index c32393a7803..974635cff30 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -143,6 +143,7 @@ #include "editor/run/editor_run.h" #include "editor/run/editor_run_bar.h" #include "editor/run/game_view_plugin.h" +#include "editor/scene/3d/material_3d_conversion_plugins.h" #include "editor/scene/3d/mesh_library_editor_plugin.h" #include "editor/scene/3d/node_3d_editor_plugin.h" #include "editor/scene/3d/root_motion_editor_plugin.h" diff --git a/editor/scene/3d/material_3d_conversion_plugins.cpp b/editor/scene/3d/material_3d_conversion_plugins.cpp new file mode 100644 index 00000000000..b36340eaf57 --- /dev/null +++ b/editor/scene/3d/material_3d_conversion_plugins.cpp @@ -0,0 +1,153 @@ +/**************************************************************************/ +/* material_3d_conversion_plugins.cpp */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/**************************************************************************/ + +#include "material_3d_conversion_plugins.h" + +#include "editor/scene/material_editor_plugin.h" +#include "scene/resources/3d/fog_material.h" +#include "scene/resources/3d/sky_material.h" + +String StandardMaterial3DConversionPlugin::converts_to() const { + return "ShaderMaterial"; +} + +bool StandardMaterial3DConversionPlugin::handles(const Ref &p_resource) const { + Ref mat = p_resource; + return mat.is_valid(); +} + +Ref StandardMaterial3DConversionPlugin::convert(const Ref &p_resource) const { + Ref mat = p_resource; + Ref smat = MaterialEditor::make_shader_material(mat, false); + if (smat.is_null()) { + return smat; + } + + List params; + RS::get_singleton()->get_shader_parameter_list(mat->get_shader_rid(), ¶ms); + + for (const PropertyInfo &E : params) { + // Texture parameter has to be treated specially since StandardMaterial3D saved it + // as RID but ShaderMaterial needs Texture itself + Ref texture = mat->get_texture_by_name(E.name); + if (texture.is_valid()) { + smat->set_shader_parameter(E.name, texture); + } else { + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name); + smat->set_shader_parameter(E.name, value); + } + } + return smat; +} + +String ORMMaterial3DConversionPlugin::converts_to() const { + return "ShaderMaterial"; +} + +bool ORMMaterial3DConversionPlugin::handles(const Ref &p_resource) const { + Ref mat = p_resource; + return mat.is_valid(); +} + +Ref ORMMaterial3DConversionPlugin::convert(const Ref &p_resource) const { + Ref mat = p_resource; + Ref smat = MaterialEditor::make_shader_material(mat, false); + if (smat.is_null()) { + return smat; + } + + List params; + RS::get_singleton()->get_shader_parameter_list(mat->get_shader_rid(), ¶ms); + + for (const PropertyInfo &E : params) { + // Texture parameter has to be treated specially since ORMMaterial3D saved it + // as RID but ShaderMaterial needs Texture itself + Ref texture = mat->get_texture_by_name(E.name); + if (texture.is_valid()) { + smat->set_shader_parameter(E.name, texture); + } else { + Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name); + smat->set_shader_parameter(E.name, value); + } + } + return smat; +} + +String ProceduralSkyMaterialConversionPlugin::converts_to() const { + return "ShaderMaterial"; +} + +bool ProceduralSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { + Ref mat = p_resource; + return mat.is_valid(); +} + +Ref ProceduralSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { + return MaterialEditor::make_shader_material(p_resource); +} + +String PanoramaSkyMaterialConversionPlugin::converts_to() const { + return "ShaderMaterial"; +} + +bool PanoramaSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { + Ref mat = p_resource; + return mat.is_valid(); +} + +Ref PanoramaSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { + return MaterialEditor::make_shader_material(p_resource); +} + +String PhysicalSkyMaterialConversionPlugin::converts_to() const { + return "ShaderMaterial"; +} + +bool PhysicalSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { + Ref mat = p_resource; + return mat.is_valid(); +} + +Ref PhysicalSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { + return MaterialEditor::make_shader_material(p_resource); +} + +String FogMaterialConversionPlugin::converts_to() const { + return "ShaderMaterial"; +} + +bool FogMaterialConversionPlugin::handles(const Ref &p_resource) const { + Ref mat = p_resource; + return mat.is_valid(); +} + +Ref FogMaterialConversionPlugin::convert(const Ref &p_resource) const { + return MaterialEditor::make_shader_material(p_resource); +} diff --git a/editor/scene/3d/material_3d_conversion_plugins.h b/editor/scene/3d/material_3d_conversion_plugins.h new file mode 100644 index 00000000000..1584edb5e93 --- /dev/null +++ b/editor/scene/3d/material_3d_conversion_plugins.h @@ -0,0 +1,87 @@ +/**************************************************************************/ +/* material_3d_conversion_plugins.h */ +/**************************************************************************/ +/* This file is part of: */ +/* GODOT ENGINE */ +/* https://godotengine.org */ +/**************************************************************************/ +/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ +/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* */ +/* 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. */ +/**************************************************************************/ + +#pragma once + +#include "editor/plugins/editor_resource_conversion_plugin.h" + +class StandardMaterial3DConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(StandardMaterial3DConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const override; + virtual bool handles(const Ref &p_resource) const override; + virtual Ref convert(const Ref &p_resource) const override; +}; + +class ORMMaterial3DConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(ORMMaterial3DConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const override; + virtual bool handles(const Ref &p_resource) const override; + virtual Ref convert(const Ref &p_resource) const override; +}; + +class ProceduralSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(ProceduralSkyMaterialConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const override; + virtual bool handles(const Ref &p_resource) const override; + virtual Ref convert(const Ref &p_resource) const override; +}; + +class PanoramaSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(PanoramaSkyMaterialConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const override; + virtual bool handles(const Ref &p_resource) const override; + virtual Ref convert(const Ref &p_resource) const override; +}; + +class PhysicalSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(PhysicalSkyMaterialConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const override; + virtual bool handles(const Ref &p_resource) const override; + virtual Ref convert(const Ref &p_resource) const override; +}; + +class FogMaterialConversionPlugin : public EditorResourceConversionPlugin { + GDCLASS(FogMaterialConversionPlugin, EditorResourceConversionPlugin); + +public: + virtual String converts_to() const override; + virtual bool handles(const Ref &p_resource) const override; + virtual Ref convert(const Ref &p_resource) const override; +}; diff --git a/editor/scene/material_editor_plugin.cpp b/editor/scene/material_editor_plugin.cpp index 28117242795..200ec8c85f3 100644 --- a/editor/scene/material_editor_plugin.cpp +++ b/editor/scene/material_editor_plugin.cpp @@ -36,21 +36,21 @@ #include "editor/editor_undo_redo_manager.h" #include "editor/settings/editor_settings.h" #include "editor/themes/editor_scale.h" -#include "scene/3d/camera_3d.h" -#include "scene/3d/light_3d.h" -#include "scene/3d/mesh_instance_3d.h" #include "scene/gui/box_container.h" #include "scene/gui/button.h" #include "scene/gui/color_rect.h" #include "scene/gui/label.h" #include "scene/gui/subviewport_container.h" #include "scene/main/viewport.h" -#include "scene/resources/3d/fog_material.h" -#include "scene/resources/3d/sky_material.h" #include "scene/resources/canvas_item_material.h" #include "scene/resources/particle_process_material.h" -static Ref _make_shader_material(const Ref &p_from, bool p_copy_params = true) { +// 3D. +#include "scene/3d/camera_3d.h" +#include "scene/3d/light_3d.h" +#include "scene/3d/mesh_instance_3d.h" + +Ref MaterialEditor::make_shader_material(const Ref &p_from, bool p_copy_params) { ERR_FAIL_COND_V(p_from.is_null(), Ref()); ERR_FAIL_COND_V(!p_from->_is_initialized(), Ref()); @@ -165,24 +165,24 @@ void MaterialEditor::edit(Ref p_material, const Ref &p_en layout_error->hide(); layout_3d->hide(); layout_2d->show(); - vc->hide(); rect_instance->set_material(material); + vc->hide(); break; case Shader::MODE_SPATIAL: layout_error->hide(); layout_2d->hide(); layout_3d->show(); - vc->show(); sphere_instance->set_material_override(material); box_instance->set_material_override(material); quad_instance->set_material_override(material); + vc->show(); break; default: layout_error->show(); layout_2d->hide(); layout_3d->hide(); - vc->hide(); is_unsupported_shader_mode = true; + vc->hide(); break; } } else { @@ -232,6 +232,8 @@ void MaterialEditor::_on_quad_switch_pressed() { } MaterialEditor::MaterialEditor() { + set_custom_minimum_size(Size2(1, 150) * EDSCALE); + // Canvas item vc_2d = memnew(SubViewportContainer); @@ -329,8 +331,6 @@ MaterialEditor::MaterialEditor() { quad_mesh.instantiate(); quad_instance->set_mesh(quad_mesh); - set_custom_minimum_size(Size2(1, 150) * EDSCALE); - layout_3d = memnew(HBoxContainer); add_child(layout_3d); layout_3d->set_anchors_and_offsets_preset(Control::PRESET_FULL_RECT, Control::PRESET_MODE_MINSIZE, 2); @@ -474,72 +474,6 @@ MaterialEditorPlugin::MaterialEditorPlugin() { add_inspector_plugin(plugin); } -String StandardMaterial3DConversionPlugin::converts_to() const { - return "ShaderMaterial"; -} - -bool StandardMaterial3DConversionPlugin::handles(const Ref &p_resource) const { - Ref mat = p_resource; - return mat.is_valid(); -} - -Ref StandardMaterial3DConversionPlugin::convert(const Ref &p_resource) const { - Ref mat = p_resource; - Ref smat = _make_shader_material(mat, false); - if (smat.is_null()) { - return smat; - } - - List params; - RS::get_singleton()->get_shader_parameter_list(mat->get_shader_rid(), ¶ms); - - for (const PropertyInfo &E : params) { - // Texture parameter has to be treated specially since StandardMaterial3D saved it - // as RID but ShaderMaterial needs Texture itself - Ref texture = mat->get_texture_by_name(E.name); - if (texture.is_valid()) { - smat->set_shader_parameter(E.name, texture); - } else { - Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name); - smat->set_shader_parameter(E.name, value); - } - } - return smat; -} - -String ORMMaterial3DConversionPlugin::converts_to() const { - return "ShaderMaterial"; -} - -bool ORMMaterial3DConversionPlugin::handles(const Ref &p_resource) const { - Ref mat = p_resource; - return mat.is_valid(); -} - -Ref ORMMaterial3DConversionPlugin::convert(const Ref &p_resource) const { - Ref mat = p_resource; - Ref smat = _make_shader_material(mat, false); - if (smat.is_null()) { - return smat; - } - - List params; - RS::get_singleton()->get_shader_parameter_list(mat->get_shader_rid(), ¶ms); - - for (const PropertyInfo &E : params) { - // Texture parameter has to be treated specially since ORMMaterial3D saved it - // as RID but ShaderMaterial needs Texture itself - Ref texture = mat->get_texture_by_name(E.name); - if (texture.is_valid()) { - smat->set_shader_parameter(E.name, texture); - } else { - Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name); - smat->set_shader_parameter(E.name, value); - } - } - return smat; -} - String ParticleProcessMaterialConversionPlugin::converts_to() const { return "ShaderMaterial"; } @@ -550,7 +484,7 @@ bool ParticleProcessMaterialConversionPlugin::handles(const Ref &p_res } Ref ParticleProcessMaterialConversionPlugin::convert(const Ref &p_resource) const { - return _make_shader_material(p_resource); + return MaterialEditor::make_shader_material(p_resource); } String CanvasItemMaterialConversionPlugin::converts_to() const { @@ -563,57 +497,5 @@ bool CanvasItemMaterialConversionPlugin::handles(const Ref &p_resource } Ref CanvasItemMaterialConversionPlugin::convert(const Ref &p_resource) const { - return _make_shader_material(p_resource); -} - -String ProceduralSkyMaterialConversionPlugin::converts_to() const { - return "ShaderMaterial"; -} - -bool ProceduralSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { - Ref mat = p_resource; - return mat.is_valid(); -} - -Ref ProceduralSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { - return _make_shader_material(p_resource); -} - -String PanoramaSkyMaterialConversionPlugin::converts_to() const { - return "ShaderMaterial"; -} - -bool PanoramaSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { - Ref mat = p_resource; - return mat.is_valid(); -} - -Ref PanoramaSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { - return _make_shader_material(p_resource); -} - -String PhysicalSkyMaterialConversionPlugin::converts_to() const { - return "ShaderMaterial"; -} - -bool PhysicalSkyMaterialConversionPlugin::handles(const Ref &p_resource) const { - Ref mat = p_resource; - return mat.is_valid(); -} - -Ref PhysicalSkyMaterialConversionPlugin::convert(const Ref &p_resource) const { - return _make_shader_material(p_resource); -} - -String FogMaterialConversionPlugin::converts_to() const { - return "ShaderMaterial"; -} - -bool FogMaterialConversionPlugin::handles(const Ref &p_resource) const { - Ref mat = p_resource; - return mat.is_valid(); -} - -Ref FogMaterialConversionPlugin::convert(const Ref &p_resource) const { - return _make_shader_material(p_resource); + return MaterialEditor::make_shader_material(p_resource); } diff --git a/editor/scene/material_editor_plugin.h b/editor/scene/material_editor_plugin.h index 3afdcc23f74..f79f748c3f4 100644 --- a/editor/scene/material_editor_plugin.h +++ b/editor/scene/material_editor_plugin.h @@ -49,42 +49,14 @@ class Label; class MaterialEditor : public Control { GDCLASS(MaterialEditor, Control); - Vector2 rot; - - SubViewportContainer *vc_2d = nullptr; - SubViewport *viewport_2d = nullptr; - HBoxContainer *layout_2d = nullptr; - ColorRect *rect_instance = nullptr; - + // Both 2D and 3D materials. + Ref material; SubViewportContainer *vc = nullptr; SubViewport *viewport = nullptr; - Node3D *rotation = nullptr; - MeshInstance3D *sphere_instance = nullptr; - MeshInstance3D *box_instance = nullptr; - MeshInstance3D *quad_instance = nullptr; - DirectionalLight3D *light1 = nullptr; - DirectionalLight3D *light2 = nullptr; - Camera3D *camera = nullptr; - Ref camera_attributes; - - Ref sphere_mesh; - Ref box_mesh; - Ref quad_mesh; - VBoxContainer *layout_error = nullptr; Label *error_label = nullptr; bool is_unsupported_shader_mode = false; - HBoxContainer *layout_3d = nullptr; - - Ref material; - - Button *sphere_switch = nullptr; - Button *box_switch = nullptr; - Button *quad_switch = nullptr; - Button *light_1_switch = nullptr; - Button *light_2_switch = nullptr; - struct ThemeCache { Ref light_1_icon; Ref light_2_icon; @@ -94,21 +66,50 @@ class MaterialEditor : public Control { Ref checkerboard; } theme_cache; + // 2D canvas materials. + SubViewportContainer *vc_2d = nullptr; + SubViewport *viewport_2d = nullptr; + HBoxContainer *layout_2d = nullptr; + ColorRect *rect_instance = nullptr; + + // 3D spatial materials. + Vector2 rot; + Node3D *rotation = nullptr; + MeshInstance3D *sphere_instance = nullptr; + MeshInstance3D *box_instance = nullptr; + MeshInstance3D *quad_instance = nullptr; + DirectionalLight3D *light1 = nullptr; + DirectionalLight3D *light2 = nullptr; + Camera3D *camera = nullptr; + Ref camera_attributes; + Ref sphere_mesh; + Ref box_mesh; + Ref quad_mesh; + HBoxContainer *layout_3d = nullptr; + + Button *sphere_switch = nullptr; + Button *box_switch = nullptr; + Button *quad_switch = nullptr; + Button *light_1_switch = nullptr; + Button *light_2_switch = nullptr; + void _on_light_1_switch_pressed(); void _on_light_2_switch_pressed(); void _on_sphere_switch_pressed(); void _on_box_switch_pressed(); void _on_quad_switch_pressed(); -protected: - virtual void _update_theme_item_cache() override; - void _notification(int p_what); - void gui_input(const Ref &p_event) override; void _set_rotation(real_t p_x_degrees, real_t p_y_degrees); void _store_rotation_metadata(); void _update_rotation(); +protected: + virtual void _update_theme_item_cache() override; + void _notification(int p_what); + void gui_input(const Ref &p_event) override; + public: + static Ref make_shader_material(const Ref &p_from, bool p_copy_params = true); void edit(Ref p_material, const Ref &p_env); MaterialEditor(); }; @@ -135,24 +136,6 @@ public: MaterialEditorPlugin(); }; -class StandardMaterial3DConversionPlugin : public EditorResourceConversionPlugin { - GDCLASS(StandardMaterial3DConversionPlugin, EditorResourceConversionPlugin); - -public: - virtual String converts_to() const override; - virtual bool handles(const Ref &p_resource) const override; - virtual Ref convert(const Ref &p_resource) const override; -}; - -class ORMMaterial3DConversionPlugin : public EditorResourceConversionPlugin { - GDCLASS(ORMMaterial3DConversionPlugin, EditorResourceConversionPlugin); - -public: - virtual String converts_to() const override; - virtual bool handles(const Ref &p_resource) const override; - virtual Ref convert(const Ref &p_resource) const override; -}; - class ParticleProcessMaterialConversionPlugin : public EditorResourceConversionPlugin { GDCLASS(ParticleProcessMaterialConversionPlugin, EditorResourceConversionPlugin); @@ -170,39 +153,3 @@ public: virtual bool handles(const Ref &p_resource) const override; virtual Ref convert(const Ref &p_resource) const override; }; - -class ProceduralSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { - GDCLASS(ProceduralSkyMaterialConversionPlugin, EditorResourceConversionPlugin); - -public: - virtual String converts_to() const override; - virtual bool handles(const Ref &p_resource) const override; - virtual Ref convert(const Ref &p_resource) const override; -}; - -class PanoramaSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { - GDCLASS(PanoramaSkyMaterialConversionPlugin, EditorResourceConversionPlugin); - -public: - virtual String converts_to() const override; - virtual bool handles(const Ref &p_resource) const override; - virtual Ref convert(const Ref &p_resource) const override; -}; - -class PhysicalSkyMaterialConversionPlugin : public EditorResourceConversionPlugin { - GDCLASS(PhysicalSkyMaterialConversionPlugin, EditorResourceConversionPlugin); - -public: - virtual String converts_to() const override; - virtual bool handles(const Ref &p_resource) const override; - virtual Ref convert(const Ref &p_resource) const override; -}; - -class FogMaterialConversionPlugin : public EditorResourceConversionPlugin { - GDCLASS(FogMaterialConversionPlugin, EditorResourceConversionPlugin); - -public: - virtual String converts_to() const override; - virtual bool handles(const Ref &p_resource) const override; - virtual Ref convert(const Ref &p_resource) const override; -};