Merge pull request #60121 from Calinou/environment-editor-tonemap-linear-hide-3.x

Hide Tonemap White property when tonemapper is Linear in Environment
This commit is contained in:
Rémi Verschelde 2022-04-11 20:32:52 +02:00 committed by GitHub
commit b3d78b699c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -156,6 +156,7 @@ int Environment::get_camera_feed_id() const {
void Environment::set_tonemapper(ToneMapper p_tone_mapper) {
tone_mapper = p_tone_mapper;
VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
_change_notify();
}
Environment::ToneMapper Environment::get_tonemapper() const {
@ -287,6 +288,12 @@ void Environment::_validate_property(PropertyInfo &property) const {
}
}
if (property.name == "tonemap_white") {
if (tone_mapper == TONE_MAPPER_LINEAR) {
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
}
}
static const char *hide_prefixes[] = {
"fog_",
"auto_exposure_",