| 2144 | } |
| 2145 | |
| 2146 | void Tr2GrannyAnimation::AddAnimationLayerWithTrackMask( const char* layerName, const char* trackMask ) |
| 2147 | { |
| 2148 | if( GetAnimationLayer( layerName ) ) |
| 2149 | { |
| 2150 | GetAnimationLayer( layerName )->ExtractTrackMask( this, trackMask ); |
| 2151 | return; |
| 2152 | } |
| 2153 | |
| 2154 | Tr2GrannyAnimationLayer layer; |
| 2155 | layer.m_name = layerName; |
| 2156 | layer.ExtractTrackMask( this, trackMask ); |
| 2157 | m_animationLayers[layerName] = std::move( layer ); |
| 2158 | |
| 2159 | if( !IsInitialized() ) |
| 2160 | { |
| 2161 | return; |
| 2162 | } |
| 2163 | |
| 2164 | if( IsUsingCMF() ) |
| 2165 | { |
| 2166 | if( !m_tmpPose.skeleton ) |
| 2167 | { |
| 2168 | auto& skeleton = GetCMFData()->skeletons[m_modelIndex]; |
| 2169 | cmf::RestPose( m_tmpPose, skeleton ); |
| 2170 | } |
| 2171 | } |
| 2172 | #if WITH_GRANNY |
| 2173 | if( !IsUsingCMF() ) |
| 2174 | { |
| 2175 | if( !m_compositePose ) |
| 2176 | { |
| 2177 | m_compositePose = GrannyNewLocalPose( m_skeleton->BoneCount ); |
| 2178 | } |
| 2179 | } |
| 2180 | |
| 2181 | #endif |
| 2182 | GetAnimationLayer( layerName )->InitializeAnimationLayer( this ); |
| 2183 | |
| 2184 | return; |
| 2185 | } |
| 2186 | |
| 2187 | void Tr2GrannyAnimation::AddAnimationLayerBone( const char* layerName, const char* boneName ) |
| 2188 | { |
no test coverage detected