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

only take up to the max number of joints #9351

Merged
merged 2 commits into from Aug 28, 2023

Conversation

mockersf
Copy link
Member

@mockersf mockersf commented Aug 3, 2023

Objective

Solution

  • Only take up to MAX_JOINTS joints when extending the buffer

@mockersf mockersf added the A-Animation Make things move and change over time label Aug 3, 2023
@mockersf mockersf requested a review from james7132 August 3, 2023 22:25
Copy link
Contributor

@nicopap nicopap left a comment

Choose a reason for hiding this comment

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

This is the correct fix for the current code.

Though, adding an error/warning log in bevy_gltf/src/loader.rs at line 500 if we have more joints than max would also help users understand why things break.

@mockersf
Copy link
Member Author

mockersf commented Aug 5, 2023

added a warning 👍

@@ -497,6 +498,16 @@ async fn load_gltf<'a, 'b>(
.map(|node| node_index_to_entity_map[&node.index()])
.collect();

if joint_entities.len() > MAX_JOINTS && warned_about_max_joints.insert(skin_index) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this properly short circuit, and not insert into the hashmap if the len <= MAX_JOINTS?

Copy link
Contributor

Choose a reason for hiding this comment

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

@nicopap nicopap added C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it labels Aug 25, 2023
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Aug 28, 2023
Merged via the queue into bevyengine:main with commit b28f633 Aug 28, 2023
22 checks passed
robtfm pushed a commit to robtfm/bevy that referenced this pull request Sep 1, 2023
# Objective

- Meshes with a higher number of joints than `MAX_JOINTS` are crashing
- Fixes partly bevyengine#9021 (doesn't crash anymore, but the mesh is not
correctly displayed)

## Solution

- Only take up to `MAX_JOINTS` joints when extending the buffer
vprime pushed a commit to vprime/bevy that referenced this pull request Sep 22, 2023
# Objective

- Meshes with a higher number of joints than `MAX_JOINTS` are crashing
- Fixes partly bevyengine#9021 (doesn't crash anymore, but the mesh is not
correctly displayed)

## Solution

- Only take up to `MAX_JOINTS` joints when extending the buffer

(cherry picked from commit b28f633)
rdrpenguin04 pushed a commit to rdrpenguin04/bevy that referenced this pull request Jan 9, 2024
# Objective

- Meshes with a higher number of joints than `MAX_JOINTS` are crashing
- Fixes partly bevyengine#9021 (doesn't crash anymore, but the mesh is not
correctly displayed)

## Solution

- Only take up to `MAX_JOINTS` joints when extending the buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Animation Make things move and change over time C-Bug An unexpected or incorrect behavior S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants