diff options
author | Justin Clark-Casey (justincc) | 2011-08-12 01:24:15 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-08-12 01:24:15 +0100 |
commit | 2169cf04f92a6465fe9cd58a2bac0d1380a561bd (patch) | |
tree | f6a76e18e449063ee8d49e0e33cf2f010beda4a4 /OpenSim/Region/CoreModules/Avatar/AvatarFactory | |
parent | Fix kicking of NPCs via "kick user" console command. (diff) | |
download | opensim-SC_OLD-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.zip opensim-SC_OLD-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.tar.gz opensim-SC_OLD-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.tar.bz2 opensim-SC_OLD-2169cf04f92a6465fe9cd58a2bac0d1380a561bd.tar.xz |
When saving appearance, only save the baked textures, not the other face textures (which are already stored permanently)
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/AvatarFactory')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs | 48 |
1 files changed, 43 insertions, 5 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 | ||