From bec456c2a529ca0b9ca7fd59e8110e5d5b27c126 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Tue, 11 Nov 2014 07:09:30 +0100 Subject: [PATCH] Remove the Invisible stuff and add more baked caching. Refactor selection of textures to save to Bakes module. --- OpenSim/Framework/AvatarAppearance.cs | 28 ------------------- .../ClientStack/Linden/UDP/LLClientView.cs | 5 +--- .../AvatarFactory/AvatarFactoryModule.cs | 16 ++--------- .../Interfaces/IBakedTextureModule.cs | 2 +- .../Region/Framework/Scenes/ScenePresence.cs | 10 ++----- 5 files changed, 7 insertions(+), 54 deletions(-) diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 257997e95a..3874c47147 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -72,7 +72,6 @@ namespace OpenSim.Framework protected float m_avatarAnimOffset = 0; protected WearableCacheItem[] m_cacheitems; protected bool m_cacheItemsDirty = true; - public static Primitive.TextureEntry Invisible = null; public virtual int Serial { @@ -135,30 +134,8 @@ namespace OpenSim.Framework set { m_cacheItemsDirty = value; } } - private void CreateInvisibleTextureEntry() - { - if (Invisible != null) - return; - Invisible = new Primitive.TextureEntry(new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903")); - - Invisible.FaceTextures[8] = new Primitive.TextureEntryFace(null); - Invisible.FaceTextures[8].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); - Invisible.FaceTextures[9] = new Primitive.TextureEntryFace(null); - Invisible.FaceTextures[9].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); - Invisible.FaceTextures[10] = new Primitive.TextureEntryFace(null); - Invisible.FaceTextures[10].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); - Invisible.FaceTextures[11] = new Primitive.TextureEntryFace(null); - Invisible.FaceTextures[11].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); - Invisible.FaceTextures[19] = new Primitive.TextureEntryFace(null); - Invisible.FaceTextures[19].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); - Invisible.FaceTextures[20] = new Primitive.TextureEntryFace(null); - Invisible.FaceTextures[20].TextureID = new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); - } - public AvatarAppearance() { - CreateInvisibleTextureEntry(); - // m_log.WarnFormat("[AVATAR APPEARANCE]: create empty appearance"); m_serial = 0; @@ -172,9 +149,6 @@ namespace OpenSim.Framework public AvatarAppearance(OSDMap map) { - CreateInvisibleTextureEntry(); - - Invisible = new Primitive.TextureEntry(new UUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903")); // m_log.WarnFormat("[AVATAR APPEARANCE]: create appearance from OSDMap"); Unpack(map); @@ -183,7 +157,6 @@ namespace OpenSim.Framework public AvatarAppearance(AvatarWearable[] wearables, Primitive.TextureEntry textureEntry, byte[] visualParams) { - CreateInvisibleTextureEntry(); // m_log.WarnFormat("[AVATAR APPEARANCE] create initialized appearance"); m_serial = 0; @@ -221,7 +194,6 @@ namespace OpenSim.Framework public AvatarAppearance(AvatarAppearance appearance, bool copyWearables, bool copyBaked) { - CreateInvisibleTextureEntry(); // m_log.WarnFormat("[AVATAR APPEARANCE] create from an existing appearance"); if (appearance == null) diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index b7a4b9345c..849fec3cf7 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs @@ -5143,10 +5143,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (sendTexture) { - if (presence.Invisible) - textureEntry = AvatarAppearance.Invisible.GetBytes(); - else - textureEntry = presence.Appearance.Texture.GetBytes(); + textureEntry = presence.Appearance.Texture.GetBytes(); } else textureEntry = null; diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 1eb7d2dc05..22f03665fb 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -460,18 +460,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { m_log.Debug("[UpdateBakedCache] uploading to bakedModule cache"); - WearableCacheItem[] toBakedModule = new WearableCacheItem[AvatarAppearance.BAKE_INDICES.Length]; - - for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) - { - int idx = (int)AvatarAppearance.BAKE_INDICES[i]; - toBakedModule[i] = new WearableCacheItem(); - toBakedModule[i].TextureIndex = (uint)idx; - toBakedModule[i].CacheId = wearableCache[idx].CacheId; - toBakedModule[i].TextureID = wearableCache[idx].TextureID; - toBakedModule[i].TextureAsset = wearableCache[idx].TextureAsset; - } - m_BakedTextureModule.Store(sp.UUID, toBakedModule); + m_BakedTextureModule.Store(sp.UUID); } } @@ -610,8 +599,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory { bakedModuleCache = bakedModule.Get(sp.UUID); } - catch (Exception) + catch (Exception e) { + m_log.ErrorFormat(e.ToString()); bakedModuleCache = null; } diff --git a/OpenSim/Region/Framework/Interfaces/IBakedTextureModule.cs b/OpenSim/Region/Framework/Interfaces/IBakedTextureModule.cs index 3d2e0836a2..570d31c757 100644 --- a/OpenSim/Region/Framework/Interfaces/IBakedTextureModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IBakedTextureModule.cs @@ -35,7 +35,7 @@ namespace OpenSim.Services.Interfaces public interface IBakedTextureModule { WearableCacheItem[] Get(UUID id); - void Store(UUID id, WearableCacheItem[] data); + void Store(UUID id); void UpdateMeshAvatar(UUID id); } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 5a3e5549db..cd9dcf58fc 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -90,7 +90,6 @@ namespace OpenSim.Region.Framework.Scenes public bool isNPC { get; private set; } - public bool Invisible { get; set; } private PresenceType m_presenceType; public PresenceType PresenceType { get {return m_presenceType;} @@ -950,7 +949,6 @@ namespace OpenSim.Region.Framework.Scenes public ScenePresence( IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type) { - Invisible = false; AttachmentsSyncLock = new Object(); AllowMovement = true; IsChildAgent = true; @@ -3716,12 +3714,8 @@ namespace OpenSim.Region.Framework.Scenes public void SendAppearanceToAgentNF(ScenePresence avatar) { - if (Invisible) - avatar.ControllingClient.SendAppearance( - UUID, Appearance.VisualParams, AvatarAppearance.Invisible.GetBytes()); - else - avatar.ControllingClient.SendAppearance( - UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); + avatar.ControllingClient.SendAppearance( + UUID, Appearance.VisualParams, Appearance.Texture.GetBytes()); } public void SendAnimPackToAgent(ScenePresence p)