Merge pull request #53786 from TokageItLab/fix-skeleton-editor-methods
This commit is contained in:
commit
f90047f158
4 changed files with 177 additions and 327 deletions
|
|
@ -171,6 +171,45 @@ void Skeleton3D::_get_property_list(List<PropertyInfo> *p_list) const {
|
|||
"SkeletonModificationStack3D",
|
||||
PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_DEFERRED_SET_RESOURCE | PROPERTY_USAGE_DO_NOT_SHARE_ON_DUPLICATE));
|
||||
#endif //_3D_DISABLED
|
||||
|
||||
for (PropertyInfo &E : *p_list) {
|
||||
_validate_property(E);
|
||||
}
|
||||
}
|
||||
|
||||
void Skeleton3D::_validate_property(PropertyInfo &property) const {
|
||||
PackedStringArray spr = property.name.split("/");
|
||||
if (spr.size() == 3 && spr[0] == "bones") {
|
||||
if (spr[2] == "rest") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
if (is_show_rest_only()) {
|
||||
if (spr[2] == "enabled") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
if (spr[2] == "position") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
if (spr[2] == "rotation") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
if (spr[2] == "scale") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
} else if (!is_bone_enabled(spr[1].to_int())) {
|
||||
if (spr[2] == "position") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
if (spr[2] == "rotation") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
if (spr[2] == "scale") {
|
||||
property.usage |= PROPERTY_USAGE_READ_ONLY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Node3D::_validate_property(property);
|
||||
}
|
||||
|
||||
void Skeleton3D::_update_process_order() {
|
||||
|
|
|
|||
|
|
@ -153,6 +153,7 @@ protected:
|
|||
bool _get(const StringName &p_path, Variant &r_ret) const;
|
||||
bool _set(const StringName &p_path, const Variant &p_value);
|
||||
void _get_property_list(List<PropertyInfo> *p_list) const;
|
||||
virtual void _validate_property(PropertyInfo &property) const override;
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue