2017-09-13 04:42:36 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2022-02-14 21:18:53 +08:00
<class name= "MeshInstance3D" inherits= "GeometryInstance3D" version= "4.0" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2017-09-13 04:42:36 +08:00
<brief_description >
Node that instances meshes into a scenario.
</brief_description>
<description >
2022-07-30 03:48:12 +08:00
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 reusing 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.
2017-09-13 04:42:36 +08:00
</description>
<tutorials >
2020-10-01 16:34:47 +08:00
<link title= "3D Material Testers Demo" > https://godotengine.org/asset-library/asset/123</link>
<link title= "3D Kinematic Character Demo" > https://godotengine.org/asset-library/asset/126</link>
<link title= "3D Platformer Demo" > https://godotengine.org/asset-library/asset/125</link>
<link title= "Third Person Shooter Demo" > https://godotengine.org/asset-library/asset/678</link>
2017-09-13 04:42:36 +08:00
</tutorials>
<methods >
<method name= "create_convex_collision" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "clean" type= "bool" default= "true" />
<param index= "1" name= "simplify" type= "bool" default= "false" />
2017-09-13 04:42:36 +08:00
<description >
2020-03-31 00:22:57 +08:00
This helper creates a [StaticBody3D] child node with a [ConvexPolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing.
2022-08-12 21:36:48 +08:00
If [param clean] 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.
2022-08-18 06:08:09 +08:00
If [param simplify] is [code]true[/code], the geometry can be further simplified to reduce the number of vertices. Disabled by default.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-04-29 18:10:58 +08:00
<method name= "create_debug_tangents" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2020-04-30 14:41:22 +08:00
<description >
2021-04-29 18:10:58 +08:00
This helper creates a [MeshInstance3D] child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing.
2020-04-30 14:41:22 +08:00
</description>
</method>
2021-04-29 18:10:58 +08:00
<method name= "create_multiple_convex_collisions" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2017-09-13 04:42:36 +08:00
<description >
2021-04-29 18:10:58 +08:00
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.
2017-09-13 04:42:36 +08:00
</description>
</method>
<method name= "create_trimesh_collision" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2017-09-13 04:42:36 +08:00
<description >
2020-03-31 00:22:57 +08:00
This helper creates a [StaticBody3D] child node with a [ConcavePolygonShape3D] collision shape calculated from the mesh geometry. It's mainly used for testing.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-10-16 06:04:35 +08:00
<method name= "find_blend_shape_by_name" >
<return type= "int" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "name" type= "StringName" />
2021-10-16 06:04:35 +08:00
<description >
</description>
</method>
2020-01-31 09:18:09 +08:00
<method name= "get_active_material" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Material" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "surface" type= "int" />
2020-01-31 09:18:09 +08:00
<description >
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.
</description>
</method>
2021-10-16 06:04:35 +08:00
<method name= "get_blend_shape_count" qualifiers= "const" >
<return type= "int" />
<description >
</description>
</method>
<method name= "get_blend_shape_value" qualifiers= "const" >
<return type= "float" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "blend_shape_idx" type= "int" />
2021-10-16 06:04:35 +08:00
<description >
</description>
</method>
2021-04-14 11:45:16 +08:00
<method name= "get_surface_override_material" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "Material" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "surface" type= "int" />
2017-09-13 04:42:36 +08:00
<description >
2020-01-31 09:18:09 +08:00
Returns the override [Material] for the specified surface of the [Mesh] resource.
2017-09-13 04:42:36 +08:00
</description>
</method>
2021-04-14 11:45:16 +08:00
<method name= "get_surface_override_material_count" qualifiers= "const" >
2021-07-30 21:28:05 +08:00
<return type= "int" />
2018-10-25 21:14:36 +08:00
<description >
2021-04-14 11:45:16 +08:00
Returns the number of surface override materials. This is equivalent to [method Mesh.get_surface_count].
2018-10-25 21:14:36 +08:00
</description>
</method>
2021-10-16 06:04:35 +08:00
<method name= "set_blend_shape_value" >
<return type= "void" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "blend_shape_idx" type= "int" />
<param index= "1" name= "value" type= "float" />
2021-10-16 06:04:35 +08:00
<description >
</description>
</method>
2021-04-14 11:45:16 +08:00
<method name= "set_surface_override_material" >
2021-07-30 21:28:05 +08:00
<return type= "void" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "surface" type= "int" />
<param index= "1" name= "material" type= "Material" />
2017-09-13 04:42:36 +08:00
<description >
2020-01-31 09:18:09 +08:00
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.
2017-09-13 04:42:36 +08:00
</description>
</method>
</methods>
<members >
2019-07-16 02:42:47 +08:00
<member name= "mesh" type= "Mesh" setter= "set_mesh" getter= "get_mesh" >
2017-09-13 04:42:36 +08:00
The [Mesh] resource for the instance.
</member>
2019-06-29 18:38:01 +08:00
<member name= "skeleton" type= "NodePath" setter= "set_skeleton_path" getter= "get_skeleton_path" default= "NodePath("..")" >
2020-03-31 00:22:57 +08:00
[NodePath] to the [Skeleton3D] associated with the instance.
2017-09-13 04:42:36 +08:00
</member>
2019-09-24 17:44:48 +08:00
<member name= "skin" type= "Skin" setter= "set_skin" getter= "get_skin" >
2020-01-15 05:27:14 +08:00
Sets the skin to be used by this instance.
2019-09-24 17:44:48 +08:00
</member>
2017-09-13 04:42:36 +08:00
</members>
</class>