mesh_instance_editor_plugin.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. /**************************************************************************/
  2. /* mesh_instance_editor_plugin.cpp */
  3. /**************************************************************************/
  4. /* This file is part of: */
  5. /* GODOT ENGINE */
  6. /* https://godotengine.org */
  7. /**************************************************************************/
  8. /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
  9. /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
  10. /* */
  11. /* Permission is hereby granted, free of charge, to any person obtaining */
  12. /* a copy of this software and associated documentation files (the */
  13. /* "Software"), to deal in the Software without restriction, including */
  14. /* without limitation the rights to use, copy, modify, merge, publish, */
  15. /* distribute, sublicense, and/or sell copies of the Software, and to */
  16. /* permit persons to whom the Software is furnished to do so, subject to */
  17. /* the following conditions: */
  18. /* */
  19. /* The above copyright notice and this permission notice shall be */
  20. /* included in all copies or substantial portions of the Software. */
  21. /* */
  22. /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
  23. /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
  24. /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
  25. /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
  26. /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
  27. /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
  28. /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
  29. /**************************************************************************/
  30. #include "mesh_instance_editor_plugin.h"
  31. #include "editor/editor_scale.h"
  32. #include "scene/3d/collision_shape.h"
  33. #include "scene/3d/navigation_mesh_instance.h"
  34. #include "scene/3d/physics_body.h"
  35. #include "scene/gui/box_container.h"
  36. #include "spatial_editor_plugin.h"
  37. void MeshInstanceEditor::_node_removed(Node *p_node) {
  38. if (p_node == node) {
  39. node = nullptr;
  40. options->hide();
  41. }
  42. }
  43. void MeshInstanceEditor::edit(MeshInstance *p_mesh) {
  44. node = p_mesh;
  45. }
  46. void MeshInstanceEditor::_menu_option(int p_option) {
  47. Ref<Mesh> mesh = node->get_mesh();
  48. if (mesh.is_null()) {
  49. err_dialog->set_text(TTR("Mesh is empty!"));
  50. err_dialog->popup_centered_minsize();
  51. return;
  52. }
  53. switch (p_option) {
  54. case MENU_OPTION_CREATE_STATIC_TRIMESH_BODY: {
  55. EditorSelection *editor_selection = EditorNode::get_singleton()->get_editor_selection();
  56. UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
  57. List<Node *> selection = editor_selection->get_selected_node_list();
  58. if (selection.empty()) {
  59. Ref<Shape> shape = mesh->create_trimesh_shape();
  60. if (shape.is_null()) {
  61. err_dialog->set_text(TTR("Couldn't create a Trimesh collision shape."));
  62. err_dialog->popup_centered_minsize();
  63. return;
  64. }
  65. CollisionShape *cshape = memnew(CollisionShape);
  66. cshape->set_shape(shape);
  67. StaticBody *body = memnew(StaticBody);
  68. body->add_child(cshape);
  69. Node *owner = get_tree()->get_edited_scene_root();
  70. ur->create_action(TTR("Create Static Trimesh Body"));
  71. ur->add_do_method(node, "add_child", body);
  72. ur->add_do_method(body, "set_owner", owner);
  73. ur->add_do_method(cshape, "set_owner", owner);
  74. ur->add_do_reference(body);
  75. ur->add_undo_method(node, "remove_child", body);
  76. ur->commit_action();
  77. return;
  78. }
  79. ur->create_action(TTR("Create Static Trimesh Body"));
  80. for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
  81. MeshInstance *instance = Object::cast_to<MeshInstance>(E->get());
  82. if (!instance) {
  83. continue;
  84. }
  85. Ref<Mesh> m = instance->get_mesh();
  86. if (m.is_null()) {
  87. continue;
  88. }
  89. Ref<Shape> shape = m->create_trimesh_shape();
  90. if (shape.is_null()) {
  91. continue;
  92. }
  93. CollisionShape *cshape = memnew(CollisionShape);
  94. cshape->set_shape(shape);
  95. StaticBody *body = memnew(StaticBody);
  96. body->add_child(cshape);
  97. Node *owner = get_tree()->get_edited_scene_root();
  98. ur->add_do_method(instance, "add_child", body);
  99. ur->add_do_method(body, "set_owner", owner);
  100. ur->add_do_method(cshape, "set_owner", owner);
  101. ur->add_do_reference(body);
  102. ur->add_undo_method(instance, "remove_child", body);
  103. }
  104. ur->commit_action();
  105. } break;
  106. case MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE: {
  107. if (node == get_tree()->get_edited_scene_root()) {
  108. err_dialog->set_text(TTR("This doesn't work on scene root!"));
  109. err_dialog->popup_centered_minsize();
  110. return;
  111. }
  112. Ref<Shape> shape = mesh->create_trimesh_shape();
  113. if (shape.is_null()) {
  114. return;
  115. }
  116. CollisionShape *cshape = memnew(CollisionShape);
  117. cshape->set_shape(shape);
  118. cshape->set_transform(node->get_transform());
  119. Node *owner = get_tree()->get_edited_scene_root();
  120. UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
  121. ur->create_action(TTR("Create Trimesh Static Shape"));
  122. ur->add_do_method(node->get_parent(), "add_child", cshape);
  123. ur->add_do_method(node->get_parent(), "move_child", cshape, node->get_index() + 1);
  124. ur->add_do_method(cshape, "set_owner", owner);
  125. ur->add_do_reference(cshape);
  126. ur->add_undo_method(node->get_parent(), "remove_child", cshape);
  127. ur->commit_action();
  128. } break;
  129. case MENU_OPTION_CREATE_SINGLE_CONVEX_COLLISION_SHAPE:
  130. case MENU_OPTION_CREATE_SIMPLIFIED_CONVEX_COLLISION_SHAPE: {
  131. if (node == get_tree()->get_edited_scene_root()) {
  132. err_dialog->set_text(TTR("Can't create a single convex collision shape for the scene root."));
  133. err_dialog->popup_centered_minsize();
  134. return;
  135. }
  136. bool simplify = (p_option == MENU_OPTION_CREATE_SIMPLIFIED_CONVEX_COLLISION_SHAPE);
  137. Ref<Shape> shape = mesh->create_convex_shape(true, simplify);
  138. if (shape.is_null()) {
  139. err_dialog->set_text(TTR("Couldn't create a single convex collision shape."));
  140. err_dialog->popup_centered_minsize();
  141. return;
  142. }
  143. UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
  144. if (simplify) {
  145. ur->create_action(TTR("Create Simplified Convex Shape"));
  146. } else {
  147. ur->create_action(TTR("Create Single Convex Shape"));
  148. }
  149. CollisionShape *cshape = memnew(CollisionShape);
  150. cshape->set_shape(shape);
  151. cshape->set_transform(node->get_transform());
  152. Node *owner = get_tree()->get_edited_scene_root();
  153. ur->add_do_method(node->get_parent(), "add_child", cshape);
  154. ur->add_do_method(node->get_parent(), "move_child", cshape, node->get_index() + 1);
  155. ur->add_do_method(cshape, "set_owner", owner);
  156. ur->add_do_reference(cshape);
  157. ur->add_undo_method(node->get_parent(), "remove_child", cshape);
  158. ur->commit_action();
  159. } break;
  160. case MENU_OPTION_CREATE_MULTIPLE_CONVEX_COLLISION_SHAPES: {
  161. if (node == get_tree()->get_edited_scene_root()) {
  162. err_dialog->set_text(TTR("Can't create multiple convex collision shapes for the scene root."));
  163. err_dialog->popup_centered_minsize();
  164. return;
  165. }
  166. Vector<Ref<Shape>> shapes = mesh->convex_decompose();
  167. if (!shapes.size()) {
  168. err_dialog->set_text(TTR("Couldn't create any collision shapes."));
  169. err_dialog->popup_centered_minsize();
  170. return;
  171. }
  172. UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
  173. ur->create_action(TTR("Create Multiple Convex Shapes"));
  174. for (int i = 0; i < shapes.size(); i++) {
  175. CollisionShape *cshape = memnew(CollisionShape);
  176. cshape->set_shape(shapes[i]);
  177. cshape->set_transform(node->get_transform());
  178. Node *owner = get_tree()->get_edited_scene_root();
  179. ur->add_do_method(node->get_parent(), "add_child", cshape);
  180. ur->add_do_method(node->get_parent(), "move_child", cshape, node->get_index() + 1);
  181. ur->add_do_method(cshape, "set_owner", owner);
  182. ur->add_do_reference(cshape);
  183. ur->add_undo_method(node->get_parent(), "remove_child", cshape);
  184. }
  185. ur->commit_action();
  186. } break;
  187. case MENU_OPTION_CREATE_NAVMESH: {
  188. Ref<NavigationMesh> nmesh = memnew(NavigationMesh);
  189. if (nmesh.is_null()) {
  190. return;
  191. }
  192. nmesh->create_from_mesh(mesh);
  193. NavigationMeshInstance *nmi = memnew(NavigationMeshInstance);
  194. nmi->set_navigation_mesh(nmesh);
  195. Node *owner = get_tree()->get_edited_scene_root();
  196. UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
  197. ur->create_action(TTR("Create Navigation Mesh"));
  198. ur->add_do_method(node, "add_child", nmi);
  199. ur->add_do_method(nmi, "set_owner", owner);
  200. ur->add_do_reference(nmi);
  201. ur->add_undo_method(node, "remove_child", nmi);
  202. ur->commit_action();
  203. } break;
  204. case MENU_OPTION_CREATE_OUTLINE_MESH: {
  205. outline_dialog->popup_centered(Vector2(200, 90));
  206. } break;
  207. case MENU_OPTION_CREATE_UV2: {
  208. Ref<ArrayMesh> mesh2 = node->get_mesh();
  209. if (!mesh2.is_valid()) {
  210. err_dialog->set_text(TTR("Contained Mesh is not of type ArrayMesh."));
  211. err_dialog->popup_centered_minsize();
  212. return;
  213. }
  214. Error err = mesh2->lightmap_unwrap(node->get_global_transform());
  215. if (err != OK) {
  216. err_dialog->set_text(TTR("UV Unwrap failed, mesh may not be manifold?"));
  217. err_dialog->popup_centered_minsize();
  218. return;
  219. }
  220. } break;
  221. case MENU_OPTION_DEBUG_UV1: {
  222. Ref<Mesh> mesh2 = node->get_mesh();
  223. if (!mesh2.is_valid()) {
  224. err_dialog->set_text(TTR("No mesh to debug."));
  225. err_dialog->popup_centered_minsize();
  226. return;
  227. }
  228. _create_uv_lines(0);
  229. } break;
  230. case MENU_OPTION_DEBUG_UV2: {
  231. Ref<Mesh> mesh2 = node->get_mesh();
  232. if (!mesh2.is_valid()) {
  233. err_dialog->set_text(TTR("No mesh to debug."));
  234. err_dialog->popup_centered_minsize();
  235. return;
  236. }
  237. _create_uv_lines(1);
  238. } break;
  239. }
  240. }
  241. struct MeshInstanceEditorEdgeSort {
  242. Vector2 a;
  243. Vector2 b;
  244. bool operator<(const MeshInstanceEditorEdgeSort &p_b) const {
  245. if (a == p_b.a) {
  246. return b < p_b.b;
  247. } else {
  248. return a < p_b.a;
  249. }
  250. }
  251. MeshInstanceEditorEdgeSort() {}
  252. MeshInstanceEditorEdgeSort(const Vector2 &p_a, const Vector2 &p_b) {
  253. if (p_a < p_b) {
  254. a = p_a;
  255. b = p_b;
  256. } else {
  257. b = p_a;
  258. a = p_b;
  259. }
  260. }
  261. };
  262. void MeshInstanceEditor::_create_uv_lines(int p_layer) {
  263. Ref<Mesh> mesh = node->get_mesh();
  264. ERR_FAIL_COND(!mesh.is_valid());
  265. Set<MeshInstanceEditorEdgeSort> edges;
  266. uv_lines.clear();
  267. for (int i = 0; i < mesh->get_surface_count(); i++) {
  268. if (mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) {
  269. continue;
  270. }
  271. Array a = mesh->surface_get_arrays(i);
  272. PoolVector<Vector2> uv = a[p_layer == 0 ? Mesh::ARRAY_TEX_UV : Mesh::ARRAY_TEX_UV2];
  273. if (uv.size() == 0) {
  274. err_dialog->set_text(vformat(TTR("Mesh has no UV in layer %d."), p_layer + 1));
  275. err_dialog->popup_centered_minsize();
  276. return;
  277. }
  278. PoolVector<Vector2>::Read r = uv.read();
  279. PoolVector<int> indices = a[Mesh::ARRAY_INDEX];
  280. PoolVector<int>::Read ri;
  281. int ic;
  282. bool use_indices;
  283. if (indices.size()) {
  284. ic = indices.size();
  285. ri = indices.read();
  286. use_indices = true;
  287. } else {
  288. ic = uv.size();
  289. use_indices = false;
  290. }
  291. for (int j = 0; j < ic; j += 3) {
  292. for (int k = 0; k < 3; k++) {
  293. MeshInstanceEditorEdgeSort edge;
  294. if (use_indices) {
  295. edge.a = r[ri[j + k]];
  296. edge.b = r[ri[j + ((k + 1) % 3)]];
  297. } else {
  298. edge.a = r[j + k];
  299. edge.b = r[j + ((k + 1) % 3)];
  300. }
  301. if (edges.has(edge)) {
  302. continue;
  303. }
  304. uv_lines.push_back(edge.a);
  305. uv_lines.push_back(edge.b);
  306. edges.insert(edge);
  307. }
  308. }
  309. }
  310. debug_uv_dialog->popup_centered_minsize();
  311. }
  312. void MeshInstanceEditor::_debug_uv_draw() {
  313. if (uv_lines.size() == 0) {
  314. return;
  315. }
  316. debug_uv->set_clip_contents(true);
  317. debug_uv->draw_rect(Rect2(Vector2(), debug_uv->get_size()), get_color("dark_color_3", "Editor"));
  318. debug_uv->draw_set_transform(Vector2(), 0, debug_uv->get_size());
  319. // Use a translucent color to allow overlapping triangles to be visible.
  320. debug_uv->draw_multiline(uv_lines, get_color("mono_color", "Editor") * Color(1, 1, 1, 0.5), Math::round(EDSCALE));
  321. }
  322. void MeshInstanceEditor::_create_outline_mesh() {
  323. Ref<Mesh> mesh = node->get_mesh();
  324. if (mesh.is_null()) {
  325. err_dialog->set_text(TTR("MeshInstance lacks a Mesh!"));
  326. err_dialog->popup_centered_minsize();
  327. return;
  328. }
  329. if (mesh->get_surface_count() == 0) {
  330. err_dialog->set_text(TTR("Mesh has not surface to create outlines from!"));
  331. err_dialog->popup_centered_minsize();
  332. return;
  333. } else if (mesh->get_surface_count() == 1 && mesh->surface_get_primitive_type(0) != Mesh::PRIMITIVE_TRIANGLES) {
  334. err_dialog->set_text(TTR("Mesh primitive type is not PRIMITIVE_TRIANGLES!"));
  335. err_dialog->popup_centered_minsize();
  336. return;
  337. }
  338. Ref<Mesh> mesho = mesh->create_outline(outline_size->get_value());
  339. if (mesho.is_null()) {
  340. err_dialog->set_text(TTR("Could not create outline!"));
  341. err_dialog->popup_centered_minsize();
  342. return;
  343. }
  344. MeshInstance *mi = memnew(MeshInstance);
  345. mi->set_mesh(mesho);
  346. Node *owner = get_tree()->get_edited_scene_root();
  347. UndoRedo *ur = EditorNode::get_singleton()->get_undo_redo();
  348. ur->create_action(TTR("Create Outline"));
  349. ur->add_do_method(node, "add_child", mi);
  350. ur->add_do_method(mi, "set_owner", owner);
  351. ur->add_do_reference(mi);
  352. ur->add_undo_method(node, "remove_child", mi);
  353. ur->commit_action();
  354. }
  355. void MeshInstanceEditor::_bind_methods() {
  356. ClassDB::bind_method("_menu_option", &MeshInstanceEditor::_menu_option);
  357. ClassDB::bind_method("_create_outline_mesh", &MeshInstanceEditor::_create_outline_mesh);
  358. ClassDB::bind_method("_debug_uv_draw", &MeshInstanceEditor::_debug_uv_draw);
  359. }
  360. MeshInstanceEditor::MeshInstanceEditor() {
  361. options = memnew(MenuButton);
  362. options->set_switch_on_hover(true);
  363. SpatialEditor::get_singleton()->add_control_to_menu_panel(options);
  364. options->set_text(TTR("Mesh"));
  365. options->set_icon(EditorNode::get_singleton()->get_gui_base()->get_icon("MeshInstance", "EditorIcons"));
  366. options->get_popup()->add_item(TTR("Create Trimesh Static Body"), MENU_OPTION_CREATE_STATIC_TRIMESH_BODY);
  367. options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a StaticBody and assigns a polygon-based collision shape to it automatically.\nThis is the most accurate (but slowest) option for collision detection."));
  368. options->get_popup()->add_separator();
  369. options->get_popup()->add_item(TTR("Create Trimesh Collision Sibling"), MENU_OPTION_CREATE_TRIMESH_COLLISION_SHAPE);
  370. options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a polygon-based collision shape.\nThis is the most accurate (but slowest) option for collision detection."));
  371. options->get_popup()->add_item(TTR("Create Single Convex Collision Sibling"), MENU_OPTION_CREATE_SINGLE_CONVEX_COLLISION_SHAPE);
  372. options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a single convex collision shape.\nThis is the fastest (but least accurate) option for collision detection."));
  373. options->get_popup()->add_item(TTR("Create Simplified Convex Collision Sibling"), MENU_OPTION_CREATE_SIMPLIFIED_CONVEX_COLLISION_SHAPE);
  374. options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a simplified convex collision shape.\nThis is similar to single collision shape, but can result in a simpler geometry in some cases, at the cost of accuracy."));
  375. options->get_popup()->add_item(TTR("Create Multiple Convex Collision Siblings"), MENU_OPTION_CREATE_MULTIPLE_CONVEX_COLLISION_SHAPES);
  376. options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a polygon-based collision shape.\nThis is a performance middle-ground between a single convex collision and a polygon-based collision."));
  377. options->get_popup()->add_separator();
  378. options->get_popup()->add_item(TTR("Create Navigation Mesh"), MENU_OPTION_CREATE_NAVMESH);
  379. options->get_popup()->add_separator();
  380. options->get_popup()->add_item(TTR("Create Outline Mesh..."), MENU_OPTION_CREATE_OUTLINE_MESH);
  381. options->get_popup()->set_item_tooltip(options->get_popup()->get_item_count() - 1, TTR("Creates a static outline mesh. The outline mesh will have its normals flipped automatically.\nThis can be used instead of the Material3D Grow property when using that property isn't possible."));
  382. options->get_popup()->add_separator();
  383. options->get_popup()->add_item(TTR("View UV1"), MENU_OPTION_DEBUG_UV1);
  384. options->get_popup()->add_item(TTR("View UV2"), MENU_OPTION_DEBUG_UV2);
  385. options->get_popup()->add_item(TTR("Unwrap UV2 for Lightmap/AO"), MENU_OPTION_CREATE_UV2);
  386. options->get_popup()->connect("id_pressed", this, "_menu_option");
  387. outline_dialog = memnew(ConfirmationDialog);
  388. outline_dialog->set_title(TTR("Create Outline Mesh"));
  389. outline_dialog->get_ok()->set_text(TTR("Create"));
  390. VBoxContainer *outline_dialog_vbc = memnew(VBoxContainer);
  391. outline_dialog->add_child(outline_dialog_vbc);
  392. //outline_dialog->set_child_rect(outline_dialog_vbc);
  393. outline_size = memnew(SpinBox);
  394. outline_size->set_min(0.001);
  395. outline_size->set_max(1024);
  396. outline_size->set_step(0.001);
  397. outline_size->set_value(0.05);
  398. outline_dialog_vbc->add_margin_child(TTR("Outline Size:"), outline_size);
  399. add_child(outline_dialog);
  400. outline_dialog->connect("confirmed", this, "_create_outline_mesh");
  401. err_dialog = memnew(AcceptDialog);
  402. add_child(err_dialog);
  403. debug_uv_dialog = memnew(AcceptDialog);
  404. debug_uv_dialog->set_title(TTR("UV Channel Debug"));
  405. add_child(debug_uv_dialog);
  406. debug_uv = memnew(Control);
  407. debug_uv->set_custom_minimum_size(Size2(600, 600) * EDSCALE);
  408. debug_uv->connect("draw", this, "_debug_uv_draw");
  409. debug_uv_dialog->add_child(debug_uv);
  410. }
  411. void MeshInstanceEditorPlugin::edit(Object *p_object) {
  412. mesh_editor->edit(Object::cast_to<MeshInstance>(p_object));
  413. }
  414. bool MeshInstanceEditorPlugin::handles(Object *p_object) const {
  415. return p_object->is_class("MeshInstance");
  416. }
  417. void MeshInstanceEditorPlugin::make_visible(bool p_visible) {
  418. if (p_visible) {
  419. mesh_editor->options->show();
  420. } else {
  421. mesh_editor->options->hide();
  422. mesh_editor->edit(nullptr);
  423. }
  424. }
  425. MeshInstanceEditorPlugin::MeshInstanceEditorPlugin(EditorNode *p_node) {
  426. editor = p_node;
  427. mesh_editor = memnew(MeshInstanceEditor);
  428. editor->get_viewport()->add_child(mesh_editor);
  429. mesh_editor->options->hide();
  430. }
  431. MeshInstanceEditorPlugin::~MeshInstanceEditorPlugin() {
  432. }