mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 03:04:33 +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;
|
||||
}
|
||||
|
||||
bool FBXGeometry::hasBlendedMeshes() const {
|
||||
foreach (const FBXMesh& mesh, meshes) {
|
||||
if (!mesh.blendshapes.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static int fbxGeometryMetaTypeId = qRegisterMetaType<FBXGeometry>();
|
||||
|
||||
template<class T> QVariant readBinaryArray(QDataStream& in) {
|
||||
|
|
|
@ -181,6 +181,8 @@ public:
|
|||
|
||||
int getJointIndex(const QString& name) const { return jointIndices.value(name) - 1; }
|
||||
QStringList getJointNames() const;
|
||||
|
||||
bool hasBlendedMeshes() const;
|
||||
};
|
||||
|
||||
Q_DECLARE_METATYPE(FBXGeometry)
|
||||
|
|
|
@ -610,7 +610,9 @@ void Model::simulate(float deltaTime, bool fullUpdate, const QVector<JointState>
|
|||
}
|
||||
|
||||
// post the blender
|
||||
QThreadPool::globalInstance()->start(new Blender(this, _geometry, geometry.meshes, _blendshapeCoefficients));
|
||||
if (geometry.hasBlendedMeshes()) {
|
||||
QThreadPool::globalInstance()->start(new Blender(this, _geometry, geometry.meshes, _blendshapeCoefficients));
|
||||
}
|
||||
}
|
||||
|
||||
void Model::updateJointState(int index) {
|
||||
|
|
Loading…
Reference in a new issue