Skip to content

Commit

Permalink
Fix regression in FBX import caused by Skeleton3D
Browse files Browse the repository at this point in the history
A change in commit f7fdc87 changed the Skeleton3D "pose" property from PROPERTY_USAGE_EDITOR to PROPERTY_USAGE_NOEDITOR.
This should have had no effect, however it turns out assimp was assigning to the pose property.

This change adjusts the FBX import to only get_bone_rest/set_bone_rest, not set_bone_pose.
  • Loading branch information
lyuma committed Oct 15, 2020
1 parent 5e4a8ab commit 0345324
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions modules/assimp/editor_scene_importer_assimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,6 @@ EditorSceneImporterAssimp::_generate_scene(const String &p_path, aiScene *scene,
Transform pform = AssimpUtils::assimp_matrix_transform(bone->mNode->mTransformation);
skeleton->add_bone(bone_name);
skeleton->set_bone_rest(boneIdx, pform);
skeleton->set_bone_pose(boneIdx, pform);

if (parent_node != NULL) {
int parent_bone_id = skeleton->find_bone(AssimpUtils::get_anim_string_from_assimp(parent_node->mName));
Expand Down Expand Up @@ -626,7 +625,7 @@ void EditorSceneImporterAssimp::_insert_animation_track(ImportState &scene, cons
xform.basis.set_quat_scale(rot, scale);
xform.origin = pos;

xform = skeleton->get_bone_pose(skeleton_bone).inverse() * xform;
xform = skeleton->get_bone_rest(skeleton_bone).inverse() * xform;

rot = xform.basis.get_rotation_quat();
rot.normalize();
Expand Down

0 comments on commit 0345324

Please sign in to comment.