From b1c8d0588829dfa76f89460eeb8406d9c4fc479f Mon Sep 17 00:00:00 2001 From: Master ScienceSim Date: Wed, 20 Oct 2010 16:17:54 -0700 Subject: Major refactoring of appearance handling. AvatarService -- add two new methods, GetAppearance and SetAppearance to get around the lossy encoding in AvatarData. Preseve the old functions to avoid changing the behavior for ROBUST services. AvatarAppearance -- major refactor, moved the various encoding methods used by AgentCircuitData, ClientAgentUpdate and ScenePresence into one location. Changed initialization. AvatarAttachments -- added a class specifically to handle attachments in preparation for additional functionality that will be needed for viewer 2. AvatarFactory -- removed a number of unused or methods duplicated in other locations. Moved in all appearance event handling from ScenePresence. Required a change to IClientAPI that propogated throughout all the IClientAPI implementations. --- OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs') diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs index ab0be77..c471636 100644 --- a/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/OptionalModules/World/NPC/NPCModule.cs @@ -64,15 +64,13 @@ namespace OpenSim.Region.OptionalModules.World.NPC if (m_appearanceCache.ContainsKey(target)) return m_appearanceCache[target]; - AvatarData adata = scene.AvatarService.GetAvatar(target); - if (adata != null) + AvatarAppearance appearance = scene.AvatarService.GetAppearance(target); + if (appearance != null) { - AvatarAppearance x = adata.ToAvatarAppearance(target); - - m_appearanceCache.Add(target, x); - - return x; + m_appearanceCache.Add(target, appearance); + return appearance; } + return new AvatarAppearance(); } @@ -169,7 +167,9 @@ namespace OpenSim.Region.OptionalModules.World.NPC { AvatarAppearance x = GetAppearance(p_cloneAppearanceFrom, p_scene); - sp.SetAppearance(x.Texture, (byte[])x.VisualParams.Clone()); + sp.Appearance.SetTextureEntries(x.Texture); + sp.Appearance.SetVisualParams((byte[])x.VisualParams.Clone()); + sp.SendAppearanceToAllOtherAgents(); } m_avatars.Add(npcAvatar.AgentId, npcAvatar); -- cgit v1.1