diff options
author | Benoit Bolsee <benoit.bolsee@online.be> | 2012-06-05 02:29:17 +0400 |
---|---|---|
committer | Benoit Bolsee <benoit.bolsee@online.be> | 2012-06-05 02:29:17 +0400 |
commit | 8db6e682e9c0d55a34c64a490cbf29ff301c4973 (patch) | |
tree | 306b1eb927d6768f88a149167c62d9724f8f6814 /intern/itasc/Armature.cpp | |
parent | 0d3b19e7340e0f3fa075e90e695ddf760529b925 (diff) |
Fix [#31544]: iTaSC assertion when creating armature with no joint. This degenerated case can be obtained by having a single bone in the IK chain and locking all 3 axis. This case was causing an assert in the KDL library. The bug is fixed by simply not creating the IK scene in this case.
Diffstat (limited to 'intern/itasc/Armature.cpp')
-rw-r--r-- | intern/itasc/Armature.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/itasc/Armature.cpp b/intern/itasc/Armature.cpp index 916b0bc7bf3..dd5c1921a98 100644 --- a/intern/itasc/Armature.cpp +++ b/intern/itasc/Armature.cpp @@ -369,11 +369,13 @@ int Armature::addEndEffector(const std::string& name) return m_neffector++; } -void Armature::finalize() +bool Armature::finalize() { unsigned int i, j, c; if (m_finalized) - return; + return true; + if (m_njoint == 0) + return false; initialize(m_njoint, m_noutput, m_neffector); for (i=c=0; i<m_nconstraint; i++) { JointConstraint_struct* pConstraint = m_constraints[i]; @@ -410,6 +412,7 @@ void Armature::finalize() if (m_armlength < KDL::epsilon) m_armlength = KDL::epsilon; m_finalized = true; + return true; } void Armature::pushCache(const Timestamp& timestamp) |