You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
committed by
AThousandShips
parent
0f95e9f8e6
commit
a1846b27ea
@@ -240,7 +240,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
|
||||
} break;
|
||||
case MENU_OPTION_CREATE_UV2: {
|
||||
Ref<Mesh> mesh2 = node->get_mesh();
|
||||
if (!mesh.is_valid()) {
|
||||
if (mesh.is_null()) {
|
||||
err_dialog->set_text(TTR("No mesh to unwrap."));
|
||||
err_dialog->popup_centered();
|
||||
return;
|
||||
@@ -281,7 +281,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
|
||||
ur->commit_action();
|
||||
} else {
|
||||
Ref<ArrayMesh> array_mesh = mesh2;
|
||||
if (!array_mesh.is_valid()) {
|
||||
if (array_mesh.is_null()) {
|
||||
err_dialog->set_text(TTR("Contained Mesh is not of type ArrayMesh."));
|
||||
err_dialog->popup_centered();
|
||||
return;
|
||||
@@ -337,7 +337,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
|
||||
} break;
|
||||
case MENU_OPTION_DEBUG_UV1: {
|
||||
Ref<Mesh> mesh2 = node->get_mesh();
|
||||
if (!mesh2.is_valid()) {
|
||||
if (mesh2.is_null()) {
|
||||
err_dialog->set_text(TTR("No mesh to debug."));
|
||||
err_dialog->popup_centered();
|
||||
return;
|
||||
@@ -346,7 +346,7 @@ void MeshInstance3DEditor::_menu_option(int p_option) {
|
||||
} break;
|
||||
case MENU_OPTION_DEBUG_UV2: {
|
||||
Ref<Mesh> mesh2 = node->get_mesh();
|
||||
if (!mesh2.is_valid()) {
|
||||
if (mesh2.is_null()) {
|
||||
err_dialog->set_text(TTR("No mesh to debug."));
|
||||
err_dialog->popup_centered();
|
||||
return;
|
||||
@@ -383,7 +383,7 @@ struct MeshInstance3DEditorEdgeSort {
|
||||
|
||||
void MeshInstance3DEditor::_create_uv_lines(int p_layer) {
|
||||
Ref<Mesh> mesh = node->get_mesh();
|
||||
ERR_FAIL_COND(!mesh.is_valid());
|
||||
ERR_FAIL_COND(mesh.is_null());
|
||||
|
||||
HashSet<MeshInstance3DEditorEdgeSort, MeshInstance3DEditorEdgeSort> edges;
|
||||
uv_lines.clear();
|
||||
|
||||
Reference in New Issue
Block a user