|
@@ -899,15 +899,23 @@ void AnimationTree::_setup_animation_player() {
|
|
|
clear_caches();
|
|
|
}
|
|
|
|
|
|
+// `libraries` is a dynamic property, so we can't use `_validate_property` to change it.
|
|
|
+uint32_t AnimationTree::_get_libraries_property_usage() const {
|
|
|
+ if (!animation_player.is_empty()) {
|
|
|
+ return PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_READ_ONLY;
|
|
|
+ }
|
|
|
+ return PROPERTY_USAGE_DEFAULT;
|
|
|
+}
|
|
|
+
|
|
|
void AnimationTree::_validate_property(PropertyInfo &p_property) const {
|
|
|
+ if (!Engine::get_singleton()->is_editor_hint()) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
if (!animation_player.is_empty()) {
|
|
|
- if (Engine::get_singleton()->is_editor_hint() && (p_property.name == "root_node" || p_property.name.begins_with("libraries"))) {
|
|
|
+ if (p_property.name == "root_node") {
|
|
|
p_property.usage |= PROPERTY_USAGE_READ_ONLY;
|
|
|
}
|
|
|
-
|
|
|
- if (p_property.name.begins_with("libraries")) {
|
|
|
- p_property.usage &= ~PROPERTY_USAGE_STORAGE;
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|