diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 73 |
1 files changed, 71 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index cfc7e7e..a070ff8 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | |||
@@ -376,6 +376,52 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
376 | { | 376 | { |
377 | bool defonly = true; // are we only using default textures | 377 | bool defonly = true; // are we only using default textures |
378 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); | 378 | IImprovedAssetCache cache = m_scene.RequestModuleInterface<IImprovedAssetCache>(); |
379 | IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); | ||
380 | WearableCacheItem[] wearableCache = null; | ||
381 | |||
382 | // Cache wearable data for teleport. | ||
383 | // Only makes sense if there's a bake module and a cache module | ||
384 | if (bakedModule != null && cache != null) | ||
385 | { | ||
386 | try | ||
387 | { | ||
388 | wearableCache = bakedModule.Get(sp.UUID); | ||
389 | } | ||
390 | catch (Exception) | ||
391 | { | ||
392 | |||
393 | } | ||
394 | if (wearableCache != null) | ||
395 | { | ||
396 | for (int i = 0; i < wearableCache.Length; i++) | ||
397 | { | ||
398 | cache.Cache(wearableCache[i].TextureAsset); | ||
399 | } | ||
400 | } | ||
401 | } | ||
402 | /* | ||
403 | IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); | ||
404 | if (invService.GetRootFolder(userID) != null) | ||
405 | { | ||
406 | WearableCacheItem[] wearableCache = null; | ||
407 | if (bakedModule != null) | ||
408 | { | ||
409 | try | ||
410 | { | ||
411 | wearableCache = bakedModule.Get(userID); | ||
412 | appearance.WearableCacheItems = wearableCache; | ||
413 | appearance.WearableCacheItemsDirty = false; | ||
414 | foreach (WearableCacheItem item in wearableCache) | ||
415 | { | ||
416 | appearance.Texture.FaceTextures[item.TextureIndex].TextureID = item.TextureID; | ||
417 | } | ||
418 | } | ||
419 | catch (Exception) | ||
420 | { | ||
421 | |||
422 | } | ||
423 | } | ||
424 | */ | ||
379 | 425 | ||
380 | // Process the texture entry | 426 | // Process the texture entry |
381 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) | 427 | for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) |
@@ -383,9 +429,32 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory | |||
383 | int idx = AvatarAppearance.BAKE_INDICES[i]; | 429 | int idx = AvatarAppearance.BAKE_INDICES[i]; |
384 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; | 430 | Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; |
385 | 431 | ||
386 | // if there is no texture entry, skip it | 432 | // No face, so lets check our baked service cache, teleport or login. |
387 | if (face == null) | 433 | if (face == null) |
388 | continue; | 434 | { |
435 | if (wearableCache != null) | ||
436 | { | ||
437 | // If we find the an appearance item, set it as the textureentry and the face | ||
438 | WearableCacheItem searchitem = WearableCacheItem.SearchTextureIndex((uint) idx, wearableCache); | ||
439 | if (searchitem != null) | ||
440 | { | ||
441 | sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint) idx); | ||
442 | sp.Appearance.Texture.FaceTextures[idx].TextureID = searchitem.TextureID; | ||
443 | face = sp.Appearance.Texture.FaceTextures[idx]; | ||
444 | } | ||
445 | else | ||
446 | { | ||
447 | // if there is no texture entry and no baked cache, skip it | ||
448 | continue; | ||
449 | } | ||
450 | } | ||
451 | else | ||
452 | { | ||
453 | //No texture entry face and no cache. Skip this face. | ||
454 | continue; | ||
455 | } | ||
456 | } | ||
457 | |||
389 | 458 | ||
390 | // m_log.DebugFormat( | 459 | // m_log.DebugFormat( |
391 | // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", | 460 | // "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}", |