History

Lock geometry on blender

Zach Pomerantz committed 10 years ago

Commit 34026351 parent aa038ba1 file · +9 −6Browse files

Showing the changes to libraries/render-utils/src/Model.cpp (1 of 1 file). Show all

Unified · Split

libraries/render-utils/src/Model.cpp+9−6
@@ -1071,18 +1071,21 @@ float Model::getLimbLength(int jointIndex) const { · 1070 unmodified lines
10711071 }
10721072
10731073 bool Model::maybeStartBlender() {
1074− const FBXGeometry& fbxGeometry = getFBXGeometry();
1075− if (fbxGeometry.hasBlendedMeshes()) {
1076− QThreadPool::globalInstance()->start(new Blender(getThisPointer(), ++_blendNumber, _geometry,
1077− fbxGeometry.meshes, _blendshapeCoefficients));
1078− return true;
1074+ if (isLoaded()) {
1075+ const FBXGeometry& fbxGeometry = getFBXGeometry();
1076+ if (fbxGeometry.hasBlendedMeshes()) {
1077+ QThreadPool::globalInstance()->start(new Blender(getThisPointer(), ++_blendNumber, _geometry,
1078+ fbxGeometry.meshes, _blendshapeCoefficients));
1079+ return true;
1080+ }
10791081 }
10801082 return false;
10811083 }
10821084
10831085 void Model::setBlendedVertices(int blendNumber, const std::weak_ptr<NetworkGeometry>& geometry,
10841086 const QVector<glm::vec3>& vertices, const QVector<glm::vec3>& normals) {
1085− if (_geometry != geometry.lock() || _blendedVertexBuffers.empty() || blendNumber < _appliedBlendNumber) {
1087+ auto geometryRef = geometry.lock();
1088+ if (!geometryRef || _geometry != geometryRef || _blendedVertexBuffers.empty() || blendNumber < _appliedBlendNumber) {
10861089 return;
10871090 }
10881091 _appliedBlendNumber = blendNumber;