I've almost finished my port to the cpp version of the runtime, but am having trouble with one remaining thing. I have a method that search the events of the current timeline and returns the time that event is fired. It also crashes to desktop when it attempts to get the events from the timeline object. Please let me know if I'm doing something wrong. Thanks!
Crash stack:
UE4Editor_TalonSpine!spine::Vector<spine::Event *>::Vector<spine::Event *>() [public\spine-cpp\include\spine\vector.h:52]
UE4Editor_TalonSpine!USpineTrackEntry::GetFirstFrameTimeForEvent() [\public\spineanimationcontroller.h:318]
Trimmed down version of my method:
float GetFirstFrameTimeForEvent(FString EventName)
{
if (entry && entry->getAnimation())
{
Vector<Timeline*> timelines = entry->getAnimation()->getTimelines();
if (timelines.size() > 0)
{
for (int i = 0; i < timelines.size(); i++)
{
EventTimeline* timeline = (EventTimeline*)timelines[i];
if (timeline != nullptr)
{
Vector<Event*> events = timeline->getEvents(); //causes crash
}
}
}
}
return(-1);
}