diff --git a/OpenMetaverse/AppearanceManager.cs b/OpenMetaverse/AppearanceManager.cs index 48753508..2432f04e 100644 --- a/OpenMetaverse/AppearanceManager.cs +++ b/OpenMetaverse/AppearanceManager.cs @@ -702,15 +702,36 @@ namespace OpenMetaverse Dictionary colorParams = new Dictionary(); // Populate collection of alpha masks from visual params + // also add color tinting information foreach (KeyValuePair kvp in wearable.Asset.Params) { VisualParam p = VisualParams.Params[kvp.Key]; + // Color params if (p.ColorParams.HasValue) { - colorParams.Add(p.ColorParams.Value, kvp.Value); + // If this is not skin, just add params directly + if (wearable.WearableType != WearableType.Skin) + { + colorParams.Add(p.ColorParams.Value, kvp.Value); + } + else + { + // For skin we skip makeup params for now and use only the 3 + // that are used to determine base skin tone + // Param 108 - Rainbow Color + // Param 110 - Red Skin (Ruddiness) + // Param 111 - Pigment + if (kvp.Key == 108 || kvp.Key == 110 || kvp.Key == 111) + { + colorParams.Add(p.ColorParams.Value, kvp.Value); + } + } } + // Alhpa masks are specified in sub "driver" params + // TODO pull bump data too to implement things like + // clothes "bagginess" if (p.Drivers != null) { for (int i = 0; i < p.Drivers.Length; i++) @@ -721,7 +742,6 @@ namespace OpenMetaverse if (driver.AlphaParams.HasValue && driver.AlphaParams.Value.TGAFile != string.Empty && !driver.IsBumpAttribute) { alphaMasks.Add(driver.AlphaParams.Value, kvp.Value); - Logger.DebugLog(wearable.WearableType + " using value " + kvp.Value + " for " + driver.ParamID + ": " + driver.Name + ": " + driver.AlphaParams.Value.TGAFile); break; } } diff --git a/OpenMetaverse/_VisualParam_.cs b/OpenMetaverse/_VisualParam_.cs index 1be99e4a..fc36b915 100644 --- a/OpenMetaverse/_VisualParam_.cs +++ b/OpenMetaverse/_VisualParam_.cs @@ -469,8 +469,8 @@ namespace OpenMetaverse Params[863] = new VisualParam(863, "skirt_looseness", 0, "skirt", "Skirt Fit", "Tight Skirt", "Poofy Skirt", 0.333f, 0f, 1f, false, new int[] { 866, 846, 845 }, null, null); Params[866] = new VisualParam(866, "skirt_tight", 1, "skirt", "tight skirt", "form fitting", "loose", 0f, 0f, 1f, false, null, null, null); Params[867] = new VisualParam(867, "skirt_smallbutt", 1, "skirt", "tight skirt", "form fitting", "loose", 0f, 0f, 1f, false, null, null, null); - Params[868] = new VisualParam(868, "Shirt Wrinkles", 0, "shirt", String.Empty, String.Empty, String.Empty, 0f, 0f, 1f, true, null, null, new VisualColorParam(VisualColorOperation.None, new System.Drawing.Color[] { System.Drawing.Color.FromArgb(0, 255, 255, 255), System.Drawing.Color.FromArgb(255, 255, 255, 255) })); - Params[869] = new VisualParam(869, "Pants Wrinkles", 0, "pants", String.Empty, String.Empty, String.Empty, 0f, 0f, 1f, true, null, null, new VisualColorParam(VisualColorOperation.None, new System.Drawing.Color[] { System.Drawing.Color.FromArgb(0, 255, 255, 255), System.Drawing.Color.FromArgb(255, 255, 255, 255) })); + Params[868] = new VisualParam(868, "Shirt Wrinkles", 0, "shirt", String.Empty, String.Empty, String.Empty, 0f, 0f, 1f, true, null, null, null); + Params[869] = new VisualParam(869, "Pants Wrinkles", 0, "pants", String.Empty, String.Empty, String.Empty, 0f, 0f, 1f, true, null, null, null); Params[870] = new VisualParam(870, "Pointy_Eyebrows", 1, "hair", "Eyebrow Points", "Smooth", "Pointy", -0.5f, -0.5f, 1f, false, null, null, null); Params[871] = new VisualParam(871, "Lower_Eyebrows", 1, "hair", "Eyebrow Height", "Higher", "Lower", -2f, -2f, 2f, false, null, null, null); Params[872] = new VisualParam(872, "Arced_Eyebrows", 1, "hair", "Eyebrow Arc", "Flat", "Arced", 0f, 0f, 1f, false, null, null, null); diff --git a/Programs/VisualParamGenerator/VisualParamGenerator.cs b/Programs/VisualParamGenerator/VisualParamGenerator.cs index 6dfc85f7..565bd9dd 100644 --- a/Programs/VisualParamGenerator/VisualParamGenerator.cs +++ b/Programs/VisualParamGenerator/VisualParamGenerator.cs @@ -112,6 +112,7 @@ namespace VisualParamGenerator int id = Int32.Parse(node.Attributes["id"].Value); string bumpAttrib = "false"; + bool skipColor = false; if (node.ParentNode.Name == "layer") { @@ -119,6 +120,19 @@ namespace VisualParamGenerator { bumpAttrib = "true"; } + + for (int nodeNr = 0; nodeNr < node.ParentNode.ChildNodes.Count; nodeNr++) + { + XmlNode lnode = node.ParentNode.ChildNodes[nodeNr]; + + if (lnode.Name == "texture") + { + if (lnode.Attributes["local_texture_alpha_only"] != null && lnode.Attributes["local_texture_alpha_only"].Value.ToLower() == "true") + { + skipColor = true; + } + } + } } @@ -186,7 +200,7 @@ namespace VisualParamGenerator } } - if (colors.Count > 0) + if (colors.Count > 0 && !skipColor) { string colorsStr = string.Join(", ", colors.ToArray()); Colors.Add(id, string.Format("new VisualColorParam({0}, new System.Drawing.Color[] {{ {1} }})", operation, colorsStr));