- fbx: better size estimate for keyframe buffer.
parent
382f4619ad
commit
ae3007b42b
|
@ -73,7 +73,7 @@ public:
|
|||
, doc(doc)
|
||||
{
|
||||
ConvertRootNode();
|
||||
//ConvertAnimations();
|
||||
ConvertAnimations();
|
||||
|
||||
if(doc.Settings().readAllMaterials) {
|
||||
// unfortunately this means we have to evaluate all objects
|
||||
|
@ -1040,9 +1040,18 @@ private:
|
|||
// ------------------------------------------------------------------------------------------------
|
||||
std::vector<float> GetKeyTimeList(const KeyFrameListList& inputs)
|
||||
{
|
||||
// XXX reserve some space upfront
|
||||
// reserve some space upfront - it is likely that the keyframe lists
|
||||
// have matching time values, so max(of all keyframe lists) should
|
||||
// be a good estimate.
|
||||
std::vector<float> keys;
|
||||
|
||||
size_t estimate = 0;
|
||||
BOOST_FOREACH(const KeyFrameList& kfl, inputs) {
|
||||
estimate = std::max(estimate, kfl.get<0>()->size());
|
||||
}
|
||||
|
||||
keys.reserve(estimate);
|
||||
|
||||
std::vector<unsigned int> next_pos;
|
||||
next_pos.resize(inputs.size(),0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue