Fixed: #1469 Bug in parsing camera animations

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 13 years ago
parent bb1740cfae
commit 4973f33005

@ -78,7 +78,7 @@ bool CCameraAnimationManager::parseCameraAnimations(const IPrimitive* prim, cons
string value; string value;
// if the node is a camera animation parse it // if the node is a camera animation parse it
if (prim->getPropertyByName("class", value) && !nlstricmp(value.c_str(), "camera_animation_tree") ) if (prim->getPropertyByName("class", value) && !nlstricmp(value.c_str(), "camera_animation_tree"))
{ {
// We get the name of the mission // We get the name of the mission
prim->getPropertyByName("name", value); prim->getPropertyByName("name", value);
@ -115,5 +115,16 @@ bool CCameraAnimationManager::parseCameraAnimations(const IPrimitive* prim, cons
return true; return true;
} }
return false; else
{
// lookup recursively in the children
bool ok = true;
for (uint i = 0; i < prim->getNumChildren(); ++i)
{
const IPrimitive *child;
if (!prim->getChild(child,i) || !parseCameraAnimations(child, filename))
ok = false;
}
return ok;
}
} }
Loading…
Cancel
Save