@@ -1181,15 +1181,16 @@ void Node3D::_validate_property(PropertyInfo &p_property) const {
11811181}
11821182
11831183bool Node3D::_property_can_revert (const StringName &p_name) const {
1184- if (p_name == " basis" ) {
1184+ const String sname = p_name;
1185+ if (sname == " basis" ) {
11851186 return true ;
1186- } else if (p_name == " scale" ) {
1187+ } else if (sname == " scale" ) {
11871188 return true ;
1188- } else if (p_name == " quaternion" ) {
1189+ } else if (sname == " quaternion" ) {
11891190 return true ;
1190- } else if (p_name == " rotation" ) {
1191+ } else if (sname == " rotation" ) {
11911192 return true ;
1192- } else if (p_name == " position" ) {
1193+ } else if (sname == " position" ) {
11931194 return true ;
11941195 }
11951196 return false ;
@@ -1198,35 +1199,36 @@ bool Node3D::_property_can_revert(const StringName &p_name) const {
11981199bool Node3D::_property_get_revert (const StringName &p_name, Variant &r_property) const {
11991200 bool valid = false ;
12001201
1201- if (p_name == " basis" ) {
1202+ const String sname = p_name;
1203+ if (sname == " basis" ) {
12021204 Variant variant = PropertyUtils::get_property_default_value (this , " transform" , &valid);
12031205 if (valid && variant.get_type () == Variant::Type::TRANSFORM3D) {
12041206 r_property = Transform3D (variant).get_basis ();
12051207 } else {
12061208 r_property = Basis ();
12071209 }
1208- } else if (p_name == " scale" ) {
1210+ } else if (sname == " scale" ) {
12091211 Variant variant = PropertyUtils::get_property_default_value (this , " transform" , &valid);
12101212 if (valid && variant.get_type () == Variant::Type::TRANSFORM3D) {
12111213 r_property = Transform3D (variant).get_basis ().get_scale ();
12121214 } else {
12131215 r_property = Vector3 (1.0 , 1.0 , 1.0 );
12141216 }
1215- } else if (p_name == " quaternion" ) {
1217+ } else if (sname == " quaternion" ) {
12161218 Variant variant = PropertyUtils::get_property_default_value (this , " transform" , &valid);
12171219 if (valid && variant.get_type () == Variant::Type::TRANSFORM3D) {
12181220 r_property = Quaternion (Transform3D (variant).get_basis ().get_rotation_quaternion ());
12191221 } else {
12201222 r_property = Quaternion ();
12211223 }
1222- } else if (p_name == " rotation" ) {
1224+ } else if (sname == " rotation" ) {
12231225 Variant variant = PropertyUtils::get_property_default_value (this , " transform" , &valid);
12241226 if (valid && variant.get_type () == Variant::Type::TRANSFORM3D) {
12251227 r_property = Transform3D (variant).get_basis ().get_euler_normalized (data.euler_rotation_order );
12261228 } else {
12271229 r_property = Vector3 ();
12281230 }
1229- } else if (p_name == " position" ) {
1231+ } else if (sname == " position" ) {
12301232 Variant variant = PropertyUtils::get_property_default_value (this , " transform" , &valid);
12311233 if (valid) {
12321234 r_property = Transform3D (variant).get_origin ();
0 commit comments