aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2014-08-07 21:24:52 +0100
committerUbitUmarov2014-08-07 21:24:52 +0100
commitf78894759442e0a9a3f36d33b40e1199eff19a15 (patch)
tree8308e6be2550f4491b231f297b82b6ec49d57fd9
parentbug on upload new bakes decision (diff)
downloadopensim-SC_OLD-f78894759442e0a9a3f36d33b40e1199eff19a15.zip
opensim-SC_OLD-f78894759442e0a9a3f36d33b40e1199eff19a15.tar.gz
opensim-SC_OLD-f78894759442e0a9a3f36d33b40e1199eff19a15.tar.bz2
opensim-SC_OLD-f78894759442e0a9a3f36d33b40e1199eff19a15.tar.xz
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 )
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs95
1 files changed, 60 insertions, 35 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 448f7b3..a1b17d4 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -494,7 +494,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
494 494
495 wearableCache = WearableCacheItem.GetDefaultCacheItem(); 495 wearableCache = WearableCacheItem.GetDefaultCacheItem();
496 496
497 int hits = 0; 497 int hits = 0;
498 bool gotbacked = false;
499
498 // Cache wearable data for teleport. 500 // Cache wearable data for teleport.
499 // Only makes sense if there's a bake module and a cache module 501 // Only makes sense if there's a bake module and a cache module
500 if (bakedModule != null && cache != null) 502 if (bakedModule != null && cache != null)
@@ -525,8 +527,10 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
525 bakedModuleCache[i].TextureAsset.Temporary = true; 527 bakedModuleCache[i].TextureAsset.Temporary = true;
526 bakedModuleCache[i].TextureAsset.Local = true; 528 bakedModuleCache[i].TextureAsset.Local = true;
527 cache.Store(bakedModuleCache[i].TextureAsset); 529 cache.Store(bakedModuleCache[i].TextureAsset);
530
528 } 531 }
529 } 532 }
533 gotbacked = true;
530 } 534 }
531 } 535 }
532 536
@@ -536,52 +540,73 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
536 int idx = AvatarAppearance.BAKE_INDICES[i]; 540 int idx = AvatarAppearance.BAKE_INDICES[i];
537 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; 541 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
538 542
539 // No face, so lets check our cache 543 // on tp viewer assumes servers did the cache work
540 if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE) 544 // and tp propagation of baked textures is broken somewhere
545 // so make grid cache be mandatory
546 if (gotbacked)
541 { 547 {
542 sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint)idx); 548 m_log.Debug("[ValidateBakedCache] bakedModule cache override");
543 if (wearableCache[idx].TextureID != UUID.Zero) 549
544 { 550 sp.Appearance.Texture.FaceTextures[idx].TextureID = wearableCache[idx].TextureID;
545 sp.Appearance.Texture.FaceTextures[idx].TextureID = wearableCache[idx].TextureID; 551 face = sp.Appearance.Texture.FaceTextures[idx];
546 face = sp.Appearance.Texture.FaceTextures[idx]; 552
547 // let run to end of loop to check cache 553 // this should be removed
548 } 554 if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
549 else
550 { 555 {
551 sp.Appearance.Texture.FaceTextures[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE; 556 defonly = false; // found a non-default texture reference
552 face = sp.Appearance.Texture.FaceTextures[idx];
553// lets try not invalidating the cache entry
554// wearableCache[idx].CacheId = UUID.Zero;
555// wearableCache[idx].TextureAsset = null;
556 continue;
557 } 557 }
558 }
559 558
560 if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
561 {
562 defonly = false; // found a non-default texture reference
563 continue; 559 continue;
564 } 560 }
565 561 else
566 if(wearableCache[idx].TextureID != face.TextureID)
567 { 562 {
568 wearableCache[idx].CacheId = UUID.Zero; 563 // No face, so lets check our cache
569 wearableCache[idx].TextureID = UUID.Zero; 564 if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
570 wearableCache[idx].TextureAsset = null; 565 {
571 continue; 566 sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint)idx);
572 } 567 if (wearableCache[idx].TextureID != UUID.Zero)
568 {
569 sp.Appearance.Texture.FaceTextures[idx].TextureID = wearableCache[idx].TextureID;
570 face = sp.Appearance.Texture.FaceTextures[idx];
571 // let run to end of loop to check cache
572 }
573 else
574 {
575 sp.Appearance.Texture.FaceTextures[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
576 face = sp.Appearance.Texture.FaceTextures[idx];
577 // lets try not invalidating the cache entry
578 // wearableCache[idx].CacheId = UUID.Zero;
579 // wearableCache[idx].TextureAsset = null;
580 continue;
581 }
582 }
573 583
574 wearableCache[idx].TextureAsset = null; 584 if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
575 if (cache != null) 585 {
576 { 586 defonly = false; // found a non-default texture reference
577 wearableCache[idx].TextureAsset = m_scene.AssetService.Get(face.TextureID.ToString()); 587 continue;
578 if (wearableCache[idx].TextureAsset == null) 588 }
589
590 if (wearableCache[idx].TextureID != face.TextureID)
579 { 591 {
580 wearableCache[idx].CacheId = UUID.Zero; 592 wearableCache[idx].CacheId = UUID.Zero;
581 wearableCache[idx].TextureID = UUID.Zero; 593 wearableCache[idx].TextureID = UUID.Zero;
594 wearableCache[idx].TextureAsset = null;
595 continue;
596 }
597
598 wearableCache[idx].TextureAsset = null;
599 if (cache != null)
600 {
601 wearableCache[idx].TextureAsset = m_scene.AssetService.Get(face.TextureID.ToString());
602 if (wearableCache[idx].TextureAsset == null)
603 {
604 wearableCache[idx].CacheId = UUID.Zero;
605 wearableCache[idx].TextureID = UUID.Zero;
606 }
607 else
608 hits++;
582 } 609 }
583 else
584 hits++;
585 } 610 }
586 } 611 }
587 612