Skip to content

Commit

Permalink
When calling simplify(), always include the root joint.
Browse files Browse the repository at this point in the history
Summary: Because we don't pass any arguments to simplify() and it just calls parametersToJoints, we need it to do the right thing and include the root joint regardless of whether it's being driven.  Otherwise the simplifySkeleton call fails and this is not an expected result.  Note that this wasn't a problem before because we always had parameters driving the root but it's no longer the case for Tinity v4 and above since all transform parameters have been moved to b_root.

Reviewed By: jeongseok-meta

Differential Revision: D68297713

fbshipit-source-id: 18a80cab0d1b63012fb786066c85aaefa931532b
  • Loading branch information
cdtwigg authored and facebook-github-bot committed Jan 17, 2025
1 parent 85b450d commit ca781a5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion momentum/character/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,16 @@ CharacterT<T> CharacterT<T>::simplifyParameterTransform(const ParameterSet& para

template <typename T>
CharacterT<T> CharacterT<T>::simplify(const ParameterSet& activeParams) const {
return simplifySkeleton(parametersToActiveJoints(activeParams));
auto activeJoints = parametersToActiveJoints(activeParams);
// always keep the root joint to ensure valid simplification.
// This is needed because while previously we generally parametrized the root joint with
// the root transform, modern skeletons sometimes have a body_world above b_root that is
// not parametrized, but if we throw it out we end up with an invalid character.
if (!activeJoints.empty()) {
activeJoints[0] = true;
}

return simplifySkeleton(activeJoints);
}

template <typename T>
Expand Down

0 comments on commit ca781a5

Please sign in to comment.