From 8db6e682e9c0d55a34c64a490cbf29ff301c4973 Mon Sep 17 00:00:00 2001 From: Benoit Bolsee Date: Mon, 4 Jun 2012 22:29:17 +0000 Subject: [PATCH] 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. --- intern/itasc/Armature.cpp | 7 +++++-- intern/itasc/Armature.hpp | 2 +- intern/itasc/FixedObject.cpp | 5 +++-- intern/itasc/FixedObject.hpp | 2 +- intern/itasc/MovingFrame.cpp | 3 ++- intern/itasc/MovingFrame.hpp | 2 +- intern/itasc/Object.hpp | 2 +- intern/itasc/Scene.cpp | 3 ++- 8 files changed, 16 insertions(+), 10 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; ifinalize(); + if (!object->finalize()) + return false; //Check if Object is controlled or uncontrolled. if(object->getType()==Object::Controlled){ int baseFrameIndex = base->addEndEffector(baseFrame);