Move initialization check for CanvasMaterial

Prevents the check from causing other materials to error
This commit is contained in:
Adelynne Brito 2025-12-05 17:32:15 -05:00 committed by Rémi Verschelde
parent 757bba192e
commit d7792feaba
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -52,7 +52,6 @@
Ref<ShaderMaterial> MaterialEditor::make_shader_material(const Ref<Material> &p_from, bool p_copy_params) {
ERR_FAIL_COND_V(p_from.is_null(), Ref<ShaderMaterial>());
ERR_FAIL_COND_V(!p_from->_is_initialized(), Ref<ShaderMaterial>());
Ref<ShaderMaterial> smat;
smat.instantiate();
@ -497,5 +496,6 @@ bool CanvasItemMaterialConversionPlugin::handles(const Ref<Resource> &p_resource
}
Ref<Resource> CanvasItemMaterialConversionPlugin::convert(const Ref<Resource> &p_resource) const {
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);
}