diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 7aa872bf85d..ebb7d24bf63 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -950,6 +950,9 @@ bool CSGShape3D::is_calculating_tangents() const { } void CSGShape3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } bool is_collision_prefixed = p_property.name.begins_with("collision_"); if ((is_collision_prefixed || p_property.name.begins_with("use_collision")) && is_inside_tree() && !is_root_shape()) { //hide collision if not root diff --git a/modules/interactive_music/audio_stream_interactive.cpp b/modules/interactive_music/audio_stream_interactive.cpp index 66c6f3e24e8..eb5524078b7 100644 --- a/modules/interactive_music/audio_stream_interactive.cpp +++ b/modules/interactive_music/audio_stream_interactive.cpp @@ -416,17 +416,18 @@ String AudioStreamInteractive::_get_streams_hint() const { } #endif + void AudioStreamInteractive::_validate_property(PropertyInfo &r_property) const { String prop = r_property.name; + if (Engine::get_singleton()->is_editor_hint() && prop == "switch_to") { #ifdef TOOLS_ENABLED - if (prop == "switch_to") { r_property.hint_string = _get_streams_hint(); +#endif return; } -#endif - if (prop == "initial_clip") { + if (Engine::get_singleton()->is_editor_hint() && prop == "initial_clip") { #ifdef TOOLS_ENABLED r_property.hint_string = _get_streams_hint(); #endif @@ -437,7 +438,7 @@ void AudioStreamInteractive::_validate_property(PropertyInfo &r_property) const } else if (prop == "clip_" + itos(clip) + "/next_clip") { if (clips[clip].auto_advance != AUTO_ADVANCE_ENABLED) { r_property.usage = 0; - } else { + } else if (Engine::get_singleton()->is_editor_hint()) { #ifdef TOOLS_ENABLED r_property.hint_string = _get_streams_hint(); #endif diff --git a/modules/noise/fastnoise_lite.cpp b/modules/noise/fastnoise_lite.cpp index 1b0ef6506bc..d78964073e9 100644 --- a/modules/noise/fastnoise_lite.cpp +++ b/modules/noise/fastnoise_lite.cpp @@ -30,6 +30,8 @@ #include "fastnoise_lite.h" +#include "core/config/engine.h" + _FastNoiseLite::FractalType FastNoiseLite::_convert_domain_warp_fractal_type_enum(DomainWarpFractalType p_domain_warp_fractal_type) { _FastNoiseLite::FractalType type; switch (p_domain_warp_fractal_type) { @@ -477,6 +479,9 @@ void FastNoiseLite::_bind_methods() { } 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; return; diff --git a/modules/noise/noise_texture_2d.cpp b/modules/noise/noise_texture_2d.cpp index b55b1141e17..dd87aa6f59d 100644 --- a/modules/noise/noise_texture_2d.cpp +++ b/modules/noise/noise_texture_2d.cpp @@ -97,6 +97,9 @@ void NoiseTexture2D::_bind_methods() { } void NoiseTexture2D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "bump_strength") { if (!as_normal_map) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; diff --git a/modules/noise/noise_texture_3d.cpp b/modules/noise/noise_texture_3d.cpp index e3cca8a09fa..b4401742418 100644 --- a/modules/noise/noise_texture_3d.cpp +++ b/modules/noise/noise_texture_3d.cpp @@ -83,6 +83,9 @@ void NoiseTexture3D::_bind_methods() { } void NoiseTexture3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "seamless_blend_skirt") { if (!seamless) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; diff --git a/modules/openxr/scene/openxr_composition_layer.cpp b/modules/openxr/scene/openxr_composition_layer.cpp index c71455358c5..8263d0100c5 100644 --- a/modules/openxr/scene/openxr_composition_layer.cpp +++ b/modules/openxr/scene/openxr_composition_layer.cpp @@ -677,6 +677,9 @@ bool OpenXRCompositionLayer::_set(const StringName &p_property, const Variant &p } void OpenXRCompositionLayer::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "layer_viewport") { if (use_android_surface) { p_property.usage &= ~PROPERTY_USAGE_EDITOR; diff --git a/scene/2d/animated_sprite_2d.cpp b/scene/2d/animated_sprite_2d.cpp index 07750883672..0813d0084db 100644 --- a/scene/2d/animated_sprite_2d.cpp +++ b/scene/2d/animated_sprite_2d.cpp @@ -116,7 +116,12 @@ void AnimatedSprite2D::_validate_property(PropertyInfo &p_property) const { if (frames.is_null()) { return; } - + if (!Engine::get_singleton()->is_editor_hint()) { + if (p_property.name == "frame" && playing) { + p_property.usage = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY; + } + return; + } if (p_property.name == "animation") { List names; frames->get_animation_list(&names); diff --git a/scene/2d/back_buffer_copy.cpp b/scene/2d/back_buffer_copy.cpp index 045dd3be025..9561971def7 100644 --- a/scene/2d/back_buffer_copy.cpp +++ b/scene/2d/back_buffer_copy.cpp @@ -80,6 +80,9 @@ BackBufferCopy::CopyMode BackBufferCopy::get_copy_mode() const { } void BackBufferCopy::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (copy_mode != COPY_MODE_RECT && p_property.name == "rect") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/2d/cpu_particles_2d.cpp b/scene/2d/cpu_particles_2d.cpp index bc8d0e4b003..af1e6d725d3 100644 --- a/scene/2d/cpu_particles_2d.cpp +++ b/scene/2d/cpu_particles_2d.cpp @@ -616,7 +616,7 @@ void CPUParticles2D::request_particles_process(real_t p_requested_process_time) } void CPUParticles2D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "emitting") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") { p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE; } diff --git a/scene/2d/gpu_particles_2d.cpp b/scene/2d/gpu_particles_2d.cpp index 647b36fa731..d40b9047b63 100644 --- a/scene/2d/gpu_particles_2d.cpp +++ b/scene/2d/gpu_particles_2d.cpp @@ -431,7 +431,7 @@ void GPUParticles2D::_validate_property(PropertyInfo &p_property) const { if (p_property.name == "seed" && !use_fixed_seed) { p_property.usage = PROPERTY_USAGE_NONE; } - if (p_property.name == "emitting") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") { p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE; } } diff --git a/scene/2d/light_2d.cpp b/scene/2d/light_2d.cpp index 2760229c9eb..db34558bf66 100644 --- a/scene/2d/light_2d.cpp +++ b/scene/2d/light_2d.cpp @@ -243,6 +243,9 @@ real_t Light2D::get_shadow_smooth() const { } void Light2D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (shadow && p_property.name == "shadow_filter_smooth" && shadow_filter == SHADOW_FILTER_NONE) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/2d/path_2d.cpp b/scene/2d/path_2d.cpp index f7ceca31324..4cec69d68fa 100644 --- a/scene/2d/path_2d.cpp +++ b/scene/2d/path_2d.cpp @@ -364,6 +364,9 @@ bool PathFollow2D::is_cubic_interpolation_enabled() const { } void PathFollow2D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "offset") { real_t max = 10000.0; if (path && path->get_curve().is_valid()) { diff --git a/scene/2d/physics/area_2d.cpp b/scene/2d/physics/area_2d.cpp index 305ac8248e1..38a8ae73d90 100644 --- a/scene/2d/physics/area_2d.cpp +++ b/scene/2d/physics/area_2d.cpp @@ -541,6 +541,9 @@ StringName Area2D::get_audio_bus_name() const { } void Area2D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "audio_bus_name") { String options; for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { diff --git a/scene/2d/physics/character_body_2d.cpp b/scene/2d/physics/character_body_2d.cpp index 9028a3846ef..e5022a28b25 100644 --- a/scene/2d/physics/character_body_2d.cpp +++ b/scene/2d/physics/character_body_2d.cpp @@ -646,6 +646,9 @@ void CharacterBody2D::_notification(int p_what) { } void CharacterBody2D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (motion_mode == MOTION_MODE_FLOATING) { if (p_property.name.begins_with("floor_") || p_property.name == "up_direction" || p_property.name == "slide_on_ceiling") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; diff --git a/scene/2d/physics/rigid_body_2d.cpp b/scene/2d/physics/rigid_body_2d.cpp index 0992d0c2176..4648df6eb67 100644 --- a/scene/2d/physics/rigid_body_2d.cpp +++ b/scene/2d/physics/rigid_body_2d.cpp @@ -790,6 +790,9 @@ void RigidBody2D::_bind_methods() { } void RigidBody2D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (center_of_mass_mode != CENTER_OF_MASS_MODE_CUSTOM && p_property.name == "center_of_mass") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/2d/sprite_2d.cpp b/scene/2d/sprite_2d.cpp index 50321757135..2e9af55dbff 100644 --- a/scene/2d/sprite_2d.cpp +++ b/scene/2d/sprite_2d.cpp @@ -461,6 +461,9 @@ Rect2 Sprite2D::get_rect() const { } void Sprite2D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "frame") { p_property.hint = PROPERTY_HINT_RANGE; p_property.hint_string = "0," + itos(vframes * hframes - 1) + ",1"; diff --git a/scene/2d/tile_map_layer.cpp b/scene/2d/tile_map_layer.cpp index 92432c926f0..faf2cc5049d 100644 --- a/scene/2d/tile_map_layer.cpp +++ b/scene/2d/tile_map_layer.cpp @@ -2203,6 +2203,9 @@ void TileMapLayer::_bind_methods() { } void TileMapLayer::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (is_y_sort_enabled()) { if (p_property.name == "rendering_quadrant_size") { p_property.usage |= PROPERTY_USAGE_READ_ONLY; diff --git a/scene/3d/bone_attachment_3d.cpp b/scene/3d/bone_attachment_3d.cpp index 1f7c3977826..c5d16b763a4 100644 --- a/scene/3d/bone_attachment_3d.cpp +++ b/scene/3d/bone_attachment_3d.cpp @@ -32,7 +32,7 @@ #include "bone_attachment_3d.compat.inc" void BoneAttachment3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "bone_name") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "bone_name") { // Because it is a constant function, we cannot use the get_skeleton function. const Skeleton3D *parent = nullptr; if (use_external_skeleton) { diff --git a/scene/3d/camera_3d.cpp b/scene/3d/camera_3d.cpp index ad7b4c87373..57046c00a53 100644 --- a/scene/3d/camera_3d.cpp +++ b/scene/3d/camera_3d.cpp @@ -117,17 +117,19 @@ void Camera3D::_update_camera_mode() { } void Camera3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "fov") { - if (mode != PROJECTION_PERSPECTIVE) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } - } else if (p_property.name == "size") { - if (mode != PROJECTION_ORTHOGONAL && mode != PROJECTION_FRUSTUM) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } - } else if (p_property.name == "frustum_offset") { - if (mode != PROJECTION_FRUSTUM) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; + if (Engine::get_singleton()->is_editor_hint()) { + if (p_property.name == "fov") { + if (mode != PROJECTION_PERSPECTIVE) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } + } else if (p_property.name == "size") { + if (mode != PROJECTION_ORTHOGONAL && mode != PROJECTION_FRUSTUM) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } + } else if (p_property.name == "frustum_offset") { + if (mode != PROJECTION_FRUSTUM) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } } } diff --git a/scene/3d/cpu_particles_3d.cpp b/scene/3d/cpu_particles_3d.cpp index 6f941f42e96..c44cab1d7b2 100644 --- a/scene/3d/cpu_particles_3d.cpp +++ b/scene/3d/cpu_particles_3d.cpp @@ -587,7 +587,7 @@ void CPUParticles3D::request_particles_process(real_t p_requested_process_time) } void CPUParticles3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "emitting") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") { p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE; } diff --git a/scene/3d/decal.cpp b/scene/3d/decal.cpp index 0e2dce74317..9920c19a14e 100644 --- a/scene/3d/decal.cpp +++ b/scene/3d/decal.cpp @@ -167,7 +167,7 @@ AABB Decal::get_aabb() const { } void Decal::_validate_property(PropertyInfo &p_property) const { - if (!distance_fade_enabled && (p_property.name == "distance_fade_begin" || p_property.name == "distance_fade_length")) { + if (Engine::get_singleton()->is_editor_hint() && !distance_fade_enabled && (p_property.name == "distance_fade_begin" || p_property.name == "distance_fade_length")) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/3d/gpu_particles_3d.cpp b/scene/3d/gpu_particles_3d.cpp index 44bad21be59..7555a9af02c 100644 --- a/scene/3d/gpu_particles_3d.cpp +++ b/scene/3d/gpu_particles_3d.cpp @@ -454,7 +454,7 @@ AABB GPUParticles3D::capture_aabb() const { } void GPUParticles3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "emitting") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "emitting") { p_property.hint = one_shot ? PROPERTY_HINT_ONESHOT : PROPERTY_HINT_NONE; } diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp index bc7e8ed27c1..2b511bac9af 100644 --- a/scene/3d/label_3d.cpp +++ b/scene/3d/label_3d.cpp @@ -180,6 +180,9 @@ void Label3D::_bind_methods() { } void Label3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if ( p_property.name == "material_override" || p_property.name == "material_overlay" || diff --git a/scene/3d/light_3d.cpp b/scene/3d/light_3d.cpp index 48163d7eec2..ee46b202237 100644 --- a/scene/3d/light_3d.cpp +++ b/scene/3d/light_3d.cpp @@ -541,14 +541,16 @@ DirectionalLight3D::SkyMode DirectionalLight3D::get_sky_mode() const { } void DirectionalLight3D::_validate_property(PropertyInfo &p_property) const { - if (shadow_mode == SHADOW_ORTHOGONAL && (p_property.name == "directional_shadow_split_1" || p_property.name == "directional_shadow_blend_splits")) { - // Split 2 and split blending are only used with the PSSM 2 Splits and PSSM 4 Splits shadow modes. - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (Engine::get_singleton()->is_editor_hint()) { + if (shadow_mode == SHADOW_ORTHOGONAL && (p_property.name == "directional_shadow_split_1" || p_property.name == "directional_shadow_blend_splits")) { + // Split 2 and split blending are only used with the PSSM 2 Splits and PSSM 4 Splits shadow modes. + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if ((shadow_mode == SHADOW_ORTHOGONAL || shadow_mode == SHADOW_PARALLEL_2_SPLITS) && (p_property.name == "directional_shadow_split_2" || p_property.name == "directional_shadow_split_3")) { - // Splits 3 and 4 are only used with the PSSM 4 Splits shadow mode. - p_property.usage = PROPERTY_USAGE_NO_EDITOR; + if ((shadow_mode == SHADOW_ORTHOGONAL || shadow_mode == SHADOW_PARALLEL_2_SPLITS) && (p_property.name == "directional_shadow_split_2" || p_property.name == "directional_shadow_split_3")) { + // 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") { diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index e015a6daa19..d9b30ba47d1 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -1800,6 +1800,9 @@ PackedStringArray LightmapGI::get_configuration_warnings() const { } 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; } diff --git a/scene/3d/look_at_modifier_3d.cpp b/scene/3d/look_at_modifier_3d.cpp index f166c3b4d30..11239253d85 100644 --- a/scene/3d/look_at_modifier_3d.cpp +++ b/scene/3d/look_at_modifier_3d.cpp @@ -31,7 +31,7 @@ #include "look_at_modifier_3d.h" void LookAtModifier3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "bone_name" || p_property.name == "origin_bone_name") { + if (Engine::get_singleton()->is_editor_hint() && (p_property.name == "bone_name" || p_property.name == "origin_bone_name")) { Skeleton3D *skeleton = get_skeleton(); if (skeleton) { p_property.hint = PROPERTY_HINT_ENUM; diff --git a/scene/3d/path_3d.cpp b/scene/3d/path_3d.cpp index 4fcd560ef29..bbeefb44daa 100644 --- a/scene/3d/path_3d.cpp +++ b/scene/3d/path_3d.cpp @@ -336,6 +336,9 @@ bool PathFollow3D::is_cubic_interpolation_enabled() const { } void PathFollow3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "offset") { real_t max = 10000; if (path && path->get_curve().is_valid()) { diff --git a/scene/3d/physics/area_3d.cpp b/scene/3d/physics/area_3d.cpp index be95512beae..314eeb53496 100644 --- a/scene/3d/physics/area_3d.cpp +++ b/scene/3d/physics/area_3d.cpp @@ -645,6 +645,9 @@ float Area3D::get_reverb_uniformity() const { } void Area3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "audio_bus_name" || p_property.name == "reverb_bus_name") { String options; for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { diff --git a/scene/3d/physics/character_body_3d.cpp b/scene/3d/physics/character_body_3d.cpp index f77260712db..886492fe740 100644 --- a/scene/3d/physics/character_body_3d.cpp +++ b/scene/3d/physics/character_body_3d.cpp @@ -931,6 +931,9 @@ void CharacterBody3D::_bind_methods() { } void CharacterBody3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (motion_mode == MOTION_MODE_FLOATING) { if (p_property.name.begins_with("floor_") || p_property.name == "up_direction" || p_property.name == "slide_on_ceiling") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; diff --git a/scene/3d/physics/rigid_body_3d.cpp b/scene/3d/physics/rigid_body_3d.cpp index b96c4f050cb..e71a52db158 100644 --- a/scene/3d/physics/rigid_body_3d.cpp +++ b/scene/3d/physics/rigid_body_3d.cpp @@ -808,6 +808,9 @@ void RigidBody3D::_bind_methods() { } void RigidBody3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (center_of_mass_mode != CENTER_OF_MASS_MODE_CUSTOM && p_property.name == "center_of_mass") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/3d/reflection_probe.cpp b/scene/3d/reflection_probe.cpp index 0cbef89c507..b9f060b72b6 100644 --- a/scene/3d/reflection_probe.cpp +++ b/scene/3d/reflection_probe.cpp @@ -201,6 +201,9 @@ AABB ReflectionProbe::get_aabb() const { } void ReflectionProbe::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "ambient_color" || p_property.name == "ambient_color_energy") { if (ambient_mode != AMBIENT_COLOR) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; diff --git a/scene/3d/skeleton_ik_3d.cpp b/scene/3d/skeleton_ik_3d.cpp index 86be72715ea..9f36d6ac941 100644 --- a/scene/3d/skeleton_ik_3d.cpp +++ b/scene/3d/skeleton_ik_3d.cpp @@ -301,6 +301,9 @@ void FabrikInverseKinematic::_update_chain(const Skeleton3D *p_sk, ChainItem *p_ } void SkeletonIK3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "root_bone" || p_property.name == "tip_bone") { Skeleton3D *skeleton = get_skeleton(); if (skeleton) { diff --git a/scene/3d/skeleton_modifier_3d.cpp b/scene/3d/skeleton_modifier_3d.cpp index 700e4e539cd..d4c157734ad 100644 --- a/scene/3d/skeleton_modifier_3d.cpp +++ b/scene/3d/skeleton_modifier_3d.cpp @@ -30,10 +30,6 @@ #include "skeleton_modifier_3d.h" -void SkeletonModifier3D::_validate_property(PropertyInfo &p_property) const { - // -} - PackedStringArray SkeletonModifier3D::get_configuration_warnings() const { PackedStringArray warnings = Node3D::get_configuration_warnings(); if (skeleton_id.is_null()) { diff --git a/scene/3d/skeleton_modifier_3d.h b/scene/3d/skeleton_modifier_3d.h index a86a0711548..8a3913367a0 100644 --- a/scene/3d/skeleton_modifier_3d.h +++ b/scene/3d/skeleton_modifier_3d.h @@ -65,7 +65,6 @@ protected: GDVIRTUAL2(_skeleton_changed, Skeleton3D *, Skeleton3D *); GDVIRTUAL0(_validate_bone_names); - void _validate_property(PropertyInfo &p_property) const; void _notification(int p_what); static void _bind_methods(); diff --git a/scene/3d/spring_bone_collision_3d.cpp b/scene/3d/spring_bone_collision_3d.cpp index 32130aeca8d..14f644bc021 100644 --- a/scene/3d/spring_bone_collision_3d.cpp +++ b/scene/3d/spring_bone_collision_3d.cpp @@ -44,7 +44,7 @@ PackedStringArray SpringBoneCollision3D::get_configuration_warnings() const { } void SpringBoneCollision3D::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "bone_name") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "bone_name") { Skeleton3D *sk = get_skeleton(); if (sk) { p_property.hint = PROPERTY_HINT_ENUM_SUGGESTION; diff --git a/scene/3d/sprite_3d.cpp b/scene/3d/sprite_3d.cpp index 052f251000e..8663e680f8f 100644 --- a/scene/3d/sprite_3d.cpp +++ b/scene/3d/sprite_3d.cpp @@ -964,6 +964,9 @@ Rect2 Sprite3D::get_item_rect() const { } void Sprite3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "frame") { p_property.hint = PROPERTY_HINT_RANGE; p_property.hint_string = "0," + itos(vframes * hframes - 1) + ",1"; @@ -1056,7 +1059,12 @@ void AnimatedSprite3D::_validate_property(PropertyInfo &p_property) const { if (frames.is_null()) { return; } - + if (!Engine::get_singleton()->is_editor_hint()) { + if (p_property.name == "frame" && playing) { + p_property.usage = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY; + } + return; + } if (p_property.name == "animation") { List names; frames->get_animation_list(&names); diff --git a/scene/3d/xr/xr_nodes.cpp b/scene/3d/xr/xr_nodes.cpp index 48a7cc07ac4..3ca927acc84 100644 --- a/scene/3d/xr/xr_nodes.cpp +++ b/scene/3d/xr/xr_nodes.cpp @@ -255,6 +255,9 @@ void XRNode3D::_bind_methods() { } void XRNode3D::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } XRServer *xr_server = XRServer::get_singleton(); ERR_FAIL_NULL(xr_server); diff --git a/scene/animation/animation_blend_tree.cpp b/scene/animation/animation_blend_tree.cpp index c6a73291187..260266b8ad5 100644 --- a/scene/animation/animation_blend_tree.cpp +++ b/scene/animation/animation_blend_tree.cpp @@ -78,7 +78,7 @@ AnimationNode::NodeTimeInfo AnimationNodeAnimation::get_node_time_info() const { } void AnimationNodeAnimation::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "animation" && get_editable_animation_list) { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "animation" && get_editable_animation_list) { Vector names = get_editable_animation_list(); String anims; for (int i = 0; i < names.size(); i++) { diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp index 85789b71e4d..1f1a94ee73a 100644 --- a/scene/animation/animation_mixer.cpp +++ b/scene/animation/animation_mixer.cpp @@ -111,8 +111,8 @@ void AnimationMixer::_get_property_list(List *p_list) const { } void AnimationMixer::_validate_property(PropertyInfo &p_property) const { -#ifdef TOOLS_ENABLED - if (editing && (p_property.name == "active" || p_property.name == "deterministic" || p_property.name == "root_motion_track")) { +#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; } #endif // TOOLS_ENABLED diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp index a82aea6cd00..8f20dd5e47f 100644 --- a/scene/animation/animation_player.cpp +++ b/scene/animation/animation_player.cpp @@ -106,7 +106,7 @@ bool AnimationPlayer::_get(const StringName &p_name, Variant &r_ret) const { } void AnimationPlayer::_validate_property(PropertyInfo &p_property) const { - if (p_property.name == "current_animation") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "current_animation") { List names; for (const KeyValue &E : animation_set) { diff --git a/scene/animation/animation_tree.cpp b/scene/animation/animation_tree.cpp index 993ebcdcaa7..99f146e61c7 100644 --- a/scene/animation/animation_tree.cpp +++ b/scene/animation/animation_tree.cpp @@ -901,9 +901,10 @@ void AnimationTree::_setup_animation_player() { void AnimationTree::_validate_property(PropertyInfo &p_property) const { if (!animation_player.is_empty()) { - if (p_property.name == "root_node" || p_property.name.begins_with("libraries")) { + if (Engine::get_singleton()->is_editor_hint() && (p_property.name == "root_node" || p_property.name.begins_with("libraries"))) { p_property.usage |= PROPERTY_USAGE_READ_ONLY; } + if (p_property.name.begins_with("libraries")) { p_property.usage &= ~PROPERTY_USAGE_STORAGE; } diff --git a/scene/audio/audio_stream_player_internal.cpp b/scene/audio/audio_stream_player_internal.cpp index 621aa31fc61..f738530f094 100644 --- a/scene/audio/audio_stream_player_internal.cpp +++ b/scene/audio/audio_stream_player_internal.cpp @@ -193,6 +193,9 @@ bool AudioStreamPlayerInternal::get_stream_paused() const { } void AudioStreamPlayerInternal::validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "bus") { String options; for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { diff --git a/scene/gui/control.cpp b/scene/gui/control.cpp index bb02638bb0c..18e5f18f5ef 100644 --- a/scene/gui/control.cpp +++ b/scene/gui/control.cpp @@ -458,7 +458,7 @@ void Control::_get_property_list(List *p_list) const { void Control::_validate_property(PropertyInfo &p_property) const { // Update theme type variation options. - if (p_property.name == "theme_type_variation") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "theme_type_variation") { List names; ThemeDB::get_singleton()->get_default_theme()->get_type_variation_list(get_class_name(), &names); @@ -505,20 +505,19 @@ void Control::_validate_property(PropertyInfo &p_property) const { p_property.hint_string = hint_string; } - if (p_property.name == "mouse_force_pass_scroll_events") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "mouse_force_pass_scroll_events") { // Disable force pass if the control is not stopping the event. if (data.mouse_filter != MOUSE_FILTER_STOP) { p_property.usage |= PROPERTY_USAGE_READ_ONLY; } } - if (p_property.name == "scale") { + if (Engine::get_singleton()->is_editor_hint() && p_property.name == "scale") { p_property.hint = PROPERTY_HINT_LINK; } - // Validate which positioning properties should be displayed depending on the parent and the layout mode. Control *parent_control = get_parent_control(); - if (!parent_control) { + if (Engine::get_singleton()->is_editor_hint() && !parent_control) { // If there is no parent control, display both anchor and container options. // Set the layout mode to be disabled with the proper value. @@ -538,11 +537,11 @@ void Control::_validate_property(PropertyInfo &p_property) const { p_property.usage ^= PROPERTY_USAGE_DEFAULT; } else if (p_property.name == "position" || p_property.name == "rotation" || p_property.name == "scale" || p_property.name == "size" || p_property.name == "pivot_offset") { p_property.usage = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY; - } else if (p_property.name == "layout_mode") { + } else if (Engine::get_singleton()->is_editor_hint() && p_property.name == "layout_mode") { // Set the layout mode to be disabled with the proper value. p_property.hint_string = "Position,Anchors,Container,Uncontrolled"; p_property.usage |= PROPERTY_USAGE_READ_ONLY; - } else if (p_property.name == "size_flags_horizontal" || p_property.name == "size_flags_vertical") { + } else if (Engine::get_singleton()->is_editor_hint() && (p_property.name == "size_flags_horizontal" || p_property.name == "size_flags_vertical")) { // Filter allowed size flags based on the parent container configuration. Container *parent_container = Object::cast_to(parent_control); Vector size_flags; @@ -583,7 +582,7 @@ void Control::_validate_property(PropertyInfo &p_property) const { p_property.hint_string = hint_string; } } - } else { + } else if (Engine::get_singleton()->is_editor_hint()) { // If the parent is a non-container control, display only anchoring-related properties. if (p_property.name.begins_with("size_flags_")) { p_property.usage ^= PROPERTY_USAGE_EDITOR; @@ -604,7 +603,9 @@ void Control::_validate_property(PropertyInfo &p_property) const { p_property.usage ^= PROPERTY_USAGE_EDITOR; } } - + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } // Disable the property if it's managed by the parent container. if (!Object::cast_to(parent_control)) { return; diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp index 569329b3a8f..7ef003a779f 100644 --- a/scene/gui/dialogs.cpp +++ b/scene/gui/dialogs.cpp @@ -448,6 +448,9 @@ void AcceptDialog::_bind_methods() { } void AcceptDialog::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "ok_button_text") { p_property.hint = PROPERTY_HINT_PLACEHOLDER_TEXT; p_property.hint_string = default_ok_text; diff --git a/scene/gui/graph_element.cpp b/scene/gui/graph_element.cpp index bc8ab56d973..118637e2e55 100644 --- a/scene/gui/graph_element.cpp +++ b/scene/gui/graph_element.cpp @@ -88,6 +88,9 @@ void GraphElement::_notification(int p_what) { } void GraphElement::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } GraphEdit *graph = Object::cast_to(get_parent()); if (graph) { if (p_property.name == "position") { diff --git a/scene/gui/graph_frame.cpp b/scene/gui/graph_frame.cpp index 42f1065f653..13e0eabba9c 100644 --- a/scene/gui/graph_frame.cpp +++ b/scene/gui/graph_frame.cpp @@ -208,6 +208,9 @@ void GraphFrame::_bind_methods() { } void GraphFrame::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "resizable") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 91a5623527b..86b2ef71916 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -3102,6 +3102,9 @@ void LineEdit::_update_context_menu() { } void LineEdit::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (!caret_blink_enabled && p_property.name == "caret_blink_interval") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp index 94b96e99c4c..96ea3c86023 100644 --- a/scene/gui/popup.cpp +++ b/scene/gui/popup.cpp @@ -148,6 +148,9 @@ void Popup::_post_popup() { } void Popup::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if ( p_property.name == "transient" || p_property.name == "exclusive" || diff --git a/scene/gui/progress_bar.cpp b/scene/gui/progress_bar.cpp index 5b250cde162..f43ddd9cc70 100644 --- a/scene/gui/progress_bar.cpp +++ b/scene/gui/progress_bar.cpp @@ -186,7 +186,7 @@ void ProgressBar::_notification(int p_what) { } void ProgressBar::_validate_property(PropertyInfo &p_property) const { - if (indeterminate && p_property.name == "show_percentage") { + 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") { diff --git a/scene/gui/slider.cpp b/scene/gui/slider.cpp index 10358ea8575..9b7c58ce9f1 100644 --- a/scene/gui/slider.cpp +++ b/scene/gui/slider.cpp @@ -367,6 +367,9 @@ void Slider::_notification(int p_what) { } void Slider::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "ticks_position") { p_property.hint_string = orientation == VERTICAL ? "Right,Left,Both,Center" : "Bottom,Top,Both,Center"; } diff --git a/scene/gui/texture_progress_bar.cpp b/scene/gui/texture_progress_bar.cpp index 258b2ff95ff..2fe9d179faf 100644 --- a/scene/gui/texture_progress_bar.cpp +++ b/scene/gui/texture_progress_bar.cpp @@ -636,6 +636,9 @@ Point2 TextureProgressBar::get_radial_center_offset() { } void TextureProgressBar::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name.begins_with("stretch_margin_") && !nine_patch_stretch) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/gui/video_stream_player.cpp b/scene/gui/video_stream_player.cpp index e4359817e3a..92755577753 100644 --- a/scene/gui/video_stream_player.cpp +++ b/scene/gui/video_stream_player.cpp @@ -504,6 +504,9 @@ StringName VideoStreamPlayer::get_bus() const { } void VideoStreamPlayer::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "bus") { String options; for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) { diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index f35ecdc2033..3db854116b9 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -5294,6 +5294,9 @@ void Viewport::_bind_methods() { } void Viewport::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (vrs_mode != VRS_TEXTURE && (p_property.name == "vrs_texture")) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } @@ -5555,6 +5558,9 @@ void SubViewport::_bind_methods() { } void SubViewport::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "size") { SubViewportContainer *parent_svc = Object::cast_to(get_parent()); if (parent_svc && parent_svc->is_stretch_enabled()) { diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 819606d9565..611b1e6950f 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -244,7 +244,7 @@ void Window::_validate_property(PropertyInfo &p_property) const { if (initial_position != WINDOW_INITIAL_POSITION_CENTER_OTHER_SCREEN) { p_property.usage = PROPERTY_USAGE_NONE; } - } else if (p_property.name == "theme_type_variation") { + } else if (Engine::get_singleton()->is_editor_hint() && p_property.name == "theme_type_variation") { List names; ThemeDB::get_singleton()->get_default_theme()->get_type_variation_list(get_class_name(), &names); diff --git a/scene/resources/2d/tile_set.cpp b/scene/resources/2d/tile_set.cpp index 900aa80369b..71d74780a68 100644 --- a/scene/resources/2d/tile_set.cpp +++ b/scene/resources/2d/tile_set.cpp @@ -4233,6 +4233,9 @@ void TileSet::_get_property_list(List *p_list) const { } 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) { diff --git a/scene/resources/3d/sky_material.cpp b/scene/resources/3d/sky_material.cpp index 4d5b0ade29f..981256e9fa0 100644 --- a/scene/resources/3d/sky_material.cpp +++ b/scene/resources/3d/sky_material.cpp @@ -211,6 +211,9 @@ RID ProceduralSkyMaterial::get_shader_rid() const { } void ProceduralSkyMaterial::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if ((p_property.name == "sky_luminance" || p_property.name == "ground_luminance") && !GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units")) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } @@ -652,6 +655,9 @@ RID PhysicalSkyMaterial::get_shader_rid() const { } void PhysicalSkyMaterial::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "exposure_value" && !GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units")) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/resources/bone_map.cpp b/scene/resources/bone_map.cpp index 83f7c420655..84b6494c15a 100644 --- a/scene/resources/bone_map.cpp +++ b/scene/resources/bone_map.cpp @@ -171,6 +171,9 @@ void BoneMap::_bind_methods() { } void BoneMap::_validate_property(PropertyInfo &property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (property.name == "bonemap" || property.name == "profile") { property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/resources/camera_attributes.cpp b/scene/resources/camera_attributes.cpp index 21cb9df4571..62c061a7482 100644 --- a/scene/resources/camera_attributes.cpp +++ b/scene/resources/camera_attributes.cpp @@ -96,6 +96,9 @@ RID CameraAttributes::get_rid() const { } void CameraAttributes::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (!GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units") && p_property.name == "exposure_sensitivity") { p_property.usage = PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL; return; @@ -253,6 +256,9 @@ void CameraAttributesPractical::_update_auto_exposure() { } void CameraAttributesPractical::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if ((!dof_blur_far_enabled && (p_property.name == "dof_blur_far_distance" || p_property.name == "dof_blur_far_transition")) || (!dof_blur_near_enabled && (p_property.name == "dof_blur_near_distance" || p_property.name == "dof_blur_near_transition"))) { p_property.usage = PROPERTY_USAGE_NO_EDITOR | PROPERTY_USAGE_INTERNAL; @@ -447,6 +453,9 @@ void CameraAttributesPhysical::_update_auto_exposure() { } void CameraAttributesPhysical::_validate_property(PropertyInfo &property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } 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; diff --git a/scene/resources/compressed_texture.cpp b/scene/resources/compressed_texture.cpp index da738b71e08..a641a2924c7 100644 --- a/scene/resources/compressed_texture.cpp +++ b/scene/resources/compressed_texture.cpp @@ -293,9 +293,6 @@ void CompressedTexture2D::reload_from_file() { load(path); } -void CompressedTexture2D::_validate_property(PropertyInfo &p_property) const { -} - Ref CompressedTexture2D::load_image_from_file(Ref f, int p_size_limit) { uint32_t data_format = f->get_32(); uint32_t w = f->get_16(); @@ -634,9 +631,6 @@ void CompressedTexture3D::reload_from_file() { load(path); } -void CompressedTexture3D::_validate_property(PropertyInfo &p_property) const { -} - void CompressedTexture3D::_bind_methods() { ClassDB::bind_method(D_METHOD("load", "path"), &CompressedTexture3D::load); ClassDB::bind_method(D_METHOD("get_load_path"), &CompressedTexture3D::get_load_path); @@ -826,9 +820,6 @@ void CompressedTextureLayered::reload_from_file() { load(path); } -void CompressedTextureLayered::_validate_property(PropertyInfo &p_property) const { -} - void CompressedTextureLayered::_bind_methods() { ClassDB::bind_method(D_METHOD("load", "path"), &CompressedTextureLayered::load); ClassDB::bind_method(D_METHOD("get_load_path"), &CompressedTextureLayered::get_load_path); diff --git a/scene/resources/compressed_texture.h b/scene/resources/compressed_texture.h index 506e316f11c..8bd6fe410a6 100644 --- a/scene/resources/compressed_texture.h +++ b/scene/resources/compressed_texture.h @@ -76,7 +76,6 @@ private: protected: static void _bind_methods(); - void _validate_property(PropertyInfo &p_property) const; public: static Ref load_image_from_file(Ref p_file, int p_size_limit); @@ -153,7 +152,6 @@ private: protected: static void _bind_methods(); - void _validate_property(PropertyInfo &p_property) const; public: Image::Format get_format() const override; @@ -240,7 +238,6 @@ private: protected: static void _bind_methods(); - void _validate_property(PropertyInfo &p_property) const; public: Image::Format get_format() const override; diff --git a/scene/resources/environment.cpp b/scene/resources/environment.cpp index 759c239159e..c20fe055676 100644 --- a/scene/resources/environment.cpp +++ b/scene/resources/environment.cpp @@ -1082,6 +1082,9 @@ void Environment::_update_adjustment() { // Private methods, constructor and destructor void Environment::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "sky" || p_property.name == "sky_custom_fov" || p_property.name == "sky_rotation" || p_property.name == "ambient_light_sky_contribution") { if (bg_mode != BG_SKY && ambient_source != AMBIENT_SOURCE_SKY && reflection_source != REFLECTION_SOURCE_SKY) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; diff --git a/scene/resources/font.cpp b/scene/resources/font.cpp index 5e8cc4dc9f3..f554ef47266 100644 --- a/scene/resources/font.cpp +++ b/scene/resources/font.cpp @@ -1069,6 +1069,9 @@ void FontFile::_bind_methods() { } void FontFile::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "fallbacks") { p_property.usage &= ~PROPERTY_USAGE_EDITOR; } diff --git a/scene/resources/gradient.cpp b/scene/resources/gradient.cpp index bb123bd6c96..55c787ef73e 100644 --- a/scene/resources/gradient.cpp +++ b/scene/resources/gradient.cpp @@ -30,6 +30,8 @@ #include "gradient.h" +#include "core/config/engine.h" + Gradient::Gradient() { //Set initial gradient transition from black to white points.resize(2); @@ -88,6 +90,9 @@ void Gradient::_bind_methods() { } void Gradient::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "interpolation_color_space" && interpolation_mode == GRADIENT_INTERPOLATE_CONSTANT) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp index 09fe1859e0a..12796edfd00 100644 --- a/scene/resources/material.cpp +++ b/scene/resources/material.cpp @@ -2564,48 +2564,50 @@ void BaseMaterial3D::_validate_property(PropertyInfo &p_property) const { p_property.usage = PROPERTY_USAGE_NONE; } - if (p_property.name == "billboard_keep_scale" && billboard_mode == BILLBOARD_DISABLED) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (Engine::get_singleton()->is_editor_hint()) { + if (p_property.name == "billboard_keep_scale" && billboard_mode == BILLBOARD_DISABLED) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "grow_amount" && !grow_enabled) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "grow_amount" && !grow_enabled) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "point_size" && !flags[FLAG_USE_POINT_SIZE]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "point_size" && !flags[FLAG_USE_POINT_SIZE]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "proximity_fade_distance" && !proximity_fade_enabled) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "proximity_fade_distance" && !proximity_fade_enabled) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "msdf_pixel_range" && !flags[FLAG_ALBEDO_TEXTURE_MSDF]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "msdf_pixel_range" && !flags[FLAG_ALBEDO_TEXTURE_MSDF]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "msdf_outline_size" && !flags[FLAG_ALBEDO_TEXTURE_MSDF]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "msdf_outline_size" && !flags[FLAG_ALBEDO_TEXTURE_MSDF]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if ((p_property.name == "distance_fade_max_distance" || p_property.name == "distance_fade_min_distance") && distance_fade == DISTANCE_FADE_DISABLED) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if ((p_property.name == "distance_fade_max_distance" || p_property.name == "distance_fade_min_distance") && distance_fade == DISTANCE_FADE_DISABLED) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if ((p_property.name == "uv1_triplanar_sharpness" || p_property.name == "uv1_world_triplanar") && !flags[FLAG_UV1_USE_TRIPLANAR]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if ((p_property.name == "uv1_triplanar_sharpness" || p_property.name == "uv1_world_triplanar") && !flags[FLAG_UV1_USE_TRIPLANAR]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if ((p_property.name == "uv2_triplanar_sharpness" || p_property.name == "uv2_world_triplanar") && !flags[FLAG_UV2_USE_TRIPLANAR]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if ((p_property.name == "uv2_triplanar_sharpness" || p_property.name == "uv2_world_triplanar") && !flags[FLAG_UV2_USE_TRIPLANAR]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "z_clip_scale" && !flags[FLAG_USE_Z_CLIP_SCALE]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "z_clip_scale" && !flags[FLAG_USE_Z_CLIP_SCALE]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "fov_override" && !flags[FLAG_USE_FOV_OVERRIDE]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; + if (p_property.name == "fov_override" && !flags[FLAG_USE_FOV_OVERRIDE]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } } // you can only enable anti-aliasing (in materials) on alpha scissor and alpha hash @@ -2640,24 +2642,26 @@ void BaseMaterial3D::_validate_property(PropertyInfo &p_property) const { p_property.usage = PROPERTY_USAGE_NONE; } - if (p_property.name == "depth_test" && flags[FLAG_DISABLE_DEPTH_TEST]) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (Engine::get_singleton()->is_editor_hint()) { + if (p_property.name == "depth_test" && flags[FLAG_DISABLE_DEPTH_TEST]) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "stencil_reference" && stencil_mode == STENCIL_MODE_DISABLED) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "stencil_reference" && stencil_mode == STENCIL_MODE_DISABLED) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if ((p_property.name == "stencil_flags" || p_property.name == "stencil_compare") && stencil_mode != STENCIL_MODE_CUSTOM) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if ((p_property.name == "stencil_flags" || p_property.name == "stencil_compare") && stencil_mode != STENCIL_MODE_CUSTOM) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "stencil_color" && stencil_mode != STENCIL_MODE_OUTLINE && stencil_mode != STENCIL_MODE_XRAY) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; - } + if (p_property.name == "stencil_color" && stencil_mode != STENCIL_MODE_OUTLINE && stencil_mode != STENCIL_MODE_XRAY) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } - if (p_property.name == "stencil_outline_thickness" && stencil_mode != STENCIL_MODE_OUTLINE) { - p_property.usage = PROPERTY_USAGE_NO_EDITOR; + if (p_property.name == "stencil_outline_thickness" && stencil_mode != STENCIL_MODE_OUTLINE) { + p_property.usage = PROPERTY_USAGE_NO_EDITOR; + } } if (flags[FLAG_SUBSURFACE_MODE_SKIN] && (p_property.name == "subsurf_scatter_transmittance_color" || p_property.name == "subsurf_scatter_transmittance_texture")) { diff --git a/scene/resources/particle_process_material.cpp b/scene/resources/particle_process_material.cpp index 733b34ae056..0f1131c2e8f 100644 --- a/scene/resources/particle_process_material.cpp +++ b/scene/resources/particle_process_material.cpp @@ -1924,15 +1924,18 @@ void ParticleProcessMaterial::_validate_property(PropertyInfo &p_property) const 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 ((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 == "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; - } - 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; + 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 == "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; + } + + 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; + } } } diff --git a/scene/resources/skeleton_profile.cpp b/scene/resources/skeleton_profile.cpp index 2bb17ff2b53..a2555900cdb 100644 --- a/scene/resources/skeleton_profile.cpp +++ b/scene/resources/skeleton_profile.cpp @@ -133,6 +133,9 @@ bool SkeletonProfile::_get(const StringName &p_path, Variant &r_ret) const { } void SkeletonProfile::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (is_read_only) { if (p_property.name == ("group_size") || p_property.name == ("bone_size") || p_property.name == ("root_bone") || p_property.name == ("scale_base_bone")) { p_property.usage = PROPERTY_USAGE_NO_EDITOR; diff --git a/scene/resources/style_box_flat.cpp b/scene/resources/style_box_flat.cpp index 2a37c20e5d2..3562f6641f7 100644 --- a/scene/resources/style_box_flat.cpp +++ b/scene/resources/style_box_flat.cpp @@ -40,6 +40,9 @@ float StyleBoxFlat::get_style_margin(Side p_side) const { } void StyleBoxFlat::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (!anti_aliased && p_property.name == "anti_aliasing_size") { p_property.usage = PROPERTY_USAGE_NO_EDITOR; } diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp index 4f23de672b0..0dc0728c559 100644 --- a/scene/resources/visual_shader.cpp +++ b/scene/resources/visual_shader.cpp @@ -3790,6 +3790,9 @@ String VisualShaderNodeInput::get_input_index_name(int p_index) const { } void VisualShaderNodeInput::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "input_name") { String port_list; diff --git a/servers/audio/effects/audio_effect_compressor.cpp b/servers/audio/effects/audio_effect_compressor.cpp index 80035e6fff2..7f7330e14ee 100644 --- a/servers/audio/effects/audio_effect_compressor.cpp +++ b/servers/audio/effects/audio_effect_compressor.cpp @@ -185,6 +185,9 @@ StringName AudioEffectCompressor::get_sidechain() const { } void AudioEffectCompressor::_validate_property(PropertyInfo &p_property) const { + if (!Engine::get_singleton()->is_editor_hint()) { + return; + } if (p_property.name == "sidechain") { String buses = ""; for (int i = 0; i < AudioServer::get_singleton()->get_bus_count(); i++) {