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

Add explicit error messages to Multimesh functions #101109

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

clayjohn
Copy link
Member

@clayjohn clayjohn commented Jan 3, 2025

Fixes: #100988

Previously the RenderingServer errors filtered up to end users, but they are unclear and not helpful. This PR adds explicit messages to make the errors easier to understand and to avoid even calling into the RenderingServer.

…rs easier to understand.

Previously the RenderingServer errors filtered up to end users, but they are unclear and not helpful
@clayjohn clayjohn added enhancement topic:core cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release labels Jan 3, 2025
@clayjohn clayjohn added this to the 4.4 milestone Jan 3, 2025
@@ -249,39 +255,56 @@ void MultiMesh::set_physics_interpolation_quality(PhysicsInterpolationQuality p_
}

void MultiMesh::set_instance_transform(int p_instance, const Transform3D &p_transform) {
ERR_FAIL_INDEX_MSG(p_instance, instance_count, "Instance index out of bounds. Instance index must be a positive number that is less than `instance_count`.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say non-negative rather than positive (to include zero).

uint32_t stride = transform_format == TRANSFORM_2D ? 8 : 12;
stride += use_colors ? 4 : 0;
stride += use_custom_data ? 4 : 0;
ERR_FAIL_COND_MSG(stride * instance_count != p_buffer.size(), "Cannot set a buffer on a Multimesh that is a different size from the Multimeshes existing buffer.");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ERR_FAIL_COND_MSG(stride * instance_count != p_buffer.size(), "Cannot set a buffer on a Multimesh that is a different size from the Multimeshes existing buffer.");
ERR_FAIL_COND_MSG(stride * instance_count != p_buffer.size(), "Cannot set a buffer on a Multimesh that is a different size from the Multimesh's existing buffer.");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherrypick:4.3 Considered for cherry-picking into a future 4.3.x release enhancement topic:core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: MultiMesh uses_colors error vs use_colors property
3 participants