make grid baked textures override the ones on appearance. Due to bug

somewhere they are always bad at ValidateBakedTextures entry. ( even if
 they where good and on assets cache we whould need to generate the
 cacheID hash )
avinationmerge
UbitUmarov 2014-08-07 21:24:52 +01:00
parent 38e2e5942c
commit f788947594
1 changed files with 61 additions and 36 deletions

View File

@ -495,6 +495,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
wearableCache = WearableCacheItem.GetDefaultCacheItem();
int hits = 0;
bool gotbacked = false;
// Cache wearable data for teleport.
// Only makes sense if there's a bake module and a cache module
if (bakedModule != null && cache != null)
@ -525,8 +527,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
bakedModuleCache[i].TextureAsset.Temporary = true;
bakedModuleCache[i].TextureAsset.Local = true;
cache.Store(bakedModuleCache[i].TextureAsset);
}
}
gotbacked = true;
}
}
@ -536,6 +540,26 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
int idx = AvatarAppearance.BAKE_INDICES[i];
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
// on tp viewer assumes servers did the cache work
// and tp propagation of baked textures is broken somewhere
// so make grid cache be mandatory
if (gotbacked)
{
m_log.Debug("[ValidateBakedCache] bakedModule cache override");
sp.Appearance.Texture.FaceTextures[idx].TextureID = wearableCache[idx].TextureID;
face = sp.Appearance.Texture.FaceTextures[idx];
// this should be removed
if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
{
defonly = false; // found a non-default texture reference
}
continue;
}
else
{
// No face, so lets check our cache
if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
{
@ -584,6 +608,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
hits++;
}
}
}
sp.Appearance.WearableCacheItems = wearableCache;