Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify difference between surface material and surface override material #82499

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/classes/Mesh.xml
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,14 @@
<method name="get_surface_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of surfaces that the [Mesh] holds.
Returns the number of surfaces that the [Mesh] holds. This is equivalent to [method MeshInstance3D.get_surface_override_material_count].
</description>
</method>
<method name="surface_get_arrays" qualifiers="const">
<return type="Array" />
<param index="0" name="surf_idx" type="int" />
<description>
Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see [method ArrayMesh.add_surface_from_arrays]).
Returns the arrays for the vertices, normals, UVs, etc. that make up the requested surface (see [method ArrayMesh.add_surface_from_arrays]).
</description>
</method>
<method name="surface_get_blend_shape_arrays" qualifiers="const">
Expand All @@ -184,6 +184,7 @@
<param index="0" name="surf_idx" type="int" />
<description>
Returns a [Material] in a given surface. Surface is rendered using this material.
[b]Note:[/b] This returns the material within the [Mesh] resource, not the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties. To get the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, use [method MeshInstance3D.get_surface_override_material] instead.
</description>
</method>
<method name="surface_set_material">
Expand All @@ -192,6 +193,7 @@
<param index="1" name="material" type="Material" />
<description>
Sets a [Material] for a given surface. Surface will be rendered using this material.
[b]Note:[/b] This assigns the material within the [Mesh] resource, not the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties. To set the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, use [method MeshInstance3D.set_surface_override_material] instead.
</description>
</method>
</methods>
Expand Down
6 changes: 4 additions & 2 deletions doc/classes/MeshInstance3D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@
<return type="Material" />
<param index="0" name="surface" type="int" />
<description>
Returns the override [Material] for the specified [param surface] of the [Mesh] resource.
Returns the override [Material] for the specified [param surface] of the [Mesh] resource. See also [method get_surface_override_material_count].
[b]Note:[/b] This returns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To get the material within the [Mesh] resource, use [method Mesh.surface_get_material] instead.
</description>
</method>
<method name="get_surface_override_material_count" qualifiers="const">
<return type="int" />
<description>
Returns the number of surface override materials. This is equivalent to [method Mesh.get_surface_count].
Returns the number of surface override materials. This is equivalent to [method Mesh.get_surface_count]. See also [method get_surface_override_material].
</description>
</method>
<method name="set_blend_shape_value">
Expand All @@ -97,6 +98,7 @@
<param index="1" name="material" type="Material" />
<description>
Sets the override [param material] for the specified [param surface] of the [Mesh] resource. This material is associated with this [MeshInstance3D] rather than with [member mesh].
[b]Note:[/b] This assigns the [Material] associated to the [MeshInstance3D]'s Surface Material Override properties, not the material within the [Mesh] resource. To set the material within the [Mesh] resource, use [method Mesh.surface_get_material] instead.
</description>
</method>
</methods>
Expand Down
Loading