Hide render_priority except when using SpatialMaterials

This commit is contained in:
clayjohn 2021-10-03 22:51:28 -07:00
parent 66ab3ce954
commit 8c949016ff
5 changed files with 13 additions and 17 deletions

View file

@ -80,6 +80,9 @@ void Material::_validate_property(PropertyInfo &property) const {
if (!_can_do_next_pass() && property.name == "next_pass") {
property.usage = PROPERTY_USAGE_NONE;
}
if (!_can_use_render_priority() && property.name == "render_priority") {
property.usage = PROPERTY_USAGE_NONE;
}
}
void Material::inspect_native_shader_code() {
@ -291,6 +294,10 @@ bool ShaderMaterial::_can_do_next_pass() const {
return shader.is_valid() && shader->get_mode() == Shader::MODE_SPATIAL;
}
bool ShaderMaterial::_can_use_render_priority() const {
return shader.is_valid() && shader->get_mode() == Shader::MODE_SPATIAL;
}
Shader::Mode ShaderMaterial::get_shader_mode() const {
if (shader.is_valid()) {
return shader->get_mode();