Discard ThreeDAnimation with no IPO
This commit is contained in:
parent
359c468604
commit
3725013135
@ -41,9 +41,10 @@ AnimationBase::AnimationBase(const XMLNode &node)
|
|||||||
m_playing = true;
|
m_playing = true;
|
||||||
m_anim_type = ATT_CYCLIC;
|
m_anim_type = ATT_CYCLIC;
|
||||||
|
|
||||||
if (m_all_ipos.size() == 0) // this will happen for some separate but non-animated objects
|
if (m_all_ipos.size() == 0)
|
||||||
{
|
{
|
||||||
m_playing = false;
|
// Throw to avoid construction completely
|
||||||
|
throw std::runtime_error("Empty IPO, discard.");
|
||||||
}
|
}
|
||||||
reset();
|
reset();
|
||||||
calculateAnimationDuration();
|
calculateAnimationDuration();
|
||||||
|
@ -370,9 +370,16 @@ void TrackObject::init(const XMLNode &xml_node, scene::ISceneNode* parent,
|
|||||||
|
|
||||||
|
|
||||||
if (type == "animation" || xml_node.hasChildNamed("curve"))
|
if (type == "animation" || xml_node.hasChildNamed("curve"))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
m_animator = new ThreeDAnimation(xml_node, this);
|
m_animator = new ThreeDAnimation(xml_node, this);
|
||||||
}
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
Log::debug("TrackObject", e.what());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user