Add conversion for uniform_name property in visual shader

This commit is contained in:
Yuri Rubinsky 2022-09-07 08:08:38 +03:00
parent 432c4c40a9
commit 09c98cdde9
2 changed files with 15 additions and 0 deletions

View file

@ -3718,6 +3718,17 @@ bool VisualShaderNodeParameter::is_global_code_generated() const {
return global_code_generated;
}
#ifndef DISABLE_DEPRECATED
// Kept for compatibility from 3.x to 4.0.
bool VisualShaderNodeParameter::_set(const StringName &p_name, const Variant &p_value) {
if (p_name == "uniform_name") {
set_parameter_name(p_value);
return true;
}
return false;
}
#endif
void VisualShaderNodeParameter::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_parameter_name", "name"), &VisualShaderNodeParameter::set_parameter_name);
ClassDB::bind_method(D_METHOD("get_parameter_name"), &VisualShaderNodeParameter::get_parameter_name);

View file

@ -519,6 +519,10 @@ protected:
static void _bind_methods();
String _get_qual_str() const;
#ifndef DISABLE_DEPRECATED
bool _set(const StringName &p_name, const Variant &p_value);
#endif
public:
void set_parameter_name(const String &p_name);
String get_parameter_name() const;