aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-12 01:24:15 +0100
committerJustin Clark-Casey (justincc)2011-08-12 01:24:15 +0100
commit2169cf04f92a6465fe9cd58a2bac0d1380a561bd (patch)
treef6a76e18e449063ee8d49e0e33cf2f010beda4a4
parentFix kicking of NPCs via "kick user" console command. (diff)
downloadopensim-SC-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.zip
opensim-SC-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.tar.gz
opensim-SC-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.tar.bz2
opensim-SC-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.tar.xz
When saving appearance, only save the baked textures, not the other face textures (which are already stored permanently)
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs48
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs2
2 files changed, 44 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 75d8143..4627701 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -271,16 +271,30 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
271 "[AV FACTORY]: Permanently saving baked textures for {0} in {1}", 271 "[AV FACTORY]: Permanently saving baked textures for {0} in {1}",
272 sp.Name, m_scene.RegionInfo.RegionName); 272 sp.Name, m_scene.RegionInfo.RegionName);
273 273
274 for (int i = 0; i < faceTextures.Length; i++) 274 foreach (int i in Enum.GetValues(typeof(BakeType)))
275 { 275 {
276 BakeType bakeType = (BakeType)i;
277
278 if (bakeType == BakeType.Unknown)
279 continue;
280
276// m_log.DebugFormat( 281// m_log.DebugFormat(
277// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}", 282// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}",
278// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]); 283// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
279 284
280 if (faceTextures[i] == null) 285 int ftIndex = (int)AppearanceManager.BakeTypeToAgentTextureIndex(bakeType);
286 Primitive.TextureEntryFace bakedTextureFace = faceTextures[ftIndex];
287
288 if (bakedTextureFace == null)
289 {
290 m_log.WarnFormat(
291 "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
292 bakeType, sp.Name, m_scene.RegionInfo.RegionName);
293
281 continue; 294 continue;
295 }
282 296
283 AssetBase asset = m_scene.AssetService.Get(faceTextures[i].TextureID.ToString()); 297 AssetBase asset = m_scene.AssetService.Get(bakedTextureFace.TextureID.ToString());
284 298
285 if (asset != null) 299 if (asset != null)
286 { 300 {
@@ -290,11 +304,35 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
290 else 304 else
291 { 305 {
292 m_log.WarnFormat( 306 m_log.WarnFormat(
293 "[AV FACTORY]: Baked texture {0} for {1} in {2} unexpectedly not found when trying to save permanently", 307 "[AV FACTORY]: Baked texture id {0} not found for bake {1} for avatar {2} in {3} when trying to save permanently",
294 faceTextures[i].TextureID, sp.Name, m_scene.RegionInfo.RegionName); 308 bakedTextureFace.TextureID, bakeType, sp.Name, m_scene.RegionInfo.RegionName);
295 } 309 }
296 } 310 }
297 311
312// for (int i = 0; i < faceTextures.Length; i++)
313// {
314//// m_log.DebugFormat(
315//// "[AVFACTORY]: NPC avatar {0} has texture id {1} : {2}",
316//// acd.AgentID, i, acd.Appearance.Texture.FaceTextures[i]);
317//
318// if (faceTextures[i] == null)
319// continue;
320//
321// AssetBase asset = m_scene.AssetService.Get(faceTextures[i].TextureID.ToString());
322//
323// if (asset != null)
324// {
325// asset.Temporary = false;
326// m_scene.AssetService.Store(asset);
327// }
328// else
329// {
330// m_log.WarnFormat(
331// "[AV FACTORY]: Baked texture {0} for {1} in {2} not found when trying to save permanently",
332// faceTextures[i].TextureID, sp.Name, m_scene.RegionInfo.RegionName);
333// }
334// }
335
298 return true; 336 return true;
299 } 337 }
300 338
diff --git a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
index 4441579..31e79fa 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/NPCAvatar.cs
@@ -843,7 +843,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC
843 public void Close() 843 public void Close()
844 { 844 {
845 // Remove ourselves from the scene 845 // Remove ourselves from the scene
846 m_scene.RemoveClient(AgentId, false); 846 m_scene.RemoveClient(AgentId, false);
847 } 847 }
848 848
849 public void Start() 849 public void Start()