Enable revert button for ShaderMaterial::next_pass and ShaderMaterial::render_priority.

This commit is contained in:
Rakka Rage 2024-08-22 01:29:23 -04:00
parent 568589c9d8
commit ba23b22153

View file

@ -379,6 +379,8 @@ bool ShaderMaterial::_property_can_revert(const StringName &p_name) const {
Variant default_value = RenderingServer::get_singleton()->shader_get_parameter_default(shader->get_rid(), *pr);
Variant current_value = get_shader_parameter(*pr);
return default_value.get_type() != Variant::NIL && default_value != current_value;
} else if (p_name == "render_priority" || p_name == "next_pass") {
return true;
}
}
return false;
@ -390,6 +392,12 @@ bool ShaderMaterial::_property_get_revert(const StringName &p_name, Variant &r_p
if (pr) {
r_property = RenderingServer::get_singleton()->shader_get_parameter_default(shader->get_rid(), *pr);
return true;
} else if (p_name == "render_priority") {
r_property = 0;
return true;
} else if (p_name == "next_pass") {
r_property = Variant();
return true;
}
}
return false;