Skip to content

Commit

Permalink
Merge pull request #54512 from pycbouh/meshtool-fix-bones-crash-3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
akien-mga authored Nov 2, 2021
2 parents 4b7d1ae + ec15227 commit a05aefb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scene/resources/mesh_data_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ Vector<int> MeshDataTool::get_vertex_bones(int p_idx) const {
}
void MeshDataTool::set_vertex_bones(int p_idx, const Vector<int> &p_bones) {
ERR_FAIL_INDEX(p_idx, vertices.size());
ERR_FAIL_COND(p_bones.size() != 4);
vertices.write[p_idx].bones = p_bones;
format |= Mesh::ARRAY_FORMAT_BONES;
}
Expand All @@ -422,6 +423,7 @@ Vector<float> MeshDataTool::get_vertex_weights(int p_idx) const {
}
void MeshDataTool::set_vertex_weights(int p_idx, const Vector<float> &p_weights) {
ERR_FAIL_INDEX(p_idx, vertices.size());
ERR_FAIL_COND(p_weights.size() != 4);
vertices.write[p_idx].weights = p_weights;
format |= Mesh::ARRAY_FORMAT_WEIGHTS;
}
Expand Down

0 comments on commit a05aefb

Please sign in to comment.