feat: updated godot version
This commit is contained in:
parent
0c508b0831
commit
42b028dbb5
4694 changed files with 236470 additions and 401376 deletions
|
|
@ -31,7 +31,6 @@
|
|||
#include "material_editor_plugin.h"
|
||||
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/object/callable_mp.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_string_names.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
|
|
@ -43,11 +42,8 @@
|
|||
#include "scene/gui/label.h"
|
||||
#include "scene/gui/subviewport_container.h"
|
||||
#include "scene/main/viewport.h"
|
||||
#include "scene/resources/blit_material.h"
|
||||
#include "scene/resources/canvas_item_material.h"
|
||||
#include "scene/resources/particle_process_material.h"
|
||||
#include "scene/resources/sky.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
// 3D.
|
||||
#include "scene/3d/camera_3d.h"
|
||||
|
|
@ -400,9 +396,6 @@ MaterialEditor::MaterialEditor() {
|
|||
|
||||
Vector2 stored_rot = EditorSettings::get_singleton()->get_project_metadata("inspector_options", "material_preview_rotation", Vector2());
|
||||
_set_rotation(stored_rot.x, stored_rot.y);
|
||||
|
||||
EditorNode::get_singleton()->register_hdr_viewport(viewport);
|
||||
EditorNode::get_singleton()->register_hdr_viewport(viewport_2d);
|
||||
}
|
||||
|
||||
///////////////////////
|
||||
|
|
@ -506,42 +499,3 @@ Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p
|
|||
ERR_FAIL_COND_V(!Object::cast_to<CanvasItemMaterial>(*p_resource) || !Object::cast_to<CanvasItemMaterial>(*p_resource)->_is_initialized(), Ref<CanvasItemMaterial>());
|
||||
return MaterialEditor::make_shader_material(p_resource);
|
||||
}
|
||||
|
||||
String BlitMaterialConversionPlugin::converts_to() const {
|
||||
return "ShaderMaterial";
|
||||
}
|
||||
|
||||
bool BlitMaterialConversionPlugin::handles(const Ref<Resource> &p_resource) const {
|
||||
Ref<BlitMaterial> mat = p_resource;
|
||||
return mat.is_valid();
|
||||
}
|
||||
|
||||
Ref<Resource> BlitMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const {
|
||||
Ref<BlitMaterial> mat = p_resource;
|
||||
ERR_FAIL_COND_V(mat.is_null(), Ref<Resource>());
|
||||
|
||||
Ref<ShaderMaterial> smat;
|
||||
smat.instantiate();
|
||||
|
||||
Ref<Shader> shader;
|
||||
shader.instantiate();
|
||||
|
||||
String code = RS::get_singleton()->shader_get_code(mat->get_shader_rid());
|
||||
|
||||
shader->set_code(code);
|
||||
|
||||
smat->set_shader(shader);
|
||||
|
||||
List<PropertyInfo> params;
|
||||
RS::get_singleton()->get_shader_parameter_list(mat->get_shader_rid(), ¶ms);
|
||||
|
||||
for (const PropertyInfo &E : params) {
|
||||
Variant value = RS::get_singleton()->material_get_param(mat->get_rid(), E.name);
|
||||
smat->set_shader_parameter(E.name, value);
|
||||
}
|
||||
|
||||
smat->set_render_priority(mat->get_render_priority());
|
||||
smat->set_local_to_scene(mat->is_local_to_scene());
|
||||
smat->set_name(mat->get_name());
|
||||
return smat;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue