Helper function to clean up / delete RigAnimation data
| 76 | |
| 77 | // Helper function to clean up / delete RigAnimation data |
| 78 | static void DeleteRigAnimation(dmRigDDF::RigAnimation& anim) |
| 79 | { |
| 80 | for (uint32_t t = 0; t < anim.m_Tracks.m_Count; ++t) { |
| 81 | dmRigDDF::AnimationTrack& anim_track = anim.m_Tracks.m_Data[t]; |
| 82 | |
| 83 | if (anim_track.m_Positions.m_Count) { |
| 84 | delete [] anim_track.m_Positions.m_Data; |
| 85 | } |
| 86 | if (anim_track.m_Rotations.m_Count) { |
| 87 | delete [] anim_track.m_Rotations.m_Data; |
| 88 | } |
| 89 | if (anim_track.m_Scale.m_Count) { |
| 90 | delete [] anim_track.m_Scale.m_Data; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | if (anim.m_Tracks.m_Count) { |
| 95 | delete [] anim.m_Tracks.m_Data; |
| 96 | } |
| 97 | |
| 98 | for (uint32_t m = 0; m < anim.m_MorphWeightTracks.m_Count; ++m) |
| 99 | { |
| 100 | dmRigDDF::MorphWeightTrack& mwt = anim.m_MorphWeightTracks.m_Data[m]; |
| 101 | if (mwt.m_Weights.m_Count) |
| 102 | delete[] mwt.m_Weights.m_Data; |
| 103 | } |
| 104 | if (anim.m_MorphWeightTracks.m_Count) |
| 105 | delete[] anim.m_MorphWeightTracks.m_Data; |
| 106 | } |
| 107 | |
| 108 | // Helper function to clean up / delete MeshSet, Skeleton and AnimationSet data |
| 109 | static void DeleteRigData(dmRigDDF::MeshSet* mesh_set, dmRigDDF::Skeleton* skeleton, dmRigDDF::AnimationSet* animation_set) |