[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54972] trunk/blender/source/gameengine/ Converter/BL_BlenderDataConversion.cpp: BGE: Fix for bugs #34428, #20856, #20281.
Mitchell Stokes
mogurijin at gmail.com
Sat Mar 2 19:05:53 CET 2013
Revision: 54972
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54972
Author: moguri
Date: 2013-03-02 18:05:52 +0000 (Sat, 02 Mar 2013)
Log Message:
-----------
BGE: Fix for bugs #34428, #20856, #20281. These were all multi-uv bugs caused by the BGE keeping too much uv information. When setting up shaders the BGE assumes each UV layer is unique, but the converter would store duplicates.
Modified Paths:
--------------
trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
Modified: trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp 2013-03-02 16:13:01 UTC (rev 54971)
+++ trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp 2013-03-02 18:05:52 UTC (rev 54972)
@@ -35,6 +35,8 @@
#endif
#include <math.h>
+#include <vector>
+#include <algorithm>
#include "BL_BlenderDataConversion.h"
#include "KX_BlenderGL.h"
@@ -506,12 +508,17 @@
uvs[0][0] = uvs[1][0] = uvs[2][0] = uvs[3][0] = MT_Point2(0.f, 0.f);
}
+ vector<STR_String> found_layers;
+
for (int vind = 0; vind<MAXTEX; vind++)
{
BL_Mapping &map = material->mapping[vind];
if (!(map.mapping & USEUV)) continue;
+ if (std::find(found_layers.begin(), found_layers.end(), map.uvCoName) != found_layers.end())
+ continue;
+
//If no UVSet is specified, try grabbing one from the UV/Image editor
if (map.uvCoName.IsEmpty() && tface)
{
@@ -544,6 +551,7 @@
uvs[3][unit].setValue(0.0f, 0.0f);
++unit;
+ found_layers.push_back(map.uvCoName);
break;
}
}
More information about the Bf-blender-cvs
mailing list