Merge pull request #95954 from rakkarage/shader-material-reset
Enable revert button for `ShaderMaterial::next_pass` and `ShaderMaterial::render_priority`.
This commit is contained in:
commit
350bde0db6
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue