summaryrefslogtreecommitdiffstats
path: root/scene/resources/animation.cpp
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2024-08-10 18:53:45 +0200
committerRaul Santos <raulsntos@gmail.com>2024-08-10 18:53:45 +0200
commit415331f474689e0613869451764c30ea69595c02 (patch)
tree0c34051b5cecefee1ac0cef93767d87090a1aef6 /scene/resources/animation.cpp
parent4bef4d9808848c38c3f285edb300b4f3a843e543 (diff)
downloadredot-engine-415331f474689e0613869451764c30ea69595c02.tar.gz
Make `Animation::capture_included` read-only
The `PROPERTY_USAGE_READ_ONLY` flag only makes the property read-only in the inspector, but the property also has the `PROPERTY_USAGE_NO_EDITOR` flag which means it won't show up in the inspector. So it does nothing, while still making it editable from scripting. To make it read-only for scripting too, this PR removes the setter from the `PropertyInfo`. And since the `set_capture_included` method is now unused, it was also removed.
Diffstat (limited to 'scene/resources/animation.cpp')
-rw-r--r--scene/resources/animation.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/scene/resources/animation.cpp b/scene/resources/animation.cpp
index c0ab636adc..e00bf56939 100644
--- a/scene/resources/animation.cpp
+++ b/scene/resources/animation.cpp
@@ -969,10 +969,6 @@ void Animation::remove_track(int p_track) {
_check_capture_included();
}
-void Animation::set_capture_included(bool p_capture_included) {
- capture_included = p_capture_included;
-}
-
bool Animation::is_capture_included() const {
return capture_included;
}
@@ -3908,13 +3904,12 @@ void Animation::_bind_methods() {
ClassDB::bind_method(D_METHOD("compress", "page_size", "fps", "split_tolerance"), &Animation::compress, DEFVAL(8192), DEFVAL(120), DEFVAL(4.0));
- ClassDB::bind_method(D_METHOD("_set_capture_included", "capture_included"), &Animation::set_capture_included);
ClassDB::bind_method(D_METHOD("is_capture_included"), &Animation::is_capture_included);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "length", PROPERTY_HINT_RANGE, "0.001,99999,0.001,suffix:s"), "set_length", "get_length");
ADD_PROPERTY(PropertyInfo(Variant::INT, "loop_mode", PROPERTY_HINT_ENUM, "None,Linear,Ping-Pong"), "set_loop_mode", "get_loop_mode");
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "step", PROPERTY_HINT_RANGE, "0,4096,0.001,suffix:s"), "set_step", "get_step");
- ADD_PROPERTY(PropertyInfo(Variant::BOOL, "capture_included", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_READ_ONLY | PROPERTY_USAGE_NO_EDITOR), "_set_capture_included", "is_capture_included");
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "capture_included", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NO_EDITOR), "", "is_capture_included");
BIND_ENUM_CONSTANT(TYPE_VALUE);
BIND_ENUM_CONSTANT(TYPE_POSITION_3D);