You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Fix cases where _get returned true erroneously
This commit is contained in:
@@ -662,9 +662,10 @@ void OpenXRCompositionLayer::_get_property_list(List<PropertyInfo> *p_property_l
|
|||||||
bool OpenXRCompositionLayer::_get(const StringName &p_property, Variant &r_value) const {
|
bool OpenXRCompositionLayer::_get(const StringName &p_property, Variant &r_value) const {
|
||||||
if (extension_property_values.has(p_property)) {
|
if (extension_property_values.has(p_property)) {
|
||||||
r_value = extension_property_values[p_property];
|
r_value = extension_property_values[p_property];
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OpenXRCompositionLayer::_set(const StringName &p_property, const Variant &p_value) {
|
bool OpenXRCompositionLayer::_set(const StringName &p_property, const Variant &p_value) {
|
||||||
|
|||||||
@@ -56,21 +56,25 @@ void BoneAttachment3D::_validate_property(PropertyInfo &p_property) const {
|
|||||||
bool BoneAttachment3D::_set(const StringName &p_path, const Variant &p_value) {
|
bool BoneAttachment3D::_set(const StringName &p_path, const Variant &p_value) {
|
||||||
if (p_path == SNAME("use_external_skeleton")) {
|
if (p_path == SNAME("use_external_skeleton")) {
|
||||||
set_use_external_skeleton(p_value);
|
set_use_external_skeleton(p_value);
|
||||||
|
return true;
|
||||||
} else if (p_path == SNAME("external_skeleton")) {
|
} else if (p_path == SNAME("external_skeleton")) {
|
||||||
set_external_skeleton(p_value);
|
set_external_skeleton(p_value);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BoneAttachment3D::_get(const StringName &p_path, Variant &r_ret) const {
|
bool BoneAttachment3D::_get(const StringName &p_path, Variant &r_ret) const {
|
||||||
if (p_path == SNAME("use_external_skeleton")) {
|
if (p_path == SNAME("use_external_skeleton")) {
|
||||||
r_ret = get_use_external_skeleton();
|
r_ret = get_use_external_skeleton();
|
||||||
|
return true;
|
||||||
} else if (p_path == SNAME("external_skeleton")) {
|
} else if (p_path == SNAME("external_skeleton")) {
|
||||||
r_ret = get_external_skeleton();
|
r_ret = get_external_skeleton();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void BoneAttachment3D::_get_property_list(List<PropertyInfo> *p_list) const {
|
void BoneAttachment3D::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ bool SkeletonModification2DPhysicalBones::_get(const StringName &p_path, Variant
|
|||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
if (Engine::get_singleton()->is_editor_hint()) {
|
if (Engine::get_singleton()->is_editor_hint()) {
|
||||||
if (path.begins_with("fetch_bones")) {
|
if (path.begins_with("fetch_bones")) {
|
||||||
return true; // Do nothing!
|
// Do nothing!
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //TOOLS_ENABLED
|
#endif //TOOLS_ENABLED
|
||||||
|
|||||||
@@ -41,10 +41,10 @@ bool SkeletonProfile::_set(const StringName &p_path, const Variant &p_value) {
|
|||||||
|
|
||||||
if (what == "group_name") {
|
if (what == "group_name") {
|
||||||
set_group_name(which, p_value);
|
set_group_name(which, p_value);
|
||||||
|
return true;
|
||||||
} else if (what == "texture") {
|
} else if (what == "texture") {
|
||||||
set_texture(which, p_value);
|
set_texture(which, p_value);
|
||||||
} else {
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,26 +55,32 @@ bool SkeletonProfile::_set(const StringName &p_path, const Variant &p_value) {
|
|||||||
|
|
||||||
if (what == "bone_name") {
|
if (what == "bone_name") {
|
||||||
set_bone_name(which, p_value);
|
set_bone_name(which, p_value);
|
||||||
|
return true;
|
||||||
} else if (what == "bone_parent") {
|
} else if (what == "bone_parent") {
|
||||||
set_bone_parent(which, p_value);
|
set_bone_parent(which, p_value);
|
||||||
|
return true;
|
||||||
} else if (what == "tail_direction") {
|
} else if (what == "tail_direction") {
|
||||||
set_tail_direction(which, static_cast<TailDirection>((int)p_value));
|
set_tail_direction(which, static_cast<TailDirection>((int)p_value));
|
||||||
|
return true;
|
||||||
} else if (what == "bone_tail") {
|
} else if (what == "bone_tail") {
|
||||||
set_bone_tail(which, p_value);
|
set_bone_tail(which, p_value);
|
||||||
|
return true;
|
||||||
} else if (what == "reference_pose") {
|
} else if (what == "reference_pose") {
|
||||||
set_reference_pose(which, p_value);
|
set_reference_pose(which, p_value);
|
||||||
|
return true;
|
||||||
} else if (what == "handle_offset") {
|
} else if (what == "handle_offset") {
|
||||||
set_handle_offset(which, p_value);
|
set_handle_offset(which, p_value);
|
||||||
|
return true;
|
||||||
} else if (what == "group") {
|
} else if (what == "group") {
|
||||||
set_group(which, p_value);
|
set_group(which, p_value);
|
||||||
|
return true;
|
||||||
} else if (what == "require") {
|
} else if (what == "require") {
|
||||||
set_required(which, p_value);
|
set_required(which, p_value);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool SkeletonProfile::_get(const StringName &p_path, Variant &r_ret) const {
|
bool SkeletonProfile::_get(const StringName &p_path, Variant &r_ret) const {
|
||||||
String path = p_path;
|
String path = p_path;
|
||||||
@@ -86,40 +92,45 @@ bool SkeletonProfile::_get(const StringName &p_path, Variant &r_ret) const {
|
|||||||
|
|
||||||
if (what == "group_name") {
|
if (what == "group_name") {
|
||||||
r_ret = get_group_name(which);
|
r_ret = get_group_name(which);
|
||||||
|
return true;
|
||||||
} else if (what == "texture") {
|
} else if (what == "texture") {
|
||||||
r_ret = get_texture(which);
|
r_ret = get_texture(which);
|
||||||
} else {
|
return true;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
} else if (path.begins_with("bones/")) {
|
||||||
|
|
||||||
if (path.begins_with("bones/")) {
|
|
||||||
int which = path.get_slicec('/', 1).to_int();
|
int which = path.get_slicec('/', 1).to_int();
|
||||||
String what = path.get_slicec('/', 2);
|
String what = path.get_slicec('/', 2);
|
||||||
ERR_FAIL_INDEX_V(which, bones.size(), false);
|
ERR_FAIL_INDEX_V(which, bones.size(), false);
|
||||||
|
|
||||||
if (what == "bone_name") {
|
if (what == "bone_name") {
|
||||||
r_ret = get_bone_name(which);
|
r_ret = get_bone_name(which);
|
||||||
|
return true;
|
||||||
} else if (what == "bone_parent") {
|
} else if (what == "bone_parent") {
|
||||||
r_ret = get_bone_parent(which);
|
r_ret = get_bone_parent(which);
|
||||||
|
return true;
|
||||||
} else if (what == "tail_direction") {
|
} else if (what == "tail_direction") {
|
||||||
r_ret = get_tail_direction(which);
|
r_ret = get_tail_direction(which);
|
||||||
|
return true;
|
||||||
} else if (what == "bone_tail") {
|
} else if (what == "bone_tail") {
|
||||||
r_ret = get_bone_tail(which);
|
r_ret = get_bone_tail(which);
|
||||||
|
return true;
|
||||||
} else if (what == "reference_pose") {
|
} else if (what == "reference_pose") {
|
||||||
r_ret = get_reference_pose(which);
|
r_ret = get_reference_pose(which);
|
||||||
|
return true;
|
||||||
} else if (what == "handle_offset") {
|
} else if (what == "handle_offset") {
|
||||||
r_ret = get_handle_offset(which);
|
r_ret = get_handle_offset(which);
|
||||||
|
return true;
|
||||||
} else if (what == "group") {
|
} else if (what == "group") {
|
||||||
r_ret = get_group(which);
|
r_ret = get_group(which);
|
||||||
|
return true;
|
||||||
} else if (what == "require") {
|
} else if (what == "require") {
|
||||||
r_ret = is_required(which);
|
r_ret = is_required(which);
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void SkeletonProfile::_validate_property(PropertyInfo &p_property) const {
|
void SkeletonProfile::_validate_property(PropertyInfo &p_property) const {
|
||||||
if (is_read_only) {
|
if (is_read_only) {
|
||||||
|
|||||||
Reference in New Issue
Block a user