Browse Source

FBX: closes https://github.com/assimp/assimp/issues/1619: return correct index for embedded textures.

Kim Kulling 7 năm trước cách đây
mục cha
commit
0588d6cccf
1 tập tin đã thay đổi với 2 bổ sung3 xóa
  1. 2 3
      code/FBXConverter.cpp

+ 2 - 3
code/FBXConverter.cpp

@@ -440,12 +440,11 @@ private:
 	bool FindTextureIndexByFilename(const Video& video, unsigned int& index) {
 		index = 0;
 		const char* videoFileName = video.FileName().c_str();
-		for (auto texture = textures_converted.begin(); texture != textures_converted.end(); ++texture)
-		{
+		for (auto texture = textures_converted.begin(); texture != textures_converted.end(); ++texture) {
 			if (!strcmp(texture->first->FileName().c_str(), videoFileName)) {
+                index = texture->second;
 				return true;
 			}
-			index++;
 		}
 		return false;
 	}