FIX: multiple LWO layers referencing a single texture won't anymore cause all layers except the first to have no proper uv coordinates.
git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@389 67173fc5-114c-0410-ac8e-9d2fd5bffc1fpull/1/head
parent
acdbf77c6e
commit
00729f83f7
|
@ -375,29 +375,30 @@ void LWOImporter::ConvertMaterial(const LWO::Surface& surf,MaterialHelper* pcMat
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
void LWOImporter::FindUVChannels(LWO::TextureList& list, LWO::Layer& layer,
|
void LWOImporter::FindUVChannels(LWO::TextureList& list, LWO::Layer& layer,
|
||||||
unsigned int out[AI_MAX_NUMBER_OF_TEXTURECOORDS], unsigned int& next)
|
unsigned int out[AI_MAX_NUMBER_OF_TEXTURECOORDS],
|
||||||
{
|
unsigned int& next)
|
||||||
for (TextureList::iterator it = list.begin(), end = list.end();
|
|
||||||
it != end;++it)
|
|
||||||
{
|
{
|
||||||
|
for (TextureList::iterator it = list.begin(), end = list.end();it != end;++it) {
|
||||||
|
|
||||||
// Ignore textures with non-UV mappings for the moment.
|
// Ignore textures with non-UV mappings for the moment.
|
||||||
if (!(*it).enabled || !(*it).bCanUse || 0xffffffff != (*it).mRealUVIndex || (*it).mapMode != LWO::Texture::UV) {
|
if (!(*it).enabled || !(*it).bCanUse || (*it).mapMode != LWO::Texture::UV) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
for (unsigned int i = 0; i < layer.mUVChannels.size();++i)
|
for (unsigned int i = 0; i < layer.mUVChannels.size();++i) {
|
||||||
{
|
|
||||||
if ((*it).mUVChannelIndex == layer.mUVChannels[i].name)
|
bool found = false;
|
||||||
{
|
if ((*it).mUVChannelIndex == layer.mUVChannels[i].name) {
|
||||||
// check whether we have this channel already
|
// check whether we have this channel already
|
||||||
for (unsigned int m = 0; m < next;++m)
|
for (unsigned int m = 0; m < next;++m) {
|
||||||
{
|
|
||||||
if (i == out[m]) {
|
if (i == out[m]) {
|
||||||
(*it).mRealUVIndex = m;
|
(*it).mRealUVIndex = m;
|
||||||
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (0xffffffff == (*it).mRealUVIndex)
|
|
||||||
{
|
if (!found) {
|
||||||
(*it).mRealUVIndex = next;
|
(*it).mRealUVIndex = next;
|
||||||
out[next++] = i;
|
out[next++] = i;
|
||||||
if (AI_MAX_NUMBER_OF_TEXTURECOORDS != next)
|
if (AI_MAX_NUMBER_OF_TEXTURECOORDS != next)
|
||||||
|
|
Loading…
Reference in New Issue