Skip to content

Commit

Permalink
VOXELFORMAT: VXL: pick nodes by id if the names in the vxl and hva do…
Browse files Browse the repository at this point in the history
…n't match

see issue #537
  • Loading branch information
mgerhardy committed Jan 13, 2025
1 parent beb36ee commit f433f44
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/voxelformat/private/commandconquer/HVAFormat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ bool HVAFormat::readHVAFrames(io::SeekableReadStream &stream, const vxl::VXLMode
for (uint32_t j = 0; j < mdl.header.layerCount; ++j) {
Log::debug(" - found: %s", mdl.layerHeaders[j].name);
}
file.header.layerIds[i] = i;
}
}

Expand Down Expand Up @@ -90,8 +91,12 @@ bool HVAFormat::loadHVA(const core::String &filename, const io::ArchivePtr &arch
for (uint32_t keyFrameIdx = 0; keyFrameIdx < file.header.numFrames; ++keyFrameIdx) {
const vxl::HVAFrames &sectionMatrices = file.frames[keyFrameIdx];
for (uint32_t vxlNodeId = 0; vxlNodeId < file.header.numLayers; ++vxlNodeId) {
const core::String &name = file.header.nodeNames[vxlNodeId];
core::String name = file.header.nodeNames[vxlNodeId];
scenegraph::SceneGraphNode *node = sceneGraph.findNodeByName(name);
if (node == nullptr) {
name = mdl.layerHeaders[vxlNodeId].name;
node = sceneGraph.findNodeByName(name);
}
if (node == nullptr) {
Log::warn("Can't find node with name '%s' for vxl node %u", name.c_str(), vxlNodeId);
continue;
Expand Down

0 comments on commit f433f44

Please sign in to comment.