From 89a4ea6470a433d6ab7b2cf71888fca1cd0469ed Mon Sep 17 00:00:00 2001 From: ZappoMan Date: Tue, 8 Oct 2013 09:56:47 -0700 Subject: [PATCH 1/2] two possible crash fixes --- interface/src/VoxelSystem.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/interface/src/VoxelSystem.cpp b/interface/src/VoxelSystem.cpp index 24ca83b8a3..c8791000c6 100644 --- a/interface/src/VoxelSystem.cpp +++ b/interface/src/VoxelSystem.cpp @@ -908,6 +908,10 @@ int VoxelSystem::updateNodeInArraysAsFullVBO(VoxelNode* node) { // will forcibly remove it from the VBOs because we know better!!! int VoxelSystem::forceRemoveNodeFromArraysAsPartialVBO(VoxelNode* node) { + if (!_initialized) { + return 0; + } + // if the node is not in the VBOs then we have nothing to do! if (node->isKnownBufferIndex()) { @@ -937,6 +941,10 @@ int VoxelSystem::updateNodeInArraysAsPartialVBO(VoxelNode* node) { if (_voxelsInWriteArrays >= _maxVoxels) { return 0; } + + if (!_initialized) { + return 0; + } // Now, if we've changed any attributes (our renderness, our color, etc) then update the Arrays... if (node->isDirty()) { From e3436eed91e451a8b045e9c874960d897687b91d Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Tue, 8 Oct 2013 11:18:12 -0700 Subject: [PATCH 2/2] Fixes for eyes rolling back in head, macaw head without mapping file. --- interface/src/avatar/BlendFace.cpp | 2 +- interface/src/renderer/FBXReader.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/interface/src/avatar/BlendFace.cpp b/interface/src/avatar/BlendFace.cpp index d376c976eb..146e5062d5 100644 --- a/interface/src/avatar/BlendFace.cpp +++ b/interface/src/avatar/BlendFace.cpp @@ -104,7 +104,7 @@ bool BlendFace::render(float alpha) { if (mesh.isEye) { glTranslatef(mesh.pivot.x, mesh.pivot.y, mesh.pivot.z); glm::quat rotation = glm::inverse(orientation) * _owningHead->getEyeRotation(orientation * - (mesh.pivot * scale + MODEL_TRANSLATION) + _owningHead->getPosition()); + ((mesh.pivot + offset) * scale) + _owningHead->getPosition()); glm::vec3 rotationAxis = glm::axis(rotation); glRotatef(glm::angle(rotation), -rotationAxis.x, rotationAxis.y, -rotationAxis.z); glTranslatef(-mesh.pivot.x, -mesh.pivot.y, -mesh.pivot.z); diff --git a/interface/src/renderer/FBXReader.cpp b/interface/src/renderer/FBXReader.cpp index afacc86204..c8647459d7 100644 --- a/interface/src/renderer/FBXReader.cpp +++ b/interface/src/renderer/FBXReader.cpp @@ -383,7 +383,6 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping) QList mappings = blendshapeMappings.values(blendshapeName); if (mappings.isEmpty()) { blendshapeIndices.insert(blendshapeName, QPair(i, 1.0f)); - blendshapeIndices.insert("ExpressionBlendshapes." + blendshapeName, QPair(i, 1.0f)); } else { foreach (const QVariant& mapping, mappings) { QVariantList blendshapeMapping = mapping.toList(); @@ -636,8 +635,13 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping) } } else if (object.properties.at(2) == "BlendShapeChannel") { QByteArray name = object.properties.at(1).toByteArray(); + name = name.left(name.indexOf('\0')); + if (!blendshapeIndices.contains(name)) { + // try everything after the dot + name = name.mid(name.lastIndexOf('.') + 1); + } blendshapeChannelIndices.insert(object.properties.at(0).value(), - blendshapeIndices.value(name.left(name.indexOf('\0')))); + blendshapeIndices.value(name)); } } }