Modified:
/libopenmetaverse/trunk/OpenMetaverse/Imaging/BakeLayer.cs
=======================================
--- /libopenmetaverse/trunk/OpenMetaverse/Imaging/BakeLayer.cs Sat Oct 23
22:34:26 2010
+++ /libopenmetaverse/trunk/OpenMetaverse/Imaging/BakeLayer.cs Sat Jan 21
10:03:17 2012
@@ -155,9 +155,9 @@
continue;
}
- // Don't draw skin on head bake first
- // For head bake skin texture is drawn last, go figure
- if (bakeType == BakeType.Head && i == 0) continue;
+ // Don't draw skin and tattoo on head bake first
+ // For head bake the skin and texture are drawn last, go
figure
+ if (bakeType == BakeType.Head && (i == 0 || i == 1))
continue;
ManagedImage texture = textures[i].Texture.Image.Clone();
//File.WriteAllBytes(bakeType + "-texture-layer-" + i
+ ".tga", texture.ExportTGA());
@@ -172,8 +172,8 @@
// Special case for hair layer for the head bake
// If we don't have skin texture, we discard hair alpha
- // and apply hair pattern over the texture
- if (!SkinTexture && bakeType == BakeType.Head && i == 1)
+ // and apply hair(i==2) pattern over the texture
+ if (!SkinTexture && bakeType == BakeType.Head && i == 2)
{
if (texture.Alpha != null)
{
@@ -260,7 +260,7 @@
//File.WriteAllBytes(bakeType + "-layer-" + i + ".tga",
texture.ExportTGA());
}
- // For head, we add skin last
+ // For head and tattoo, we add skin last
if (SkinTexture && bakeType == BakeType.Head)
{
ManagedImage texture = textures[0].Texture.Image.Clone();
@@ -270,6 +270,18 @@
catch (Exception) { }
}
DrawLayer(texture, false);
+
+ // Add head tattoo here (if available, order-dependant)
+ if (textures.Count > 1 && textures[1].Texture != null)
+ {
+ texture = textures[1].Texture.Image.Clone();
+ if (texture.Width != bakeWidth || texture.Height !=
bakeHeight)
+ {
+ try { texture.ResizeNearestNeighbor(bakeWidth,
bakeHeight); }
+ catch (Exception) { }
+ }
+ DrawLayer(texture, false);
+ }
}
// Apply any alpha wearable textures to make parts of the
avatar disappear