Fix 3DS instances loading, fixes #151
This commit is contained in:
@@ -659,14 +659,22 @@ void Discreet3DSImporter::ParseHierarchyChunk(uint16_t parent)
|
||||
// Now find out whether we have this node already (target animation channels
|
||||
// are stored with a separate object ID)
|
||||
D3DS::Node* pcNode = FindNode(mRootNode,name);
|
||||
if (pcNode)
|
||||
int instanceNumber = 1;
|
||||
|
||||
if ( pcNode)
|
||||
{
|
||||
// Make this node the current node
|
||||
mCurrentNode = pcNode;
|
||||
break;
|
||||
// if the source is not a CHUNK_TRACKINFO block it wont be an object instance
|
||||
if (parent != Discreet3DS::CHUNK_TRACKINFO)
|
||||
{
|
||||
mCurrentNode = pcNode;
|
||||
break;
|
||||
}
|
||||
pcNode->mInstanceCount++;
|
||||
instanceNumber = pcNode->mInstanceCount;
|
||||
}
|
||||
pcNode = new D3DS::Node();
|
||||
pcNode->mName = name;
|
||||
pcNode->mInstanceNumber = instanceNumber;
|
||||
|
||||
// There are two unknown values which we can safely ignore
|
||||
stream->IncPtr(4);
|
||||
|
||||
Reference in New Issue
Block a user