Repository: godotengine/godot
File: editor/plugins/mesh_instance_3d_editor_plugin.cpp (C++)

Code before:

				Ref<ConcavePolygonShape3D> shape = m->create_trimesh_shape();
				if (shape.is_null()) {
					continue;
				}

				CollisionShape3D *cshape = memnew(CollisionShape3D);
				cshape->set_shape(shape);
				StaticBody3D *body = memnew(StaticBody3D);
				body->add_child(cshape, true);

				Node *owner = get_tree()->get_edited_scene_root();

				ur->add_do_method(instance, "add_child", body, true);
				ur->add_do_method(body, "set_owner", owner);
				ur->add_do_method(cshape, "set_owner", owner);
				ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, body);
				ur->add_do_method(Node3DEditor::get_singleton(), SceneStringNames::get_singleton()->_request_gizmo, cshape);
				ur->add_do_reference(body);
				ur->add_undo_method(instance, "remove_child", body);
			}

			ur->commit_action();

		} break;

		case MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE: {
			if (node == get_tree()->get_edited_scene_root()) {
				err_dialog->set_text(TTR("This doesn't work on scene root!"));
				err_dialog->popup_centered();
				return;
			}

			Ref<ConcavePolygonShape3D> shape = mesh->create_trimesh_shape();
			if (shape.is_null()) {
				return;
			}

			CollisionShape3D *cshape = memnew(CollisionShape3D);
			cshape->set_shape(shape);
			cshape->set_transform(node->get_transform());

			Node *owner = get_tree()->get_edited_scene_root();

			EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();

			ur->create_action(TTR("Create Trimesh Static Shape"));

			ur->add_do_method(node->get_parent(), "add_child", cshape, true);
			ur->add_do_method(node->get_parent(), "move_child", cshape, node->get_index() + 1);
			ur->add_do_method(cshape, "set_owner", owner);

Review comment (suggestion):
```suggestion
					ur->create_action(TTR("Create Multiple Convex Static Body"));
```

Code after:
	EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
	EditorUndoRedoManager *ur = EditorUndoRedoManager::get_singleton();

	switch (shape_type_option) {
		case SHAPE_TYPE_TRIMESH: {
			ur->create_action(TTR(placement_option == SHAPE_PLACEMENT_SIBLING ? "Create Trimesh Collision Shape Sibling" : "Create Trimesh Static Body"));
		} break;
		case SHAPE_TYPE_SINGLE_CONVEX: {
			ur->create_action(TTR(placement_option == SHAPE_PLACEMENT_SIBLING ? "Create Single Convex Collision Shape Sibling" : "Create Single Convex Static Body"));
		} break;
		case SHAPE_TYPE_SIMPLIFIED_CONVEX: {
			ur->create_action(TTR(placement_option == SHAPE_PLACEMENT_SIBLING ? "Create Simplified Convex Collision Shape Sibling" : "Create Simplified Convex Static Body"));
		} break;
		case SHAPE_TYPE_MULTIPLE_CONVEX: {
			ur->create_action(TTR(placement_option == SHAPE_PLACEMENT_SIBLING ? "Create Multiple Convex Collision Shape Siblings" : "Create Multiple Convex Static Body"));
		} break;
		default:
			break;
	}

	List<Node *> selection = editor_selection->get_selected_node_list();

	bool verbose = false;
	if (selection.is_empty()) {
		selection.push_back(node);
		verbose = true;
	}

	for (Node *E : selection) {
		if (placement_option == SHAPE_PLACEMENT_SIBLING && E == get_tree()->get_edited_scene_root()) {
			if (verbose) {
				err_dialog->set_text(TTR("Can't create a collision shape as sibling for the scene root."));
				err_dialog->popup_centered();
			}
			continue;
		}

		MeshInstance3D *instance = Object::cast_to<MeshInstance3D>(E);
		if (!instance) {
			continue;
		}

		Ref<Mesh> m = instance->get_mesh();
		if (m.is_null()) {
			continue;
		}

		Vector<Ref<Shape3D>> shapes = create_shape_from_mesh(m, shape_type_option, verbose);
		if (shapes.is_empty()) {
			return;
		}