Merge pull request #116662 from KoBeWi/make_some_noise
Clean up `_validate_property()` implementations
This commit is contained in:
commit
b5ff3b5e3b
37 changed files with 268 additions and 250 deletions
|
|
@ -316,8 +316,7 @@ void InputEventWithModifiers::_validate_property(PropertyInfo &p_property) const
|
|||
if (p_property.name == "meta_pressed") {
|
||||
p_property.usage ^= PROPERTY_USAGE_STORAGE;
|
||||
p_property.usage ^= PROPERTY_USAGE_EDITOR;
|
||||
}
|
||||
if (p_property.name == "ctrl_pressed") {
|
||||
} else if (p_property.name == "ctrl_pressed") {
|
||||
p_property.usage ^= PROPERTY_USAGE_STORAGE;
|
||||
p_property.usage ^= PROPERTY_USAGE_EDITOR;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -437,7 +437,7 @@ void AudioStreamInteractive::_validate_property(PropertyInfo &r_property) const
|
|||
r_property.usage = PROPERTY_USAGE_INTERNAL;
|
||||
} else if (prop == "clip_" + itos(clip) + "/next_clip") {
|
||||
if (clips[clip].auto_advance != AUTO_ADVANCE_ENABLED) {
|
||||
r_property.usage = 0;
|
||||
r_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (Engine::get_singleton()->is_editor_hint()) {
|
||||
#ifdef TOOLS_ENABLED
|
||||
r_property.hint_string = _get_streams_hint();
|
||||
|
|
|
|||
|
|
@ -128,9 +128,8 @@ bool AudioStreamPlaylist::has_loop() const {
|
|||
}
|
||||
|
||||
void AudioStreamPlaylist::_validate_property(PropertyInfo &r_property) const {
|
||||
String prop = r_property.name;
|
||||
if (prop != "stream_count" && prop.begins_with("stream_")) {
|
||||
int stream = prop.get_slicec('/', 0).get_slicec('_', 1).to_int();
|
||||
if (r_property.name != "stream_count" && r_property.name.begins_with("stream_")) {
|
||||
int stream = r_property.name.get_slicec('/', 0).get_slicec('_', 1).to_int();
|
||||
if (stream >= stream_count) {
|
||||
r_property.usage = PROPERTY_USAGE_INTERNAL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -482,18 +482,24 @@ void FastNoiseLite::_validate_property(PropertyInfo &p_property) const {
|
|||
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||
return;
|
||||
}
|
||||
if (p_property.name.begins_with("cellular") && get_noise_type() != TYPE_CELLULAR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name.begins_with("cellular")) {
|
||||
if (get_noise_type() != TYPE_CELLULAR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name != "fractal_type" && p_property.name.begins_with("fractal") && get_fractal_type() == FRACTAL_NONE) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name != "fractal_type" && p_property.name.begins_with("fractal")) {
|
||||
if (get_fractal_type() == FRACTAL_NONE) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "fractal_ping_pong_strength" && get_fractal_type() != FRACTAL_PING_PONG) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name == "fractal_ping_pong_strength") {
|
||||
if (get_fractal_type() != FRACTAL_PING_PONG) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,9 +106,7 @@ void NoiseTexture2D::_validate_property(PropertyInfo &p_property) const {
|
|||
if (!as_normal_map) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_property.name == "seamless_blend_skirt") {
|
||||
} else if (p_property.name == "seamless_blend_skirt") {
|
||||
if (!seamless) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,10 +117,12 @@ void AnimatedSprite2D::_validate_property(PropertyInfo &p_property) const {
|
|||
return;
|
||||
}
|
||||
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||
if (p_property.name == "frame" && playing) {
|
||||
p_property.usage = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY;
|
||||
if (p_property.name == "frame") {
|
||||
if (playing) {
|
||||
p_property.usage = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (p_property.name == "animation") {
|
||||
List<StringName> names;
|
||||
|
|
|
|||
|
|
@ -634,44 +634,46 @@ void CPUParticles2D::request_particles_process(real_t p_requested_process_time)
|
|||
void CPUParticles2D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") {
|
||||
p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_sphere_radius" && (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE)) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_rect_extents" && emission_shape != EMISSION_SHAPE_RECTANGLE) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if ((p_property.name == "emission_point_texture" || p_property.name == "emission_color_texture") && (emission_shape < EMISSION_SHAPE_POINTS)) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_normals" && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_points" && emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_colors" && emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (p_property.name.begins_with("scale_curve_") && !split_scale) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_ring_inner_radius" && emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (p_property.name == "emission_ring_radius" && emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "seed" && !use_fixed_seed) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (p_property.name == "emission_sphere_radius") {
|
||||
if (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_rect_extents") {
|
||||
if (emission_shape != EMISSION_SHAPE_RECTANGLE) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_point_texture" || p_property.name == "emission_color_texture") {
|
||||
if (emission_shape < EMISSION_SHAPE_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_normals") {
|
||||
if (emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_points") {
|
||||
if (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_colors") {
|
||||
if (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name.begins_with("scale_curve_")) {
|
||||
if (!split_scale) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_ring_inner_radius") {
|
||||
if (emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_ring_radius") {
|
||||
if (emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "seed") {
|
||||
if (!use_fixed_seed) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -428,10 +428,11 @@ Ref<Texture2D> GPUParticles2D::get_texture() const {
|
|||
}
|
||||
|
||||
void GPUParticles2D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (p_property.name == "seed" && !use_fixed_seed) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") {
|
||||
if (p_property.name == "seed") {
|
||||
if (!use_fixed_seed) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") {
|
||||
p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -795,9 +795,7 @@ void RigidBody2D::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
if (center_of_mass_mode != CENTER_OF_MASS_MODE_CUSTOM && p_property.name == "center_of_mass") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (!contact_monitor && p_property.name == "max_contacts_reported") {
|
||||
} else if (!contact_monitor && p_property.name == "max_contacts_reported") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -468,9 +468,7 @@ void Sprite2D::_validate_property(PropertyInfo &p_property) const {
|
|||
p_property.hint = PROPERTY_HINT_RANGE;
|
||||
p_property.hint_string = "0," + itos(vframes * hframes - 1) + ",1";
|
||||
p_property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS;
|
||||
}
|
||||
|
||||
if (p_property.name == "frame_coords") {
|
||||
} else if (p_property.name == "frame_coords") {
|
||||
p_property.usage |= PROPERTY_USAGE_KEYING_INCREMENTS;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ void BoneAttachment3D::_validate_property(PropertyInfo &p_property) const {
|
|||
p_property.hint = PROPERTY_HINT_NONE;
|
||||
p_property.hint_string = "";
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "external_skeleton" && !use_external_skeleton) {
|
||||
|
|
|
|||
|
|
@ -122,14 +122,17 @@ void Camera3D::_validate_property(PropertyInfo &p_property) const {
|
|||
if (mode != PROJECTION_PERSPECTIVE) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
} else if (p_property.name == "size") {
|
||||
if (mode != PROJECTION_ORTHOGONAL && mode != PROJECTION_FRUSTUM) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
} else if (p_property.name == "frustum_offset") {
|
||||
if (mode != PROJECTION_FRUSTUM) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -590,38 +590,38 @@ void CPUParticles3D::request_particles_process(real_t p_requested_process_time)
|
|||
void CPUParticles3D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") {
|
||||
p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_sphere_radius" && (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE)) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_box_extents" && emission_shape != EMISSION_SHAPE_BOX) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if ((p_property.name == "emission_point_texture" || p_property.name == "emission_color_texture" || p_property.name == "emission_points") && (emission_shape != EMISSION_SHAPE_POINTS && (emission_shape != EMISSION_SHAPE_DIRECTED_POINTS))) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_normals" && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name.begins_with("emission_ring_") && emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name.begins_with("orbit_") && !particle_flags[PARTICLE_FLAG_DISABLE_Z]) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name.begins_with("scale_curve_") && !split_scale) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "seed" && !use_fixed_seed) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (p_property.name == "emission_sphere_radius") {
|
||||
if (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_box_extents") {
|
||||
if (emission_shape != EMISSION_SHAPE_BOX) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_point_texture" || p_property.name == "emission_color_texture" || p_property.name == "emission_points") {
|
||||
if (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_normals") {
|
||||
if (emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name.begins_with("emission_ring_")) {
|
||||
if (emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name.begins_with("orbit_")) {
|
||||
if (!particle_flags[PARTICLE_FLAG_DISABLE_Z]) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name.begins_with("scale_curve_")) {
|
||||
if (!split_scale) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "seed") {
|
||||
if (!use_fixed_seed) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@ void FogVolume::_bind_methods() {
|
|||
void FogVolume::_validate_property(PropertyInfo &p_property) const {
|
||||
if (p_property.name == "size" && shape == RS::FOG_VOLUME_SHAPE_WORLD) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -457,16 +457,13 @@ AABB GPUParticles3D::capture_aabb() const {
|
|||
void GPUParticles3D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") {
|
||||
p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name.begins_with("draw_pass_")) {
|
||||
} else if (p_property.name.begins_with("draw_pass_")) {
|
||||
int index = p_property.name.get_slicec('_', 2).to_int() - 1;
|
||||
if (index >= draw_passes.size()) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (p_property.name == "seed" && !use_fixed_seed) {
|
||||
} else if (p_property.name == "seed" && !use_fixed_seed) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -191,9 +191,7 @@ void Label3D::_validate_property(PropertyInfo &p_property) const {
|
|||
p_property.name == "gi_mode" ||
|
||||
p_property.name == "gi_lightmap_scale") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (p_property.name == "cast_shadow" && alpha_cut == ALPHA_CUT_DISABLED) {
|
||||
} else if (p_property.name == "cast_shadow" && alpha_cut == ALPHA_CUT_DISABLED) {
|
||||
// Alpha-blended materials can't cast shadows.
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -327,9 +327,7 @@ void Light3D::_validate_property(PropertyInfo &p_property) const {
|
|||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (get_light_type() == RS::LIGHT_DIRECTIONAL && p_property.name == "light_intensity_lumens") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (!GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units") && (p_property.name == "light_intensity_lumens" || p_property.name == "light_intensity_lux" || p_property.name == "light_temperature")) {
|
||||
} else if (!GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units") && (p_property.name == "light_intensity_lumens" || p_property.name == "light_intensity_lux" || p_property.name == "light_temperature")) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
|
|
@ -551,14 +549,10 @@ void DirectionalLight3D::_validate_property(PropertyInfo &p_property) const {
|
|||
// Splits 3 and 4 are only used with the PSSM 4 Splits shadow mode.
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_property.name == "light_size" || p_property.name == "light_projector") {
|
||||
} else if (p_property.name == "light_size" || p_property.name == "light_projector") {
|
||||
// Not implemented in DirectionalLight3D (`light_size` is replaced by `light_angular_distance`).
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "distance_fade_enabled" || p_property.name == "distance_fade_begin" || p_property.name == "distance_fade_shadow" || p_property.name == "distance_fade_length") {
|
||||
} else if (p_property.name == "distance_fade_enabled" || p_property.name == "distance_fade_begin" || p_property.name == "distance_fade_shadow" || p_property.name == "distance_fade_length") {
|
||||
// Not relevant for DirectionalLight3D, as the light LOD system only pertains to point lights.
|
||||
// For DirectionalLight3D, `directional_shadow_max_distance` can be used instead.
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
|
|
|
|||
|
|
@ -1828,23 +1828,30 @@ void LightmapGI::_validate_property(PropertyInfo &p_property) const {
|
|||
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||
return;
|
||||
}
|
||||
if (p_property.name == "supersampling_factor" && !supersampling_enabled) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
if (p_property.name == "environment_custom_sky" && environment_mode != ENVIRONMENT_MODE_CUSTOM_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
if (p_property.name == "environment_custom_color" && environment_mode != ENVIRONMENT_MODE_CUSTOM_COLOR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
if (p_property.name == "environment_custom_energy" && environment_mode != ENVIRONMENT_MODE_CUSTOM_COLOR && environment_mode != ENVIRONMENT_MODE_CUSTOM_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
if (p_property.name == "denoiser_strength" && !use_denoiser) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
if (p_property.name == "denoiser_range" && !use_denoiser) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name == "supersampling_factor") {
|
||||
if (!supersampling_enabled) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
} else if (p_property.name == "environment_custom_sky") {
|
||||
if (environment_mode != ENVIRONMENT_MODE_CUSTOM_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
} else if (p_property.name == "environment_custom_color") {
|
||||
if (environment_mode != ENVIRONMENT_MODE_CUSTOM_COLOR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
} else if (p_property.name == "environment_custom_energy") {
|
||||
if (environment_mode != ENVIRONMENT_MODE_CUSTOM_COLOR && environment_mode != ENVIRONMENT_MODE_CUSTOM_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
} else if (p_property.name == "denoiser_strength") {
|
||||
if (!use_denoiser) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
} else if (p_property.name == "denoiser_range") {
|
||||
if (!use_denoiser) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -347,7 +347,6 @@ void NavigationAgent3D::_notification(int p_what) {
|
|||
void NavigationAgent3D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (p_property.name == "keep_y_velocity" && use_3d_avoidance) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1350,19 +1350,15 @@ NodePath Node3D::get_visibility_parent() const {
|
|||
|
||||
void Node3D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (data.rotation_edit_mode != ROTATION_EDIT_MODE_BASIS && p_property.name == "basis") {
|
||||
p_property.usage = 0;
|
||||
}
|
||||
if (data.rotation_edit_mode == ROTATION_EDIT_MODE_BASIS && p_property.name == "scale") {
|
||||
p_property.usage = 0;
|
||||
}
|
||||
if (data.rotation_edit_mode != ROTATION_EDIT_MODE_QUATERNION && p_property.name == "quaternion") {
|
||||
p_property.usage = 0;
|
||||
}
|
||||
if (data.rotation_edit_mode != ROTATION_EDIT_MODE_EULER && p_property.name == "rotation") {
|
||||
p_property.usage = 0;
|
||||
}
|
||||
if (data.rotation_edit_mode != ROTATION_EDIT_MODE_EULER && p_property.name == "rotation_order") {
|
||||
p_property.usage = 0;
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (data.rotation_edit_mode == ROTATION_EDIT_MODE_BASIS && p_property.name == "scale") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (data.rotation_edit_mode != ROTATION_EDIT_MODE_QUATERNION && p_property.name == "quaternion") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (data.rotation_edit_mode != ROTATION_EDIT_MODE_EULER && p_property.name == "rotation") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
} else if (data.rotation_edit_mode != ROTATION_EDIT_MODE_EULER && p_property.name == "rotation_order") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -813,9 +813,7 @@ void RigidBody3D::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
if (center_of_mass_mode != CENTER_OF_MASS_MODE_CUSTOM && p_property.name == "center_of_mass") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (!contact_monitor && p_property.name == "max_contacts_reported") {
|
||||
} else if (!contact_monitor && p_property.name == "max_contacts_reported") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -599,8 +599,7 @@ String AnimationNodeBlendSpace2D::get_caption() const {
|
|||
void AnimationNodeBlendSpace2D::_validate_property(PropertyInfo &p_property) const {
|
||||
if (auto_triangles && p_property.name == "triangles") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (p_property.name.begins_with("blend_point_")) {
|
||||
} else if (p_property.name.begins_with("blend_point_")) {
|
||||
String left = p_property.name.get_slicec('/', 0);
|
||||
int idx = left.get_slicec('_', 2).to_int();
|
||||
if (idx >= blend_points_used) {
|
||||
|
|
|
|||
|
|
@ -91,9 +91,7 @@ void AnimationNodeAnimation::_validate_property(PropertyInfo &p_property) const
|
|||
p_property.hint = PROPERTY_HINT_ENUM;
|
||||
p_property.hint_string = anims;
|
||||
}
|
||||
}
|
||||
|
||||
if (!use_custom_timeline) {
|
||||
} else if (!use_custom_timeline) {
|
||||
if (p_property.name == "timeline_length" || p_property.name == "start_offset" || p_property.name == "loop_mode" || p_property.name == "stretch_time_scale") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ void AnimationMixer::_validate_property(PropertyInfo &p_property) const {
|
|||
#ifdef TOOLS_ENABLED // `editing` is surrounded by TOOLS_ENABLED so this should also be.
|
||||
if (Engine::get_singleton()->is_editor_hint() && editing && (p_property.name == "active" || p_property.name == "deterministic" || p_property.name == "root_motion_track")) {
|
||||
p_property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
return;
|
||||
}
|
||||
#endif // TOOLS_ENABLED
|
||||
if (root_motion_track.is_empty() && p_property.name == "root_motion_local") {
|
||||
|
|
|
|||
|
|
@ -514,6 +514,7 @@ void Control::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
|
||||
p_property.hint_string = hint_string;
|
||||
return;
|
||||
}
|
||||
|
||||
if (Engine::get_singleton()->is_editor_hint() && p_property.name == "mouse_force_pass_scroll_events") {
|
||||
|
|
@ -521,6 +522,7 @@ void Control::_validate_property(PropertyInfo &p_property) const {
|
|||
if (data.mouse_filter != MOUSE_FILTER_STOP) {
|
||||
p_property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (Engine::get_singleton()->is_editor_hint() && p_property.name == "scale") {
|
||||
|
|
|
|||
|
|
@ -190,8 +190,7 @@ void ProgressBar::_notification(int p_what) {
|
|||
void ProgressBar::_validate_property(PropertyInfo &p_property) const {
|
||||
if (Engine::get_singleton()->is_editor_hint() && indeterminate && p_property.name == "show_percentage") {
|
||||
p_property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
if (!indeterminate && p_property.name == "editor_preview_indeterminate") {
|
||||
} else if (!indeterminate && p_property.name == "editor_preview_indeterminate") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -641,9 +641,7 @@ void TextureProgressBar::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
if (p_property.name.begins_with("stretch_margin_") && !nine_patch_stretch) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (p_property.name.begins_with("radial_") && (mode != FillMode::FILL_CLOCKWISE && mode != FillMode::FILL_COUNTER_CLOCKWISE && mode != FillMode::FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE)) {
|
||||
} else if (p_property.name.begins_with("radial_") && (mode != FillMode::FILL_CLOCKWISE && mode != FillMode::FILL_COUNTER_CLOCKWISE && mode != FillMode::FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE)) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3584,7 +3584,7 @@ void Node::_call_unhandled_key_input(const Ref<InputEvent> &p_event) {
|
|||
|
||||
void Node::_validate_property(PropertyInfo &p_property) const {
|
||||
if ((p_property.name == "process_thread_group_order" || p_property.name == "process_thread_messages") && data.process_thread_group == PROCESS_THREAD_GROUP_INHERIT) {
|
||||
p_property.usage = 0;
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5339,9 +5339,7 @@ void Viewport::_validate_property(PropertyInfo &p_property) const {
|
|||
}
|
||||
if (vrs_mode != VRS_TEXTURE && (p_property.name == "vrs_texture")) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (vrs_mode == VRS_DISABLED && (p_property.name == "vrs_update_mode")) {
|
||||
} else if (vrs_mode == VRS_DISABLED && (p_property.name == "vrs_update_mode")) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -625,14 +625,13 @@ void NavigationPolygon::_validate_property(PropertyInfo &p_property) const {
|
|||
if (p_property.name == "parsed_collision_mask") {
|
||||
if (parsed_geometry_type == PARSED_GEOMETRY_MESH_INSTANCES) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "parsed_source_group_name") {
|
||||
if (source_geometry_mode == SOURCE_GEOMETRY_ROOT_NODE_CHILDREN) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4235,10 +4235,14 @@ void TileSet::_validate_property(PropertyInfo &p_property) const {
|
|||
if (!Engine::get_singleton()->is_editor_hint()) {
|
||||
return;
|
||||
}
|
||||
if (p_property.name == "tile_layout" && tile_shape == TILE_SHAPE_SQUARE) {
|
||||
p_property.usage ^= PROPERTY_USAGE_READ_ONLY;
|
||||
} else if (p_property.name == "tile_offset_axis" && tile_shape == TILE_SHAPE_SQUARE) {
|
||||
p_property.usage ^= PROPERTY_USAGE_READ_ONLY;
|
||||
if (p_property.name == "tile_layout") {
|
||||
if (tile_shape == TILE_SHAPE_SQUARE) {
|
||||
p_property.usage ^= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
} else if (p_property.name == "tile_offset_axis") {
|
||||
if (tile_shape == TILE_SHAPE_SQUARE) {
|
||||
p_property.usage ^= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -458,7 +458,6 @@ void CameraAttributesPhysical::_validate_property(PropertyInfo &property) const
|
|||
}
|
||||
if (!GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units") && (property.name == "exposure_aperture" || property.name == "exposure_shutter_speed")) {
|
||||
property.usage = PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,14 +74,18 @@ void CompositorEffect::_bind_methods() {
|
|||
}
|
||||
|
||||
void CompositorEffect::_validate_property(PropertyInfo &p_property) const {
|
||||
if (p_property.name == "access_resolved_color" && effect_callback_type == EFFECT_CALLBACK_TYPE_POST_TRANSPARENT) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (p_property.name == "access_resolved_depth" && effect_callback_type == EFFECT_CALLBACK_TYPE_POST_TRANSPARENT) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (p_property.name == "needs_separate_specular" && effect_callback_type != EFFECT_CALLBACK_TYPE_POST_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
if (p_property.name == "access_resolved_color") {
|
||||
if (effect_callback_type == EFFECT_CALLBACK_TYPE_POST_TRANSPARENT) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "access_resolved_depth") {
|
||||
if (effect_callback_type == EFFECT_CALLBACK_TYPE_POST_TRANSPARENT) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "needs_separate_specular") {
|
||||
if (effect_callback_type != EFFECT_CALLBACK_TYPE_POST_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1108,56 +1108,75 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
|
|||
if (bg_mode != BG_SKY && ambient_source != AMBIENT_SOURCE_SKY && reflection_source != REFLECTION_SOURCE_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "fog_depth_curve" || p_property.name == "fog_depth_begin" || p_property.name == "fog_depth_end") {
|
||||
if (fog_mode == FOG_MODE_EXPONENTIAL) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "ambient_light_color" || p_property.name == "ambient_light_energy") {
|
||||
if (ambient_source == AMBIENT_SOURCE_DISABLED) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "ambient_light_sky_contribution") {
|
||||
if (ambient_source == AMBIENT_SOURCE_DISABLED || ambient_source == AMBIENT_SOURCE_COLOR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "fog_aerial_perspective") {
|
||||
if (bg_mode != BG_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "tonemap_white" && (tone_mapper == TONE_MAPPER_LINEAR || tone_mapper == TONE_MAPPER_AGX)) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name == "tonemap_white") {
|
||||
if (tone_mapper == TONE_MAPPER_LINEAR || tone_mapper == TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "tonemap_agx_white" && tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name == "tonemap_agx_white") {
|
||||
if (tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "tonemap_agx_contrast" && tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name == "tonemap_agx_contrast") {
|
||||
if (tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "glow_intensity" && glow_blend_mode == GLOW_BLEND_MODE_MIX && OS::get_singleton()->get_current_rendering_method() != "gl_compatibility") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name == "glow_intensity") {
|
||||
if (glow_blend_mode == GLOW_BLEND_MODE_MIX && OS::get_singleton()->get_current_rendering_method() != "gl_compatibility") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
|
||||
// Hide glow properties we do not support in GL Compatibility.
|
||||
if (p_property.name.begins_with("glow_levels") || p_property.name == "glow_normalized" || p_property.name == "glow_strength" || p_property.name == "glow_mix" || p_property.name == "glow_blend_mode" || p_property.name == "glow_map_strength" || p_property.name == "glow_map") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (p_property.name == "glow_mix" && glow_blend_mode != GLOW_BLEND_MODE_MIX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1167,6 +1186,7 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
|
|||
if ((p_property.name != "ssao_enabled") && (p_property.name != "ssao_radius") && (p_property.name != "ssao_intensity")) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1174,18 +1194,21 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
|
|||
if (bg_mode != BG_COLOR && ambient_source != AMBIENT_SOURCE_COLOR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "background_canvas_max_layer") {
|
||||
if (bg_mode != BG_CANVAS) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "background_camera_feed_id") {
|
||||
if (bg_mode != BG_CAMERA_FEED) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "background_intensity" && !GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units")) {
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ RID Material::get_rid() const {
|
|||
void Material::_validate_property(PropertyInfo &p_property) const {
|
||||
if (!_can_do_next_pass() && p_property.name == "next_pass") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (!_can_use_render_priority() && p_property.name == "render_priority") {
|
||||
} else if (!_can_use_render_priority() && p_property.name == "render_priority") {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -630,9 +630,7 @@ void NavigationMesh::_validate_property(PropertyInfo &p_property) const {
|
|||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (p_property.name == "geometry_source_group_name") {
|
||||
} else if (p_property.name == "geometry_source_group_name") {
|
||||
if (source_geometry_mode == SOURCE_GEOMETRY_ROOT_NODE_CHILDREN) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1882,66 +1882,68 @@ RID ParticleProcessMaterial::get_shader_rid() const {
|
|||
}
|
||||
|
||||
void ParticleProcessMaterial::_validate_property(PropertyInfo &p_property) const {
|
||||
if (p_property.name == "emission_sphere_radius" && (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE)) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_box_extents" && emission_shape != EMISSION_SHAPE_BOX) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if ((p_property.name == "emission_point_texture" || p_property.name == "emission_color_texture") && (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS)) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_normal_texture" && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "emission_point_count" && (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS)) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name.begins_with("emission_ring_") && emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "sub_emitter_frequency" && sub_emitter_mode != SUB_EMITTER_CONSTANT) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "sub_emitter_amount_at_end" && sub_emitter_mode != SUB_EMITTER_AT_END) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "sub_emitter_amount_at_collision" && sub_emitter_mode != SUB_EMITTER_AT_COLLISION) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "sub_emitter_amount_at_start" && sub_emitter_mode != SUB_EMITTER_AT_START) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "collision_friction" && collision_mode != COLLISION_RIGID) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.name == "collision_bounce" && collision_mode != COLLISION_RIGID) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if ((p_property.name == "directional_velocity_min" || p_property.name == "directional_velocity_max") && !tex_parameters[PARAM_DIRECTIONAL_VELOCITY].is_valid()) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (Engine::get_singleton()->is_editor_hint()) {
|
||||
if ((p_property.name == "scale_over_velocity_min" || p_property.name == "scale_over_velocity_max") && !tex_parameters[PARAM_SCALE_OVER_VELOCITY].is_valid()) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
if (p_property.name == "emission_sphere_radius") {
|
||||
if (emission_shape != EMISSION_SHAPE_SPHERE && emission_shape != EMISSION_SHAPE_SPHERE_SURFACE) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if ((p_property.name == "orbit_velocity_min" || p_property.name == "orbit_velocity_max") && (!tex_parameters[PARAM_ORBIT_VELOCITY].is_valid() && !particle_flags[PARTICLE_FLAG_DISABLE_Z])) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
} else if (p_property.name == "emission_box_extents") {
|
||||
if (emission_shape != EMISSION_SHAPE_BOX) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
|
||||
if (p_property.usage & PROPERTY_USAGE_EDITOR && (p_property.name.ends_with("_min") || p_property.name.ends_with("_max"))) {
|
||||
} else if (p_property.name == "emission_point_texture" || p_property.name == "emission_color_texture") {
|
||||
if (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_normal_texture") {
|
||||
if (emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "emission_point_count") {
|
||||
if (emission_shape != EMISSION_SHAPE_POINTS && emission_shape != EMISSION_SHAPE_DIRECTED_POINTS) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name.begins_with("emission_ring_")) {
|
||||
if (emission_shape != EMISSION_SHAPE_RING) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "sub_emitter_frequency") {
|
||||
if (sub_emitter_mode != SUB_EMITTER_CONSTANT) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "sub_emitter_amount_at_end") {
|
||||
if (sub_emitter_mode != SUB_EMITTER_AT_END) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "sub_emitter_amount_at_collision") {
|
||||
if (sub_emitter_mode != SUB_EMITTER_AT_COLLISION) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "sub_emitter_amount_at_start") {
|
||||
if (sub_emitter_mode != SUB_EMITTER_AT_START) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "collision_friction") {
|
||||
if (collision_mode != COLLISION_RIGID) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "collision_bounce") {
|
||||
if (collision_mode != COLLISION_RIGID) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (p_property.name == "directional_velocity_min" || p_property.name == "directional_velocity_max") {
|
||||
if (!tex_parameters[PARAM_DIRECTIONAL_VELOCITY].is_valid()) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
} else if (Engine::get_singleton()->is_editor_hint()) {
|
||||
if (p_property.name == "scale_over_velocity_min" || p_property.name == "scale_over_velocity_max") {
|
||||
if (!tex_parameters[PARAM_SCALE_OVER_VELOCITY].is_valid()) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
} else if (p_property.name == "orbit_velocity_min" || p_property.name == "orbit_velocity_max") {
|
||||
if (!tex_parameters[PARAM_ORBIT_VELOCITY].is_valid() && !particle_flags[PARTICLE_FLAG_DISABLE_Z]) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
} else if (p_property.usage & PROPERTY_USAGE_EDITOR && (p_property.name.ends_with("_min") || p_property.name.ends_with("_max"))) {
|
||||
p_property.usage &= ~PROPERTY_USAGE_EDITOR;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue