correctly resizing blendshapes vector

This commit is contained in:
kunalgosar 2017-04-14 15:15:08 -07:00
parent d215856b23
commit 06c5fa0585
2 changed files with 4 additions and 2 deletions

View file

@ -15,6 +15,7 @@
#include <QtCore/QJsonObject>
#include <QtCore/QJsonArray>
#include <QVector>
#include <FaceshiftConstants.h>
#include <GLMHelpers.h>
@ -39,7 +40,7 @@ HeadData::HeadData(AvatarData* owningAvatar) :
_averageLoudness(0.0f),
_browAudioLift(0.0f),
_owningAvatar(owningAvatar),
_baseBlendshapeCoefficients(0, 0)
_baseBlendshapeCoefficients(QVector<float>(0, 0))
{
}
@ -102,6 +103,8 @@ void HeadData::setBlendshape(QString name, float val) {
if (it != blendshapeLookupMap.end()) {
if (_blendshapeCoefficients.size() <= it.value()) {
_blendshapeCoefficients.resize(it.value() + 1);
}
if (_baseBlendshapeCoefficients.size() <= it.value()) {
_baseBlendshapeCoefficients.resize(it.value() + 1);
}
_baseBlendshapeCoefficients[it.value()] = val;

View file

@ -901,7 +901,6 @@ Blender::Blender(ModelPointer model, int blendNumber, const Geometry::WeakPointe
}
void Blender::run() {
qDebug() << "!!!!!!!!!!!!!!" << _blendshapeCoefficients;
PROFILE_RANGE_EX(simulation_animation, __FUNCTION__, 0xFFFF0000, 0, { { "url", _model->getURL().toString() } });
QVector<glm::vec3> vertices, normals;
if (_model) {