Style tweaks.
This commit is contained in:
parent
fada9e45ee
commit
e2e0d741a2
|
@ -612,14 +612,12 @@ static void ReadMesh(RawModel &raw, FbxScene *pScene, FbxNode *pNode, const std:
|
|||
|
||||
// Associate the node to this surface
|
||||
int nodeId = raw.GetNodeByName(pNode->GetName());
|
||||
if (nodeId >= 0)
|
||||
{
|
||||
if (nodeId >= 0) {
|
||||
RawNode &node = raw.GetNode(nodeId);
|
||||
node.surfaceId = surfaceId;
|
||||
}
|
||||
|
||||
if (raw.GetSurfaceById(surfaceId) >= 0)
|
||||
{
|
||||
if (raw.GetSurfaceById(surfaceId) >= 0) {
|
||||
// This surface is already loaded
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -475,20 +475,18 @@ ModelData *Raw2Gltf(
|
|||
|
||||
assert(surfaceModel.GetSurfaceCount() == 1);
|
||||
const RawSurface &rawSurface = surfaceModel.GetSurface(0);
|
||||
const int surfaceId = rawSurface.id;
|
||||
|
||||
const RawMaterial &rawMaterial = surfaceModel.GetMaterial(surfaceModel.GetTriangle(0).materialIndex);
|
||||
const MaterialData &mData = require(materialsByName, materialHash(rawMaterial));
|
||||
|
||||
int surfaceId = rawSurface.id;
|
||||
//NodeData &meshNode = require(nodesByName, nodeName);
|
||||
|
||||
MeshData *mesh = nullptr;
|
||||
auto meshIter = meshBySurfaceId.find(surfaceId);
|
||||
if (meshIter != meshBySurfaceId.end()) {
|
||||
mesh = meshIter->second.get();
|
||||
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
std::vector<float> defaultDeforms;
|
||||
for (const auto &channel : rawSurface.blendChannels) {
|
||||
defaultDeforms.push_back(channel.defaultDeform);
|
||||
|
@ -517,8 +515,7 @@ ModelData *Raw2Gltf(
|
|||
AccessorData &indexes = *gltf->accessors.hold(new AccessorData(GLT_USHORT));
|
||||
indexes.count = 3 * triangleCount;
|
||||
primitive.reset(new PrimitiveData(indexes, mData, dracoMesh));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const AccessorData &indexes = *gltf->AddAccessorWithView(
|
||||
*gltf->GetAlignedBufferView(buffer, BufferViewData::GL_ELEMENT_ARRAY_BUFFER),
|
||||
GLT_USHORT, getIndexArray(surfaceModel));
|
||||
|
|
|
@ -549,4 +549,3 @@ int RawModel::GetSurfaceById(const long surfaceId) const
|
|||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue