Skip to content

Commit

Permalink
inheritRotation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouhang95 committed Sep 6, 2024
1 parent 4045c42 commit e3d5590
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions projects/FBX/FBXSDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2883,6 +2883,16 @@ struct PrimDeformByOneBone : INode {
glm::mat4 transform(1);
if (nameMapping.count(boneName)) {
auto mat = boneMatrix[nameMapping[boneName]];
if (get_input2<bool>("inheritRotation")) {
mat[0] = glm::normalize(mat[0]);
mat[1] = glm::normalize(mat[1]);
mat[2] = glm::normalize(mat[2]);
}
else {
mat[0] = {1, 0, 0, 0};
mat[1] = {0, 1, 0, 0};
mat[2] = {0, 0, 1, 0};
}
transform = mat * matTrans * matRotate;
auto vert_count = prim->verts.size();
#pragma omp parallel for
Expand All @@ -2906,6 +2916,7 @@ ZENDEFNODE(PrimDeformByOneBone, {
"skeleton",
{"string", "boneName", ""},
{"bool", "useCustomPivot", "0"},
{"bool", "inheritRotation", "0"},
{"vec3f", "pivot", "0, 0, 0"},
{"vec3f", "rotation", "0, 0, 0"},
},
Expand Down

0 comments on commit e3d5590

Please sign in to comment.