mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 21:01:32 +02:00
Fixing warnings
This commit is contained in:
parent
5edb312346
commit
85b22be68b
3 changed files with 15 additions and 18 deletions
|
@ -1480,7 +1480,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
|
||||||
// of skinning information in FBX
|
// of skinning information in FBX
|
||||||
QString jointID = _connectionChildMap.value(clusterID);
|
QString jointID = _connectionChildMap.value(clusterID);
|
||||||
hfmCluster.jointIndex = modelIDs.indexOf(jointID);
|
hfmCluster.jointIndex = modelIDs.indexOf(jointID);
|
||||||
if (hfmCluster.jointIndex == -1) {
|
if (hfmCluster.jointIndex == HFMCluster::INVALID_JOINT_INDEX) {
|
||||||
qCDebug(modelformat) << "Joint not in model list: " << jointID;
|
qCDebug(modelformat) << "Joint not in model list: " << jointID;
|
||||||
hfmCluster.jointIndex = 0;
|
hfmCluster.jointIndex = 0;
|
||||||
}
|
}
|
||||||
|
@ -1514,7 +1514,7 @@ HFMModel* FBXSerializer::extractHFMModel(const hifi::VariantHash& mapping, const
|
||||||
{
|
{
|
||||||
HFMCluster cluster;
|
HFMCluster cluster;
|
||||||
cluster.jointIndex = modelIDs.indexOf(modelID);
|
cluster.jointIndex = modelIDs.indexOf(modelID);
|
||||||
if (cluster.jointIndex == -1) {
|
if (cluster.jointIndex == HFMCluster::INVALID_JOINT_INDEX) {
|
||||||
qCDebug(modelformat) << "Model not in model list: " << modelID;
|
qCDebug(modelformat) << "Model not in model list: " << modelID;
|
||||||
cluster.jointIndex = 0;
|
cluster.jointIndex = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
// Build joints
|
||||||
HFMJoint joint;
|
HFMJoint joint;
|
||||||
joint.distanceToParent = 0;
|
|
||||||
hfmModel.jointIndices["x"] = numNodes;
|
hfmModel.jointIndices["x"] = numNodes;
|
||||||
QVector<glm::mat4> globalTransforms;
|
QVector<glm::mat4> globalTransforms;
|
||||||
globalTransforms.resize(numNodes);
|
globalTransforms.resize(numNodes);
|
||||||
|
@ -1104,7 +1090,7 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
hfmModel.materials.emplace_back();
|
hfmModel.materials.emplace_back();
|
||||||
HFMMaterial& hfmMaterial = hfmModel.materials.back();
|
HFMMaterial& hfmMaterial = hfmModel.materials.back();
|
||||||
hfmMaterial._material = std::make_shared<graphics::Material>();
|
hfmMaterial._material = std::make_shared<graphics::Material>();
|
||||||
hfmMaterial.materialID = hfmMaterial.name;
|
hfmMaterial.materialID = matid;
|
||||||
setHFMMaterial(hfmMaterial, material);
|
setHFMMaterial(hfmMaterial, material);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1229,6 +1215,10 @@ bool GLTFSerializer::buildGeometry(HFMModel& hfmModel, const hifi::VariantHash&
|
||||||
success = addArrayFromAttribute(vertexAttribute, accessor, colors);
|
success = addArrayFromAttribute(vertexAttribute, accessor, colors);
|
||||||
weightStride = GLTFAccessorType::count((GLTFAccessorType::Value)accessor.type);
|
weightStride = GLTFAccessorType::count((GLTFAccessorType::Value)accessor.type);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
success = false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (!success) {
|
if (!success) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -2031,9 +2021,15 @@ bool GLTFSerializer::addArrayFromAttribute(GLTFVertexAttribute::Value vertexAttr
|
||||||
|
|
||||||
if (!addArrayFromAccessor(accessor, outarray)) {
|
if (!addArrayFromAccessor(accessor, outarray)) {
|
||||||
qWarning(modelformat) << "There was a problem reading glTF WEIGHTS_0 data for model " << _url;
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,8 @@ public:
|
||||||
/// A single binding to a joint.
|
/// A single binding to a joint.
|
||||||
class Cluster {
|
class Cluster {
|
||||||
public:
|
public:
|
||||||
uint32_t jointIndex;
|
static const uint32_t INVALID_JOINT_INDEX{ (uint32_t)-1 };
|
||||||
|
uint32_t jointIndex{ INVALID_JOINT_INDEX };
|
||||||
glm::mat4 inverseBindMatrix;
|
glm::mat4 inverseBindMatrix;
|
||||||
Transform inverseBindTransform;
|
Transform inverseBindTransform;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue