Skip to content

Infer array length from custom array if no vertex array is provided - #1133

Merged
Arctis-Fireblight merged 3 commits into
Redot-Engine:devfrom
Arctis-Fireblight:pr/pr-150
Dec 25, 2025
Merged

Arctis-Fireblight merged 3 commits into
Redot-Engine:devfrom
Arctis-Fireblight:pr/pr-150

Conversation

@Arctis-Fireblight

Copy link
Copy Markdown
Contributor

While the RenderingServer::mesh_create_surface_data_from_arrays method does support vertexless meshes (see godotengine/godot#62046 and godotengine/godot#83446), it enforces that the size of custom arrays is dependent on the size of the vertex array. This effectively means that custom arrays cannot be used in vertexless meshes.

This commit changes the way the array length is computed so that if no vertex array is provided, its length will be inferred from the custom arrays, if provided. It therefore adds support for custom arrays in vertexless meshes.

closes #150

PR by @Adrian-Samoticha

Adrian-Samoticha and others added 3 commits June 24, 2024 14:37
While the `RenderingServer::mesh_create_surface_data_from_arrays`
method does support vertexless meshes (see #62046 and #83446),
it enforces that the size of custom arrays is dependent on the size of
the vertex array. This effectively means  that custom arrays cannot be
used in vertexless meshes.

This commit changes the way the array length is computed so that if no
vertex array is provided, its length will be inferred from the custom
arrays, if provided. It therefore adds support for custom arrays in
vertexless meshes.
Co-authored-by: A Thousand Ships (she/her) <96648715+AThousandShips@users.noreply.github.com>
@Arctis-Fireblight Arctis-Fireblight self-assigned this Dec 25, 2025
@Arctis-Fireblight
Arctis-Fireblight merged commit 8220657 into Redot-Engine:dev Dec 25, 2025
20 checks passed
@Arctis-Fireblight
Arctis-Fireblight deleted the pr/pr-150 branch December 25, 2025 20:47
mcdubhghlas pushed a commit to mcdubhghlas/redot-engine that referenced this pull request Feb 17, 2026
…edot-Engine#1133)

* Infer array length from custom array if no vertex array is provided

While the `RenderingServer::mesh_create_surface_data_from_arrays`
method does support vertexless meshes (see #62046 and #83446),
it enforces that the size of custom arrays is dependent on the size of
the vertex array. This effectively means  that custom arrays cannot be
used in vertexless meshes.

This commit changes the way the array length is computed so that if no
vertex array is provided, its length will be inferred from the custom
arrays, if provided. It therefore adds support for custom arrays in
vertexless meshes.
---------

Co-authored-by: Adrian Samoticha <86920182+Adrian-Samoticha@users.noreply.github.com>
Co-authored-by: A Thousand Ships (she/her) <96648715+AThousandShips@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants