mirror of
https://github.com/lubosz/overte.git
synced 2025-04-24 21:23:18 +02:00
Merge pull request #1027 from ey6es/master
Fixes for eyes rolling back in head, macaw head without mapping file.
This commit is contained in:
commit
4c2ccd92ef
2 changed files with 7 additions and 3 deletions
|
@ -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);
|
||||
|
|
|
@ -383,7 +383,6 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
|
|||
QList<QVariant> mappings = blendshapeMappings.values(blendshapeName);
|
||||
if (mappings.isEmpty()) {
|
||||
blendshapeIndices.insert(blendshapeName, QPair<int, float>(i, 1.0f));
|
||||
blendshapeIndices.insert("ExpressionBlendshapes." + blendshapeName, QPair<int, float>(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<qint64>(),
|
||||
blendshapeIndices.value(name.left(name.indexOf('\0'))));
|
||||
blendshapeIndices.value(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue