Fixing warnings

This commit is contained in:
Brad Davis 2019-09-23 16:42:34 -07:00
parent 5edb312346
commit 85b22be68b
3 changed files with 15 additions and 18 deletions

View file

@ -1480,7 +1480,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
// of skinning information in FBX
QString jointID = _connectionChildMap.value(clusterID);
hfmCluster.jointIndex = modelIDs.indexOf(jointID);
if (hfmCluster.jointIndex == -1) {
if (hfmCluster.jointIndex == HFMCluster::INVALID_JOINT_INDEX) {
qCDebug(modelformat) << "Joint not in model list: " << jointID;
hfmCluster.jointIndex = 0;
}
@ -1514,7 +1514,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
{
HFMCluster cluster;
cluster.jointIndex = modelIDs.indexOf(modelID);
if (cluster.jointIndex == -1) {
if (cluster.jointIndex == HFMCluster::INVALID_JOINT_INDEX) {
qCDebug(modelformat) << "Model not in model list: " << modelID;
cluster.jointIndex = 0;
}

View file

@ -1002,22 +1002,8 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
}
// Build transforms
for (int nodeIndex = 0; nodeIndex < numNodes; ++nodeIndex) {
auto& gltfNode = _file.nodes[nodeIndex];
//gltfNode.transforms.push_back(getModelTransform(gltfNode));
gltf::ParentIndexMap::const_iterator parentItr;
int curNode = nodeIndex;
while (parentsEnd != (parentItr = parentIndices.find(curNode))) {
curNode = parentItr->second;
auto& ancestorNode = _file.nodes[curNode];
//gltfNode.transforms.push_back(getModelTransform(ancestorNode));
}
}
// Build joints
HFMJoint joint;
joint.distanceToParent = 0;
hfmModel.jointIndices["x"] = numNodes;
QVector<glm::mat4> globalTransforms;
globalTransforms.resize(numNodes);
@ -1104,7 +1090,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
hfmModel.materials.emplace_back();
HFMMaterial& hfmMaterial = hfmModel.materials.back();
hfmMaterial._material = std::make_shared<graphics::Material>();
hfmMaterial.materialID = hfmMaterial.name;
hfmMaterial.materialID = matid;
setHFMMaterial(hfmMaterial, material);
}
@ -1229,6 +1215,10 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
success = addArrayFromAttribute(vertexAttribute, accessor, colors);
weightStride = GLTFAccessorType::count((GLTFAccessorType::Value)accessor.type);
break;
default:
success = false;
break;
}
if (!success) {
continue;
@ -2031,9 +2021,15 @@ bool GLTFSerializer::addArrayFromAttribute(GLTFVertexAttribute::Value vertexAttr
if (!addArrayFromAccessor(accessor, outarray)) {
qWarning(modelformat) << "There was a problem reading glTF WEIGHTS_0 data for model " << _url;
return false;
}
default:
qWarning(modelformat) << "Unexpected attribute type" << _url;
return false;
}
return true;
}

View file

@ -122,7 +122,8 @@ public:
/// A single binding to a joint.
class Cluster {
public:
uint32_t jointIndex;
static const uint32_t INVALID_JOINT_INDEX{ (uint32_t)-1 };
uint32_t jointIndex{ INVALID_JOINT_INDEX };
glm::mat4 inverseBindMatrix;
Transform inverseBindTransform;
};