void gkBlenderSceneConverter::convertObjectAnimations(gkGameObject* gobj, Blender::Object* bobj, gkScalar animfps) { gkAnimationLoader anims(m_groupName); int version = m_file->_getInternalFile()->getVersion(); anims.convertObject(gobj, bobj, version <= 249, animfps); }
void AnimTable::CalculateDefinineAnims() { std::vector<const RigAnim*> anims(MaxAnimIndex()); for (int object = 0; object < NumObjects(); ++object) { const size_t num_anims = GatherObjectAnims(object, &anims[0]); CreateDefiningAnim(&anims[0], num_anims, &defining_anims_[object]); } }
void SpriteInstance::Load(const std::string& resName) { m_CurrentAnimation = 0; m_CurrentFrame = 0; m_AnimationCount = 0; m_FramesCount = 0; m_TotalFrames = 0; m_TotalTextures = 0; m_Frames->clear(); m_Animations->clear(); m_Atlases->clear(); { SpriteFramesListPtr frames(new SpriteFramesList()); SpriteAnimationsListPtr anims(new SpriteAnimationsList()); SpriteTexturesListPtr textures(new SpriteTexturesList()); if (!AssetsManager::getRef().GetMapping(resName, frames, anims, textures)) { APP_API_ASSERT("Error when loading mapping file." && FALSE); LogMessage(LOG_ERR, "Error when loading mapping file " << resName.c_str()); return; } //Silent copy *m_Frames = *frames; *m_Animations = *anims; *m_Atlases = *textures; } // Load textures const size_t atlasesSize = m_Atlases->size(); for (size_t i = 0; i < atlasesSize; ++i) { if (!m_Atlases->get(i).texture()) { std::string textureFile = MEDIA_PATH + m_Atlases->get(i).name; //PVR video::ITexture* texture = m_Driver->getTexture(textureFile.c_str()); APP_API_ASSERT(texture); m_Atlases->get(i).texture(texture); } } m_TotalTextures = m_Atlases->size(); m_TotalFrames = m_Frames->size(); m_AnimationCount = m_Animations->size(); if (m_CurrentAnimation < m_AnimationCount) { m_FramesCount = m_Animations->get(m_CurrentAnimation).frames.size(); } }