mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 18:13:05 +02:00
Only post the blender if we have blendable meshes to blend.
This commit is contained in:
parent
f8c14a5717
commit
0fc0d50bda
3 changed files with 14 additions and 1 deletions
|
@ -54,6 +54,15 @@ QStringList FBXGeometry::getJointNames() const {
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FBXGeometry::hasBlendedMeshes() const {
|
||||||
|
foreach (const FBXMesh& mesh, meshes) {
|
||||||
|
if (!mesh.blendshapes.isEmpty()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static int fbxGeometryMetaTypeId = qRegisterMetaType<FBXGeometry>();
|
static int fbxGeometryMetaTypeId = qRegisterMetaType<FBXGeometry>();
|
||||||
|
|
||||||
template<class T> QVariant readBinaryArray(QDataStream& in) {
|
template<class T> QVariant readBinaryArray(QDataStream& in) {
|
||||||
|
|
|
@ -181,6 +181,8 @@ public:
|
||||||
|
|
||||||
int getJointIndex(const QString& name) const { return jointIndices.value(name) - 1; }
|
int getJointIndex(const QString& name) const { return jointIndices.value(name) - 1; }
|
||||||
QStringList getJointNames() const;
|
QStringList getJointNames() const;
|
||||||
|
|
||||||
|
bool hasBlendedMeshes() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(FBXGeometry)
|
Q_DECLARE_METATYPE(FBXGeometry)
|
||||||
|
|
|
@ -610,7 +610,9 @@ void Model::simulate(float deltaTime, bool fullUpdate, const QVector<JointState>
|
||||||
}
|
}
|
||||||
|
|
||||||
// post the blender
|
// post the blender
|
||||||
|
if (geometry.hasBlendedMeshes()) {
|
||||||
QThreadPool::globalInstance()->start(new Blender(this, _geometry, geometry.meshes, _blendshapeCoefficients));
|
QThreadPool::globalInstance()->start(new Blender(this, _geometry, geometry.meshes, _blendshapeCoefficients));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Model::updateJointState(int index) {
|
void Model::updateJointState(int index) {
|
||||||
|
|
Loading…
Reference in a new issue