diff options
author | clayjohn <claynjohn@gmail.com> | 2021-10-03 22:51:28 -0700 |
---|---|---|
committer | clayjohn <claynjohn@gmail.com> | 2021-10-04 08:48:58 -0700 |
commit | 8c949016ffd193862f4b4b4633ee091708c446d9 (patch) | |
tree | ea5aa538478324d600d003a7086138bc9aaae7ca /scene/resources/material.cpp | |
parent | 66ab3ce954a94fd43baed1dd74381dd32c893407 (diff) | |
download | redot-engine-8c949016ffd193862f4b4b4633ee091708c446d9.tar.gz |
Hide render_priority except when using SpatialMaterials
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r-- | scene/resources/material.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 3a6af3afb0..66177f0807 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -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(); |