MeshInstance3D.xml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="MeshInstance3D" inherits="GeometryInstance3D" version="4.0">
  3. <brief_description>
  4. Node that instances meshes into a scenario.
  5. </brief_description>
  6. <description>
  7. MeshInstance3D is a node that takes a [Mesh] resource and adds it to the current scenario by creating an instance of it. This is the class most often used render 3D geometry and can be used to instance a single [Mesh] in many places. This allows reuse of geometry which can save on resources. When a [Mesh] has to be instantiated more than thousands of times at close proximity, consider using a [MultiMesh] in a [MultiMeshInstance3D] instead.
  8. </description>
  9. <tutorials>
  10. <link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
  11. <link title="3D Kinematic Character Demo">https://godotengine.org/asset-library/asset/126</link>
  12. <link title="3D Platformer Demo">https://godotengine.org/asset-library/asset/125</link>
  13. <link title="Third Person Shooter Demo">https://godotengine.org/asset-library/asset/678</link>
  14. </tutorials>
  15. <methods>
  16. <method name="create_convex_collision">
  17. <return type="void" />
  18. <argument index="0" name="clean" type="bool" default="true" />
  19. <argument index="1" name="simplify" type="bool" default="false" />
  20. <description>
  21. This helper creates a [StaticBody3D] child node with a [ConvexPolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing.
  22. If [code]clean[/code] is [code]true[/code] (default), duplicate and interior vertices are removed automatically. You can set it to [code]false[/code] to make the process faster if not needed.
  23. If [code]simplify[/code] is [code]true[/code], the geometry can be further simplified to reduce the amount of vertices. Disabled by default.
  24. </description>
  25. </method>
  26. <method name="create_debug_tangents">
  27. <return type="void" />
  28. <description>
  29. This helper creates a [MeshInstance3D] child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing.
  30. </description>
  31. </method>
  32. <method name="create_multiple_convex_collisions">
  33. <return type="void" />
  34. <description>
  35. This helper creates a [StaticBody3D] child node with multiple [ConvexPolygonShape3D] collision shapes calculated from the mesh geometry via convex decomposition. It's mainly used for testing.
  36. </description>
  37. </method>
  38. <method name="create_trimesh_collision">
  39. <return type="void" />
  40. <description>
  41. This helper creates a [StaticBody3D] child node with a [ConcavePolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing.
  42. </description>
  43. </method>
  44. <method name="find_blend_shape_by_name">
  45. <return type="int" />
  46. <argument index="0" name="name" type="StringName" />
  47. <description>
  48. </description>
  49. </method>
  50. <method name="get_active_material" qualifiers="const">
  51. <return type="Material" />
  52. <argument index="0" name="surface" type="int" />
  53. <description>
  54. Returns the [Material] that will be used by the [Mesh] when drawing. This can return the [member GeometryInstance3D.material_override], the surface override [Material] defined in this [MeshInstance3D], or the surface [Material] defined in the [Mesh]. For example, if [member GeometryInstance3D.material_override] is used, all surfaces will return the override material.
  55. </description>
  56. </method>
  57. <method name="get_blend_shape_count" qualifiers="const">
  58. <return type="int" />
  59. <description>
  60. </description>
  61. </method>
  62. <method name="get_blend_shape_value" qualifiers="const">
  63. <return type="float" />
  64. <argument index="0" name="blend_shape_idx" type="int" />
  65. <description>
  66. </description>
  67. </method>
  68. <method name="get_surface_override_material" qualifiers="const">
  69. <return type="Material" />
  70. <argument index="0" name="surface" type="int" />
  71. <description>
  72. Returns the override [Material] for the specified surface of the [Mesh] resource.
  73. </description>
  74. </method>
  75. <method name="get_surface_override_material_count" qualifiers="const">
  76. <return type="int" />
  77. <description>
  78. Returns the number of surface override materials. This is equivalent to [method Mesh.get_surface_count].
  79. </description>
  80. </method>
  81. <method name="set_blend_shape_value">
  82. <return type="void" />
  83. <argument index="0" name="blend_shape_idx" type="int" />
  84. <argument index="1" name="value" type="float" />
  85. <description>
  86. </description>
  87. </method>
  88. <method name="set_surface_override_material">
  89. <return type="void" />
  90. <argument index="0" name="surface" type="int" />
  91. <argument index="1" name="material" type="Material" />
  92. <description>
  93. Sets the override [Material] for the specified surface of the [Mesh] resource. This material is associated with this [MeshInstance3D] rather than with the [Mesh] resource.
  94. </description>
  95. </method>
  96. </methods>
  97. <members>
  98. <member name="mesh" type="Mesh" setter="set_mesh" getter="get_mesh">
  99. The [Mesh] resource for the instance.
  100. </member>
  101. <member name="skeleton" type="NodePath" setter="set_skeleton_path" getter="get_skeleton_path" default="NodePath(&quot;..&quot;)">
  102. [NodePath] to the [Skeleton3D] associated with the instance.
  103. </member>
  104. <member name="skin" type="Skin" setter="set_skin" getter="get_skin">
  105. Sets the skin to be used by this instance.
  106. </member>
  107. </members>
  108. </class>