Skip to content

Commit 766f5d0

Browse files
committed
Update documentation
1 parent fbc1537 commit 766f5d0

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

addons/4d/doc_classes/Material4D.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@
4444
[b]Note:[/b] When making materials, use the high-level properties from the derived classes instead, such as [member WireMaterial4D.albedo_source] or [member TetraMaterial4D.albedo_source].
4545
</description>
4646
</method>
47+
<method name="get_cross_section_material">
48+
<return type="ShaderMaterial" />
49+
<description>
50+
Returns a 3D material to be used by the cross-section renderer. The returned material is automatically updated to match the properties of this material.
51+
</description>
52+
</method>
4753
<method name="is_default_material" qualifiers="const">
4854
<return type="bool" />
4955
<description>

addons/4d/doc_classes/Mesh4D.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
Callback method that should return the vertices of a mesh. Do not call this method. This can be overridden by derived classes when creating a custom mesh type in GDScript or another scripting language. See [method get_vertices] for details of the returned data.
2828
</description>
2929
</method>
30+
<method name="_update_cross_section_mesh" qualifiers="virtual">
31+
<return type="void" />
32+
<description>
33+
Updates the 3D mesh this mesh uses for cross-section rendering. Can be called to force the cross-section mesh to be updated, but typically should only be called internally. Subclasses can override this, but most cases should be covered by the default implementation.
34+
</description>
35+
</method>
3036
<method name="_validate_material_for_mesh" qualifiers="virtual">
3137
<return type="void" />
3238
<param index="0" name="material" type="Material4D" />
@@ -48,6 +54,12 @@
4854
[b]Note[/b]: This only looks at edge indices. It does not remove duplicate vertices, nor does it have access to the vertices array.
4955
</description>
5056
</method>
57+
<method name="get_cross_section_mesh">
58+
<return type="ArrayMesh" />
59+
<description>
60+
Returns a 3D mesh that can be used to render 3D cross-sections of this mesh in the cross-section renderer. This mesh will only render properly with the cross-section material from [method Material4D.get_cross_section_material].
61+
</description>
62+
</method>
5163
<method name="get_edge_indices">
5264
<return type="PackedInt32Array" />
5365
<description>
@@ -82,6 +94,12 @@
8294
If a mesh has valid data, the result of the validation will be cached until the mesh data changes, so this method may be called multiple times without performance concerns. This also means this method should be called after generating a mesh. This especially useful when generating a mesh on a thread; calling this on the thread will avoid stalling the main thread with mesh validation during rendering.
8395
</description>
8496
</method>
97+
<method name="mark_cross_section_mesh_dirty">
98+
<return type="void" />
99+
<description>
100+
Marks the cross-section mesh as dirty, meaning it needs to be updated. Must be called by subclasses whenever the underlying 4D mesh data changes.
101+
</description>
102+
</method>
85103
<method name="reset_mesh_data_validation">
86104
<return type="void" />
87105
<description>
@@ -101,6 +119,12 @@
101119
Converts this Mesh4D to a [WireMesh4D]. This method will use the best conversion available. For example, a [BoxTetraMesh4D] will be converted to a [BoxWireMesh4D]. If no specialized conversion is available, the method will return an [ArrayWireMesh4D]. See [method to_array_wire_mesh] for more details.
102120
</description>
103121
</method>
122+
<method name="update_cross_section_mesh">
123+
<return type="void" />
124+
<description>
125+
Updates the 3D mesh this mesh uses for cross-section rendering. Can be called to force the cross-section mesh to be updated, but typically should only be called internally.
126+
</description>
127+
</method>
104128
<method name="validate_material_for_mesh">
105129
<return type="void" />
106130
<param index="0" name="material" type="Material4D" />

addons/4d/doc_classes/TetraMaterial4D.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
<member name="albedo_source" type="int" setter="set_albedo_source" getter="get_albedo_source" enum="TetraMaterial4D.TetraColorSource" default="0">
2020
The albedo source of the material, an enum specific to tetrahedral meshes. Can be a single color, per-vertex, per-cell, per-cell UVW coordinates, 4D texture, or a combination of single color and the other color sources.
2121
</member>
22+
<member name="texture" type="Texture3D" setter="set_texture" getter="get_texture">
23+
The albedo texture of the material as a Texture3D. Used by the cross-section renderer. Used when albedo_source is [constant TETRA_COLOR_SOURCE_CELL_UVW_ONLY] or [constant TETRA_COLOR_SOURCE_CELL_UVW_AND_SINGLE].
24+
</member>
2225
</members>
2326
<constants>
2427
<constant name="TETRA_COLOR_SOURCE_SINGLE_COLOR" value="0" enum="TetraColorSource">

0 commit comments

Comments
 (0)