Skip to content

Commit

Permalink
Merge pull request #34029 from nekomatata/create-physical-skeleton-error
Browse files Browse the repository at this point in the history
Fixed error when creating physical skeleton
  • Loading branch information
akien-mga authored Nov 30, 2019
2 parents ea8a30a + f0fdd7d commit 2e76c7c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion editor/plugins/skeleton_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ void SkeletonEditor::create_physical_skeleton() {
for (int bone_id = 0; bc > bone_id; ++bone_id) {

const int parent = skeleton->get_bone_parent(bone_id);
const int parent_parent = skeleton->get_bone_parent(parent);

if (parent < 0) {

bones_infos.write[bone_id].relative_rest = skeleton->get_bone_rest(bone_id);

} else {

const int parent_parent = skeleton->get_bone_parent(parent);

bones_infos.write[bone_id].relative_rest = bones_infos[parent].relative_rest * skeleton->get_bone_rest(bone_id);

/// create physical bone on parent
Expand Down

0 comments on commit 2e76c7c

Please sign in to comment.