Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/csg/csg_shape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions modules/interactive_music/audio_stream_interactive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 5 additions & 0 deletions modules/noise/fastnoise_lite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions modules/noise/noise_texture_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions modules/noise/noise_texture_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions modules/openxr/scene/openxr_composition_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
7 changes: 6 additions & 1 deletion scene/2d/animated_sprite_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<StringName> names;
frames->get_animation_list(&names);
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/back_buffer_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion scene/2d/cpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion scene/2d/gpu_particles_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/light_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/path_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/physics/area_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/physics/character_body_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/physics/rigid_body_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/sprite_2d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
3 changes: 3 additions & 0 deletions scene/2d/tile_map_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion scene/3d/bone_attachment_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
24 changes: 13 additions & 11 deletions scene/3d/camera_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion scene/3d/cpu_particles_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion scene/3d/decal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion scene/3d/gpu_particles_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
3 changes: 3 additions & 0 deletions scene/3d/label_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" ||
Expand Down
16 changes: 9 additions & 7 deletions scene/3d/light_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down
3 changes: 3 additions & 0 deletions scene/3d/lightmap_gi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion scene/3d/look_at_modifier_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions scene/3d/path_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
3 changes: 3 additions & 0 deletions scene/3d/physics/area_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
3 changes: 3 additions & 0 deletions scene/3d/physics/character_body_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions scene/3d/physics/rigid_body_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 3 additions & 0 deletions scene/3d/reflection_probe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions scene/3d/skeleton_ik_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 0 additions & 4 deletions scene/3d/skeleton_modifier_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Loading