diff --git a/OpenMetaverse/Interfaces/IRendering.cs b/OpenMetaverse/Interfaces/IRendering.cs new file mode 100644 index 00000000..8e8b09a6 --- /dev/null +++ b/OpenMetaverse/Interfaces/IRendering.cs @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2008, openmetaverse.org + * All rights reserved. + * + * - Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Neither the name of the openmetaverse.org nor the names + * of its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; + +namespace OpenMetaverse.Rendering +{ + [AttributeUsage(AttributeTargets.Class)] + public class RendererNameAttribute : System.Attribute + { + private string _name; + + public RendererNameAttribute(string name) + : base() + { + _name = name; + } + + public override string ToString() + { + return _name; + } + } + + /// + /// Abstract base for rendering plugins + /// + public interface IRendering + { + /// + /// Generates a basic mesh structure from a primitive + /// + /// Primitive to generate the mesh from + /// Level of detail to generate the mesh at + /// The generated mesh + SimpleMesh GenerateSimpleMesh(Primitive prim, DetailLevel lod); + + /// + /// Generates a a series of faces, each face containing a mesh and + /// metadata + /// + /// Primitive to generate the mesh from + /// Level of detail to generate the mesh at + /// The generated mesh + FacetedMesh GenerateFacetedMesh(Primitive prim, DetailLevel lod); + + /// + /// Apply texture coordinate modifications from a + /// to a list of vertices + /// + /// Vertex list to modify texture coordinates for + /// Center-point of the face + /// Face texture parameters + void TransformTexCoords(List vertices, LLVector3 center, LLObject.TextureEntryFace teFace); + } +} diff --git a/OpenMetaverse/Rendering/LindenMesh.cs b/OpenMetaverse/Rendering/LindenMesh.cs new file mode 100644 index 00000000..bc46604b --- /dev/null +++ b/OpenMetaverse/Rendering/LindenMesh.cs @@ -0,0 +1,310 @@ +/* + * Copyright (c) 2008, openmetaverse.org + * All rights reserved. + * + * - Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Neither the name of the openmetaverse.org nor the names + * of its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.IO; + +namespace OpenMetaverse.Rendering +{ + public class LindenMesh + { + const string MESH_HEADER = "Linden Binary Mesh 1.0"; + const string MORPH_FOOTER = "End Morphs"; + + #region Mesh Structs + + public struct Face + { + public short[] Indices; + } + + public struct Vertex + { + public LLVector3 Coord; + public LLVector3 Normal; + public LLVector3 BiNormal; + public LLVector2 TexCoord; + public LLVector2 DetailTexCoord; + public float Weight; + + public override string ToString() + { + return String.Format("Coord: {0} Norm: {1} BiNorm: {2} TexCoord: {3} DetailTexCoord: {4}", Coord, Normal, BiNormal, TexCoord, DetailTexCoord, Weight); + } + } + + public struct MorphVertex + { + public uint VertexIndex; + public LLVector3 Coord; + public LLVector3 Normal; + public LLVector3 BiNormal; + public LLVector2 TexCoord; + + public override string ToString() + { + return String.Format("Index: {0} Coord: {1} Norm: {2} BiNorm: {3} TexCoord: {4}", VertexIndex, Coord, Normal, BiNormal, TexCoord); + } + } + + public struct Morph + { + public string Name; + public int NumVertices; + public MorphVertex[] Vertices; + + public override string ToString() + { + return Name; + } + } + + public struct VertexRemap + { + public int RemapSource; + public int RemapDestination; + + public override string ToString() + { + return String.Format("{0} -> {1}", RemapSource, RemapDestination); + } + } + + #endregion Mesh Structs + + /// + /// Level of Detail mesh + /// + public class LODMesh + { + public float MinPixelWidth; + + protected string _header; + protected bool _hasWeights; + protected bool _hasDetailTexCoords; + protected LLVector3 _position; + protected LLVector3 _rotationAngles; + protected byte _rotationOrder; + protected LLVector3 _scale; + protected ushort _numFaces; + protected Face[] _faces; + + public virtual void LoadMesh(string filename) + { + byte[] buffer = File.ReadAllBytes(filename); + BitPack input = new BitPack(buffer, 0); + + _header = input.UnpackString(24).TrimEnd(new char[] { '\0' }); + if (!String.Equals(_header, MESH_HEADER)) + throw new FileLoadException("Unrecognized mesh format"); + + // Populate base mesh variables + _hasWeights = (input.UnpackByte() != 0); + _hasDetailTexCoords = (input.UnpackByte() != 0); + _position = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + _rotationAngles = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + _rotationOrder = input.UnpackByte(); + _scale = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + _numFaces = (ushort)input.UnpackUShort(); + + _faces = new Face[_numFaces]; + + for (int i = 0; i < _numFaces; i++) + _faces[i].Indices = new short[] { input.UnpackShort(), input.UnpackShort(), input.UnpackShort() }; + } + } + + public float MinPixelWidth; + + public string Name { get { return _name; } } + public string Header { get { return _header; } } + public bool HasWeights { get { return _hasWeights; } } + public bool HasDetailTexCoords { get { return _hasDetailTexCoords; } } + public LLVector3 Position { get { return _position; } } + public LLVector3 RotationAngles { get { return _rotationAngles; } } + //public byte RotationOrder + public LLVector3 Scale { get { return _scale; } } + public ushort NumVertices { get { return _numVertices; } } + public Vertex[] Vertices { get { return _vertices; } } + public ushort NumFaces { get { return _numFaces; } } + public Face[] Faces { get { return _faces; } } + public ushort NumSkinJoints { get { return _numSkinJoints; } } + public string[] SkinJoints { get { return _skinJoints; } } + public Morph[] Morphs { get { return _morphs; } } + public int NumRemaps { get { return _numRemaps; } } + public VertexRemap[] VertexRemaps { get { return _vertexRemaps; } } + public SortedList LODMeshes { get { return _lodMeshes; } } + + protected string _name; + protected string _header; + protected bool _hasWeights; + protected bool _hasDetailTexCoords; + protected LLVector3 _position; + protected LLVector3 _rotationAngles; + protected byte _rotationOrder; + protected LLVector3 _scale; + protected ushort _numVertices; + protected Vertex[] _vertices; + protected ushort _numFaces; + protected Face[] _faces; + protected ushort _numSkinJoints; + protected string[] _skinJoints; + protected Morph[] _morphs; + protected int _numRemaps; + protected VertexRemap[] _vertexRemaps; + protected SortedList _lodMeshes; + + public LindenMesh(string name) + { + _name = name; + _lodMeshes = new SortedList(); + } + + public virtual void LoadMesh(string filename) + { + byte[] buffer = File.ReadAllBytes(filename); + BitPack input = new BitPack(buffer, 0); + + _header = input.UnpackString(24).TrimEnd(new char[] { '\0' }); + if (!String.Equals(_header, MESH_HEADER)) + throw new FileLoadException("Unrecognized mesh format"); + + // Populate base mesh variables + _hasWeights = (input.UnpackByte() != 0); + _hasDetailTexCoords = (input.UnpackByte() != 0); + _position = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + _rotationAngles = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + _rotationOrder = input.UnpackByte(); + _scale = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + _numVertices = (ushort)input.UnpackUShort(); + + // Populate the vertex array + _vertices = new Vertex[_numVertices]; + + for (int i = 0; i < _numVertices; i++) + _vertices[i].Coord = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + + for (int i = 0; i < _numVertices; i++) + _vertices[i].Normal = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + + for (int i = 0; i < _numVertices; i++) + _vertices[i].BiNormal = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + + for (int i = 0; i < _numVertices; i++) + _vertices[i].TexCoord = new LLVector2(input.UnpackFloat(), input.UnpackFloat()); + + if (_hasDetailTexCoords) + { + for (int i = 0; i < _numVertices; i++) + _vertices[i].DetailTexCoord = new LLVector2(input.UnpackFloat(), input.UnpackFloat()); + } + + if (_hasWeights) + { + for (int i = 0; i < _numVertices; i++) + _vertices[i].Weight = input.UnpackFloat(); + } + + _numFaces = input.UnpackUShort(); + + _faces = new Face[_numFaces]; + + for (int i = 0; i < _numFaces; i++) + _faces[i].Indices = new short[] { input.UnpackShort(), input.UnpackShort(), input.UnpackShort() }; + + if (_hasWeights) + { + _numSkinJoints = input.UnpackUShort(); + _skinJoints = new string[_numSkinJoints]; + + for (int i = 0; i < _numSkinJoints; i++) + _skinJoints[i] = input.UnpackString(64).TrimEnd(new char[] { '\0' }); + } + else + { + _numSkinJoints = 0; + _skinJoints = new string[0]; + } + + // Grab morphs + List morphs = new List(); + string morphName = input.UnpackString(64).TrimEnd(new char[] { '\0' }); + + while (morphName != MORPH_FOOTER) + { + if (input.BytePos + 48 >= input.Data.Length) throw new FileLoadException("Encountered end of file while parsing morphs"); + + Morph morph = new Morph(); + morph.Name = morphName; + morph.NumVertices = input.UnpackInt(); + morph.Vertices = new MorphVertex[morph.NumVertices]; + + for (int i = 0; i < morph.NumVertices; i++) + { + MorphVertex vertex; + vertex.VertexIndex = input.UnpackUInt(); + vertex.Coord = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + vertex.Normal = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + vertex.BiNormal = new LLVector3(input.UnpackFloat(), input.UnpackFloat(), input.UnpackFloat()); + vertex.TexCoord = new LLVector2(input.UnpackFloat(), input.UnpackFloat()); + } + + morphs.Add(morph); + + // Grab the next name + morphName = input.UnpackString(64).TrimEnd(new char[] { '\0' }); + } + + _morphs = morphs.ToArray(); + + // Check if there are remaps or if we're at the end of the file + if (input.BytePos < input.Data.Length - 1) + { + _numRemaps = input.UnpackInt(); + _vertexRemaps = new VertexRemap[_numRemaps]; + + for (int i = 0; i < _numRemaps; i++) + { + _vertexRemaps[i].RemapSource = input.UnpackInt(); + _vertexRemaps[i].RemapDestination = input.UnpackInt(); + } + } + else + { + _numRemaps = 0; + _vertexRemaps = new VertexRemap[0]; + } + } + + public virtual void LoadLODMesh(int level, string filename) + { + LODMesh lod = new LODMesh(); + lod.LoadMesh(filename); + _lodMeshes[level] = lod; + } + } +} diff --git a/OpenMetaverse/Rendering/Rendering.cs b/OpenMetaverse/Rendering/Rendering.cs new file mode 100644 index 00000000..e34b0cba --- /dev/null +++ b/OpenMetaverse/Rendering/Rendering.cs @@ -0,0 +1,281 @@ +/* + * Copyright (c) 2008, openmetaverse.org + * All rights reserved. + * + * - Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Neither the name of the openmetaverse.org nor the names + * of its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.IO; +using System.Collections.Generic; +using System.Reflection; + +// The common elements shared between rendering plugins are defined here + +namespace OpenMetaverse.Rendering +{ + #region Enums + + public enum FaceType : ushort + { + PathBegin = 0x1 << 0, + PathEnd = 0x1 << 1, + InnerSide = 0x1 << 2, + ProfileBegin = 0x1 << 3, + ProfileEnd = 0x1 << 4, + OuterSide0 = 0x1 << 5, + OuterSide1 = 0x1 << 6, + OuterSide2 = 0x1 << 7, + OuterSide3 = 0x1 << 8 + } + + [Flags] + public enum FaceMask + { + Single = 0x0001, + Cap = 0x0002, + End = 0x0004, + Side = 0x0008, + Inner = 0x0010, + Outer = 0x0020, + Hollow = 0x0040, + Open = 0x0080, + Flat = 0x0100, + Top = 0x0200, + Bottom = 0x0400 + } + + public enum DetailLevel + { + Low = 0, + Medium = 1, + High = 2, + Highest = 3 + } + + #endregion Enums + + #region Structs + + public struct Vertex + { + public LLVector3 Position; + public LLVector3 Normal; + public LLVector3 Binormal; + public LLVector2 TexCoord; + } + + public struct ProfileFace + { + public int Index; + public int Count; + public float ScaleU; + public bool Cap; + public bool Flat; + public FaceType Type; + + public override string ToString() + { + return Type.ToString(); + } + }; + + public struct Profile + { + public float MinX; + public float MaxX; + public bool Open; + public bool Concave; + public int TotalOutsidePoints; + public List Positions; + public List Faces; + } + + public struct PathPoint + { + public LLVector3 Position; + public LLVector2 Scale; + public LLQuaternion Rotation; + public float TexT; + } + + public struct Path + { + public List Points; + public bool Open; + } + + public struct Face + { + // Only used for Inner/Outer faces + public int BeginS; + public int BeginT; + public int NumS; + public int NumT; + + public int ID; + public LLVector3 Center; + public LLVector3 MinExtent; + public LLVector3 MaxExtent; + public List Vertices; + public List Indices; + public List Edge; + public FaceMask Mask; + public LLObject.TextureEntryFace TextureFace; + public object UserData; + + public override string ToString() + { + return Mask.ToString(); + } + } + + #endregion Structs + + #region Exceptions + + public class RenderingException : Exception + { + public RenderingException(string message) + : base(message) + { + } + + public RenderingException(string message, Exception innerException) + : base(message, innerException) + { + } + } + + #endregion Exceptions + + #region Mesh Classes + + public class Mesh + { + public Primitive Prim; + public Path Path; + public Profile Profile; + + public override string ToString() + { + if (!String.IsNullOrEmpty(Prim.Properties.Name)) + { + return Prim.Properties.Name; + } + else + { + return String.Format("{0} ({1})", Prim.LocalID, Prim.Data); + } + } + } + + public class FacetedMesh : Mesh + { + public List Faces; + } + + public class SimpleMesh : Mesh + { + public List Vertices; + public List Indices; + } + + #endregion Mesh Classes + + #region Plugin Loading + + public static class RenderingLoader + { + public static List ListRenderers(string path) + { + List plugins = new List(); + string[] files = Directory.GetFiles(path, "OpenMetaverse.Rendering.*.dll"); + + foreach (string f in files) + { + try + { + Assembly a = Assembly.LoadFrom(f); + System.Type[] types = a.GetTypes(); + foreach (System.Type type in types) + { + if (type.GetInterface("IRendering") != null) + { + if (type.GetCustomAttributes(typeof(RendererNameAttribute), false).Length == 1) + { + plugins.Add(f); + } + else + { + Logger.Log("Rendering plugin does not support the [RendererName] attribute: " + f, + Helpers.LogLevel.Warning); + } + + break; + } + } + } + catch (Exception e) + { + Logger.Log(String.Format("Unrecognized rendering plugin {0}: {1}", f, e.Message), + Helpers.LogLevel.Warning, e); + } + } + + return plugins; + } + + public static IRendering LoadRenderer(string filename) + { + try + { + Assembly a = Assembly.LoadFrom(filename); + System.Type[] types = a.GetTypes(); + foreach (System.Type type in types) + { + if (type.GetInterface("IRendering") != null) + { + if (type.GetCustomAttributes(typeof(RendererNameAttribute), false).Length == 1) + { + return (IRendering)Activator.CreateInstance(type); + } + else + { + throw new RenderingException( + "Rendering plugin does not support the [RendererName] attribute"); + } + } + } + + throw new RenderingException( + "Rendering plugin does not support the IRendering interface"); + } + catch (Exception e) + { + throw new RenderingException("Failed loading rendering plugin: " + e.Message, e); + } + } + } + + #endregion Plugin Loading +} diff --git a/Programs/AvatarPreview/GLMesh.cs b/Programs/AvatarPreview/GLMesh.cs new file mode 100644 index 00000000..6d5c663a --- /dev/null +++ b/Programs/AvatarPreview/GLMesh.cs @@ -0,0 +1,120 @@ +using System; + +using OpenMetaverse; +using OpenMetaverse.Rendering; + +namespace AvatarPreview +{ + /// + /// Subclass of LindenMesh that adds vertex, index, and texture coordinate + /// arrays suitable for pushing direct to OpenGL + /// + public class GLMesh : LindenMesh + { + /// + /// Subclass of LODMesh that adds an index array suitable for pushing + /// direct to OpenGL + /// + new public class LODMesh : LindenMesh.LODMesh + { + public ushort[] Indices; + + public override void LoadMesh(string filename) + { + base.LoadMesh(filename); + + // Generate the index array + Indices = new ushort[_numFaces * 3]; + int current = 0; + for (int i = 0; i < _numFaces; i++) + { + Indices[current++] = (ushort)_faces[i].Indices[0]; + Indices[current++] = (ushort)_faces[i].Indices[1]; + Indices[current++] = (ushort)_faces[i].Indices[2]; + } + } + } + + /// + /// + /// + public struct GLData + { + public float[] Vertices; + public ushort[] Indices; + public float[] TexCoords; + public LLVector3 Center; + } + + public GLData RenderData; + + public GLMesh(string name) + : base(name) + { + } + + public override void LoadMesh(string filename) + { + base.LoadMesh(filename); + + float minX, minY, minZ; + minX = minY = minZ = Single.MaxValue; + float maxX, maxY, maxZ; + maxX = maxY = maxZ = Single.MinValue; + + // Generate the vertex array + RenderData.Vertices = new float[_numVertices * 3]; + int current = 0; + for (int i = 0; i < _numVertices; i++) + { + RenderData.Vertices[current++] = _vertices[i].Coord.X; + RenderData.Vertices[current++] = _vertices[i].Coord.Y; + RenderData.Vertices[current++] = _vertices[i].Coord.Z; + + if (_vertices[i].Coord.X < minX) + minX = _vertices[i].Coord.X; + else if (_vertices[i].Coord.X > maxX) + maxX = _vertices[i].Coord.X; + + if (_vertices[i].Coord.Y < minY) + minY = _vertices[i].Coord.Y; + else if (_vertices[i].Coord.Y > maxY) + maxY = _vertices[i].Coord.Y; + + if (_vertices[i].Coord.Z < minZ) + minZ = _vertices[i].Coord.Z; + else if (_vertices[i].Coord.Z > maxZ) + maxZ = _vertices[i].Coord.Z; + } + + // Calculate the center-point from the bounding box edges + RenderData.Center = new LLVector3((minX + maxX) / 2, (minY + maxY) / 2, (minZ + maxZ) / 2); + + // Generate the index array + RenderData.Indices = new ushort[_numFaces * 3]; + current = 0; + for (int i = 0; i < _numFaces; i++) + { + RenderData.Indices[current++] = (ushort)_faces[i].Indices[0]; + RenderData.Indices[current++] = (ushort)_faces[i].Indices[1]; + RenderData.Indices[current++] = (ushort)_faces[i].Indices[2]; + } + + // Generate the texcoord array + RenderData.TexCoords = new float[_numVertices * 2]; + current = 0; + for (int i = 0; i < _numVertices; i++) + { + RenderData.TexCoords[current++] = _vertices[i].TexCoord.X; + RenderData.TexCoords[current++] = _vertices[i].TexCoord.Y; + } + } + + public override void LoadLODMesh(int level, string filename) + { + LODMesh lod = new LODMesh(); + lod.LoadMesh(filename); + _lodMeshes[level] = lod; + } + } +} diff --git a/Programs/AvatarPreview/Program.cs b/Programs/AvatarPreview/Program.cs new file mode 100644 index 00000000..ca0b165b --- /dev/null +++ b/Programs/AvatarPreview/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Windows.Forms; + +namespace AvatarPreview +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new frmAvatar()); + } + } +} \ No newline at end of file diff --git a/Programs/AvatarPreview/Properties/AssemblyInfo.cs b/Programs/AvatarPreview/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..95726c51 --- /dev/null +++ b/Programs/AvatarPreview/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("avatarpreview")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Millions Of Us")] +[assembly: AssemblyProduct("avatarpreview")] +[assembly: AssemblyCopyright("Copyright © Millions Of Us 2008")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("00d5c128-fce6-4b58-b3b1-cad43b25ee0b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Programs/AvatarPreview/Properties/Resources.Designer.cs b/Programs/AvatarPreview/Properties/Resources.Designer.cs new file mode 100644 index 00000000..efaa44ac --- /dev/null +++ b/Programs/AvatarPreview/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.1433 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AvatarPreview.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("avatarpreview.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/Programs/AvatarPreview/Properties/Resources.resx b/Programs/AvatarPreview/Properties/Resources.resx new file mode 100644 index 00000000..ffecec85 --- /dev/null +++ b/Programs/AvatarPreview/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Programs/AvatarPreview/Properties/Settings.Designer.cs b/Programs/AvatarPreview/Properties/Settings.Designer.cs new file mode 100644 index 00000000..7b0838d0 --- /dev/null +++ b/Programs/AvatarPreview/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.1433 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace AvatarPreview.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/Programs/AvatarPreview/Properties/Settings.settings b/Programs/AvatarPreview/Properties/Settings.settings new file mode 100644 index 00000000..abf36c5d --- /dev/null +++ b/Programs/AvatarPreview/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/Programs/AvatarPreview/frmAvatar.Designer.cs b/Programs/AvatarPreview/frmAvatar.Designer.cs new file mode 100644 index 00000000..c06836d4 --- /dev/null +++ b/Programs/AvatarPreview/frmAvatar.Designer.cs @@ -0,0 +1,1169 @@ +namespace AvatarPreview +{ + partial class frmAvatar + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.menu = new System.Windows.Forms.MenuStrip(); + this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.opToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.lindenLabMeshToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.textureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); + this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.viewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.wireframeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.glControl = new Tao.Platform.Windows.SimpleOpenGlControl(); + this.tabControl = new System.Windows.Forms.TabControl(); + this.tavView = new System.Windows.Forms.TabPage(); + this.scrollZoom = new System.Windows.Forms.HScrollBar(); + this.label18 = new System.Windows.Forms.Label(); + this.label17 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.scrollRoll = new System.Windows.Forms.HScrollBar(); + this.scrollPitch = new System.Windows.Forms.HScrollBar(); + this.scrollYaw = new System.Windows.Forms.HScrollBar(); + this.tabMorphs = new System.Windows.Forms.TabPage(); + this.splitContainer2 = new System.Windows.Forms.SplitContainer(); + this.lstMorphs = new System.Windows.Forms.ListBox(); + this.tabTextures = new System.Windows.Forms.TabPage(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.lblSkirt = new System.Windows.Forms.Label(); + this.lblLower = new System.Windows.Forms.Label(); + this.lblUpper = new System.Windows.Forms.Label(); + this.lblEyes = new System.Windows.Forms.Label(); + this.lblHead = new System.Windows.Forms.Label(); + this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); + this.picHeadBodypaint = new System.Windows.Forms.PictureBox(); + this.label1 = new System.Windows.Forms.Label(); + this.picHair = new System.Windows.Forms.PictureBox(); + this.label2 = new System.Windows.Forms.Label(); + this.picHeadBake = new System.Windows.Forms.PictureBox(); + this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); + this.picEyesBake = new System.Windows.Forms.PictureBox(); + this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); + this.picUpperBodypaint = new System.Windows.Forms.PictureBox(); + this.label3 = new System.Windows.Forms.Label(); + this.picUpperGloves = new System.Windows.Forms.PictureBox(); + this.label4 = new System.Windows.Forms.Label(); + this.picUpperUndershirt = new System.Windows.Forms.PictureBox(); + this.label5 = new System.Windows.Forms.Label(); + this.picUpperShirt = new System.Windows.Forms.PictureBox(); + this.label6 = new System.Windows.Forms.Label(); + this.picUpperJacket = new System.Windows.Forms.PictureBox(); + this.label7 = new System.Windows.Forms.Label(); + this.picUpperBodyBake = new System.Windows.Forms.PictureBox(); + this.flowLayoutPanel4 = new System.Windows.Forms.FlowLayoutPanel(); + this.picLowerBodypaint = new System.Windows.Forms.PictureBox(); + this.label8 = new System.Windows.Forms.Label(); + this.picLowerUnderpants = new System.Windows.Forms.PictureBox(); + this.label9 = new System.Windows.Forms.Label(); + this.picLowerSocks = new System.Windows.Forms.PictureBox(); + this.label10 = new System.Windows.Forms.Label(); + this.picLowerShoes = new System.Windows.Forms.PictureBox(); + this.label11 = new System.Windows.Forms.Label(); + this.picLowerPants = new System.Windows.Forms.PictureBox(); + this.label12 = new System.Windows.Forms.Label(); + this.picLowerJacket = new System.Windows.Forms.PictureBox(); + this.label13 = new System.Windows.Forms.Label(); + this.picLowerBodyBake = new System.Windows.Forms.PictureBox(); + this.flowLayoutPanel5 = new System.Windows.Forms.FlowLayoutPanel(); + this.picSkirtBake = new System.Windows.Forms.PictureBox(); + this.tabAnimations = new System.Windows.Forms.TabPage(); + this.button1 = new System.Windows.Forms.Button(); + this.label14 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.skirtToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.menu.SuspendLayout(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.tabControl.SuspendLayout(); + this.tavView.SuspendLayout(); + this.tabMorphs.SuspendLayout(); + this.splitContainer2.Panel1.SuspendLayout(); + this.splitContainer2.SuspendLayout(); + this.tabTextures.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.flowLayoutPanel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picHeadBodypaint)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picHair)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picHeadBake)).BeginInit(); + this.flowLayoutPanel2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picEyesBake)).BeginInit(); + this.flowLayoutPanel3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperBodypaint)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperGloves)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperUndershirt)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperShirt)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperJacket)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperBodyBake)).BeginInit(); + this.flowLayoutPanel4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerBodypaint)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerUnderpants)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerSocks)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerShoes)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerPants)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerJacket)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerBodyBake)).BeginInit(); + this.flowLayoutPanel5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picSkirtBake)).BeginInit(); + this.tabAnimations.SuspendLayout(); + this.SuspendLayout(); + // + // menu + // + this.menu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.fileToolStripMenuItem, + this.viewToolStripMenuItem, + this.helpToolStripMenuItem}); + this.menu.Location = new System.Drawing.Point(0, 0); + this.menu.Name = "menu"; + this.menu.Size = new System.Drawing.Size(1117, 24); + this.menu.TabIndex = 1; + this.menu.Text = "menu"; + // + // fileToolStripMenuItem + // + this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.opToolStripMenuItem, + this.toolStripMenuItem2, + this.exitToolStripMenuItem}); + this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; + this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20); + this.fileToolStripMenuItem.Text = "File"; + // + // opToolStripMenuItem + // + this.opToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.lindenLabMeshToolStripMenuItem, + this.textureToolStripMenuItem}); + this.opToolStripMenuItem.Name = "opToolStripMenuItem"; + this.opToolStripMenuItem.Size = new System.Drawing.Size(111, 22); + this.opToolStripMenuItem.Text = "Open"; + // + // lindenLabMeshToolStripMenuItem + // + this.lindenLabMeshToolStripMenuItem.Name = "lindenLabMeshToolStripMenuItem"; + this.lindenLabMeshToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.lindenLabMeshToolStripMenuItem.Text = "Avatar"; + this.lindenLabMeshToolStripMenuItem.Click += new System.EventHandler(this.lindenLabMeshToolStripMenuItem_Click); + // + // textureToolStripMenuItem + // + this.textureToolStripMenuItem.Name = "textureToolStripMenuItem"; + this.textureToolStripMenuItem.Size = new System.Drawing.Size(123, 22); + this.textureToolStripMenuItem.Text = "Texture"; + this.textureToolStripMenuItem.Click += new System.EventHandler(this.textureToolStripMenuItem_Click); + // + // toolStripMenuItem2 + // + this.toolStripMenuItem2.Name = "toolStripMenuItem2"; + this.toolStripMenuItem2.Size = new System.Drawing.Size(108, 6); + // + // exitToolStripMenuItem + // + this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; + this.exitToolStripMenuItem.Size = new System.Drawing.Size(111, 22); + this.exitToolStripMenuItem.Text = "Exit"; + this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); + // + // viewToolStripMenuItem + // + this.viewToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.wireframeToolStripMenuItem, + this.skirtToolStripMenuItem}); + this.viewToolStripMenuItem.Name = "viewToolStripMenuItem"; + this.viewToolStripMenuItem.Size = new System.Drawing.Size(41, 20); + this.viewToolStripMenuItem.Text = "View"; + // + // wireframeToolStripMenuItem + // + this.wireframeToolStripMenuItem.Checked = true; + this.wireframeToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.wireframeToolStripMenuItem.Name = "wireframeToolStripMenuItem"; + this.wireframeToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.wireframeToolStripMenuItem.Text = "Wireframe"; + this.wireframeToolStripMenuItem.Click += new System.EventHandler(this.wireframeToolStripMenuItem_Click); + // + // helpToolStripMenuItem + // + this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aboutToolStripMenuItem}); + this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; + this.helpToolStripMenuItem.Size = new System.Drawing.Size(40, 20); + this.helpToolStripMenuItem.Text = "Help"; + // + // aboutToolStripMenuItem + // + this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(114, 22); + this.aboutToolStripMenuItem.Text = "About"; + this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 24); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.glControl); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.tabControl); + this.splitContainer1.Size = new System.Drawing.Size(1117, 653); + this.splitContainer1.SplitterDistance = 558; + this.splitContainer1.TabIndex = 2; + // + // glControl + // + this.glControl.AccumBits = ((byte)(0)); + this.glControl.AutoCheckErrors = false; + this.glControl.AutoFinish = false; + this.glControl.AutoMakeCurrent = true; + this.glControl.AutoSwapBuffers = true; + this.glControl.BackColor = System.Drawing.Color.Black; + this.glControl.ColorBits = ((byte)(32)); + this.glControl.DepthBits = ((byte)(16)); + this.glControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.glControl.Location = new System.Drawing.Point(0, 0); + this.glControl.Name = "glControl"; + this.glControl.Size = new System.Drawing.Size(558, 653); + this.glControl.StencilBits = ((byte)(0)); + this.glControl.TabIndex = 0; + this.glControl.Paint += new System.Windows.Forms.PaintEventHandler(this.glControl_Paint); + this.glControl.Resize += new System.EventHandler(this.glControl_Resize); + // + // tabControl + // + this.tabControl.Controls.Add(this.tavView); + this.tabControl.Controls.Add(this.tabMorphs); + this.tabControl.Controls.Add(this.tabTextures); + this.tabControl.Controls.Add(this.tabAnimations); + this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabControl.Location = new System.Drawing.Point(0, 0); + this.tabControl.Name = "tabControl"; + this.tabControl.SelectedIndex = 0; + this.tabControl.Size = new System.Drawing.Size(555, 653); + this.tabControl.TabIndex = 0; + // + // tavView + // + this.tavView.Controls.Add(this.scrollZoom); + this.tavView.Controls.Add(this.label18); + this.tavView.Controls.Add(this.label17); + this.tavView.Controls.Add(this.label16); + this.tavView.Controls.Add(this.label15); + this.tavView.Controls.Add(this.scrollRoll); + this.tavView.Controls.Add(this.scrollPitch); + this.tavView.Controls.Add(this.scrollYaw); + this.tavView.Location = new System.Drawing.Point(4, 22); + this.tavView.Name = "tavView"; + this.tavView.Size = new System.Drawing.Size(547, 627); + this.tavView.TabIndex = 3; + this.tavView.Text = "View"; + this.tavView.UseVisualStyleBackColor = true; + // + // scrollZoom + // + this.scrollZoom.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.scrollZoom.Location = new System.Drawing.Point(57, 85); + this.scrollZoom.Minimum = -200; + this.scrollZoom.Name = "scrollZoom"; + this.scrollZoom.Size = new System.Drawing.Size(442, 16); + this.scrollZoom.TabIndex = 25; + this.scrollZoom.Value = -50; + this.scrollZoom.ValueChanged += new System.EventHandler(this.scroll_ValueChanged); + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(11, 88); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(37, 13); + this.label18.TabIndex = 24; + this.label18.Text = "Zoom:"; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(11, 63); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(31, 13); + this.label17.TabIndex = 23; + this.label17.Text = "Yaw:"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(11, 38); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(34, 13); + this.label16.TabIndex = 22; + this.label16.Text = "Pitch:"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(11, 10); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(28, 13); + this.label15.TabIndex = 21; + this.label15.Text = "Roll:"; + // + // scrollRoll + // + this.scrollRoll.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.scrollRoll.Location = new System.Drawing.Point(57, 10); + this.scrollRoll.Maximum = 360; + this.scrollRoll.Name = "scrollRoll"; + this.scrollRoll.Size = new System.Drawing.Size(442, 16); + this.scrollRoll.TabIndex = 12; + this.scrollRoll.ValueChanged += new System.EventHandler(this.scroll_ValueChanged); + // + // scrollPitch + // + this.scrollPitch.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.scrollPitch.Location = new System.Drawing.Point(57, 35); + this.scrollPitch.Maximum = 360; + this.scrollPitch.Name = "scrollPitch"; + this.scrollPitch.Size = new System.Drawing.Size(442, 16); + this.scrollPitch.TabIndex = 13; + this.scrollPitch.ValueChanged += new System.EventHandler(this.scroll_ValueChanged); + // + // scrollYaw + // + this.scrollYaw.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right))); + this.scrollYaw.Location = new System.Drawing.Point(57, 60); + this.scrollYaw.Maximum = 360; + this.scrollYaw.Name = "scrollYaw"; + this.scrollYaw.Size = new System.Drawing.Size(442, 16); + this.scrollYaw.TabIndex = 14; + this.scrollYaw.ValueChanged += new System.EventHandler(this.scroll_ValueChanged); + // + // tabMorphs + // + this.tabMorphs.Controls.Add(this.splitContainer2); + this.tabMorphs.Location = new System.Drawing.Point(4, 22); + this.tabMorphs.Name = "tabMorphs"; + this.tabMorphs.Padding = new System.Windows.Forms.Padding(3); + this.tabMorphs.Size = new System.Drawing.Size(547, 627); + this.tabMorphs.TabIndex = 0; + this.tabMorphs.Text = "Morphs"; + this.tabMorphs.UseVisualStyleBackColor = true; + // + // splitContainer2 + // + this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer2.Location = new System.Drawing.Point(3, 3); + this.splitContainer2.Name = "splitContainer2"; + // + // splitContainer2.Panel1 + // + this.splitContainer2.Panel1.Controls.Add(this.lstMorphs); + this.splitContainer2.Size = new System.Drawing.Size(541, 621); + this.splitContainer2.SplitterDistance = 180; + this.splitContainer2.TabIndex = 0; + // + // lstMorphs + // + this.lstMorphs.Dock = System.Windows.Forms.DockStyle.Fill; + this.lstMorphs.FormattingEnabled = true; + this.lstMorphs.Location = new System.Drawing.Point(0, 0); + this.lstMorphs.Name = "lstMorphs"; + this.lstMorphs.Size = new System.Drawing.Size(180, 615); + this.lstMorphs.TabIndex = 0; + // + // tabTextures + // + this.tabTextures.Controls.Add(this.tableLayoutPanel1); + this.tabTextures.Location = new System.Drawing.Point(4, 22); + this.tabTextures.Name = "tabTextures"; + this.tabTextures.Padding = new System.Windows.Forms.Padding(3); + this.tabTextures.Size = new System.Drawing.Size(547, 627); + this.tabTextures.TabIndex = 1; + this.tabTextures.Text = "Textures"; + this.tabTextures.UseVisualStyleBackColor = true; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableLayoutPanel1.Controls.Add(this.lblSkirt, 0, 8); + this.tableLayoutPanel1.Controls.Add(this.lblLower, 0, 6); + this.tableLayoutPanel1.Controls.Add(this.lblUpper, 0, 4); + this.tableLayoutPanel1.Controls.Add(this.lblEyes, 0, 2); + this.tableLayoutPanel1.Controls.Add(this.lblHead, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel1, 0, 1); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel2, 0, 3); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel3, 0, 5); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel4, 0, 7); + this.tableLayoutPanel1.Controls.Add(this.flowLayoutPanel5, 0, 9); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 3); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 10; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 75F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(541, 621); + this.tableLayoutPanel1.TabIndex = 0; + // + // lblSkirt + // + this.lblSkirt.AutoSize = true; + this.lblSkirt.Dock = System.Windows.Forms.DockStyle.Left; + this.lblSkirt.Location = new System.Drawing.Point(3, 526); + this.lblSkirt.Name = "lblSkirt"; + this.lblSkirt.Size = new System.Drawing.Size(28, 20); + this.lblSkirt.TabIndex = 12; + this.lblSkirt.Text = "Skirt"; + this.lblSkirt.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblLower + // + this.lblLower.AutoSize = true; + this.lblLower.Dock = System.Windows.Forms.DockStyle.Left; + this.lblLower.Location = new System.Drawing.Point(3, 358); + this.lblLower.Name = "lblLower"; + this.lblLower.Size = new System.Drawing.Size(36, 20); + this.lblLower.TabIndex = 10; + this.lblLower.Text = "Lower"; + this.lblLower.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblUpper + // + this.lblUpper.AutoSize = true; + this.lblUpper.Dock = System.Windows.Forms.DockStyle.Left; + this.lblUpper.Location = new System.Drawing.Point(3, 190); + this.lblUpper.Name = "lblUpper"; + this.lblUpper.Size = new System.Drawing.Size(36, 20); + this.lblUpper.TabIndex = 8; + this.lblUpper.Text = "Upper"; + this.lblUpper.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblEyes + // + this.lblEyes.AutoSize = true; + this.lblEyes.Dock = System.Windows.Forms.DockStyle.Left; + this.lblEyes.Location = new System.Drawing.Point(3, 95); + this.lblEyes.Name = "lblEyes"; + this.lblEyes.Size = new System.Drawing.Size(30, 20); + this.lblEyes.TabIndex = 6; + this.lblEyes.Text = "Eyes"; + this.lblEyes.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // lblHead + // + this.lblHead.AutoSize = true; + this.lblHead.Dock = System.Windows.Forms.DockStyle.Left; + this.lblHead.Location = new System.Drawing.Point(3, 0); + this.lblHead.Name = "lblHead"; + this.lblHead.Size = new System.Drawing.Size(33, 20); + this.lblHead.TabIndex = 0; + this.lblHead.Text = "Head"; + this.lblHead.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // flowLayoutPanel1 + // + this.flowLayoutPanel1.Controls.Add(this.picHeadBodypaint); + this.flowLayoutPanel1.Controls.Add(this.label1); + this.flowLayoutPanel1.Controls.Add(this.picHair); + this.flowLayoutPanel1.Controls.Add(this.label2); + this.flowLayoutPanel1.Controls.Add(this.picHeadBake); + this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel1.Location = new System.Drawing.Point(3, 23); + this.flowLayoutPanel1.Name = "flowLayoutPanel1"; + this.flowLayoutPanel1.Size = new System.Drawing.Size(535, 69); + this.flowLayoutPanel1.TabIndex = 13; + // + // picHeadBodypaint + // + this.picHeadBodypaint.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picHeadBodypaint.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picHeadBodypaint.Cursor = System.Windows.Forms.Cursors.Hand; + this.picHeadBodypaint.Location = new System.Drawing.Point(3, 3); + this.picHeadBodypaint.Name = "picHeadBodypaint"; + this.picHeadBodypaint.Size = new System.Drawing.Size(64, 64); + this.picHeadBodypaint.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picHeadBodypaint.TabIndex = 0; + this.picHeadBodypaint.TabStop = false; + this.picHeadBodypaint.Tag = "Head"; + this.toolTip.SetToolTip(this.picHeadBodypaint, "Head Bodypaint"); + this.picHeadBodypaint.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(73, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(13, 70); + this.label1.TabIndex = 1; + this.label1.Text = "+"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picHair + // + this.picHair.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picHair.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picHair.Cursor = System.Windows.Forms.Cursors.Hand; + this.picHair.Location = new System.Drawing.Point(92, 3); + this.picHair.Name = "picHair"; + this.picHair.Size = new System.Drawing.Size(64, 64); + this.picHair.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picHair.TabIndex = 2; + this.picHair.TabStop = false; + this.picHair.Tag = "Head"; + this.toolTip.SetToolTip(this.picHair, "Hair"); + this.picHair.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label2 + // + this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(162, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(13, 70); + this.label2.TabIndex = 3; + this.label2.Text = "="; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picHeadBake + // + this.picHeadBake.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picHeadBake.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picHeadBake.Cursor = System.Windows.Forms.Cursors.Hand; + this.picHeadBake.Location = new System.Drawing.Point(181, 3); + this.picHeadBake.Name = "picHeadBake"; + this.picHeadBake.Size = new System.Drawing.Size(64, 64); + this.picHeadBake.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picHeadBake.TabIndex = 4; + this.picHeadBake.TabStop = false; + this.picHeadBake.Tag = "Bake"; + this.toolTip.SetToolTip(this.picHeadBake, "Head Final Bake"); + this.picHeadBake.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // flowLayoutPanel2 + // + this.flowLayoutPanel2.Controls.Add(this.picEyesBake); + this.flowLayoutPanel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel2.Location = new System.Drawing.Point(3, 118); + this.flowLayoutPanel2.Name = "flowLayoutPanel2"; + this.flowLayoutPanel2.Size = new System.Drawing.Size(535, 69); + this.flowLayoutPanel2.TabIndex = 14; + // + // picEyesBake + // + this.picEyesBake.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picEyesBake.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picEyesBake.Cursor = System.Windows.Forms.Cursors.Hand; + this.picEyesBake.Location = new System.Drawing.Point(3, 3); + this.picEyesBake.Name = "picEyesBake"; + this.picEyesBake.Size = new System.Drawing.Size(64, 64); + this.picEyesBake.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picEyesBake.TabIndex = 1; + this.picEyesBake.TabStop = false; + this.picEyesBake.Tag = "Bake"; + this.toolTip.SetToolTip(this.picEyesBake, "Eyes Final Bake"); + this.picEyesBake.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // flowLayoutPanel3 + // + this.flowLayoutPanel3.Controls.Add(this.picUpperBodypaint); + this.flowLayoutPanel3.Controls.Add(this.label3); + this.flowLayoutPanel3.Controls.Add(this.picUpperGloves); + this.flowLayoutPanel3.Controls.Add(this.label4); + this.flowLayoutPanel3.Controls.Add(this.picUpperUndershirt); + this.flowLayoutPanel3.Controls.Add(this.label5); + this.flowLayoutPanel3.Controls.Add(this.picUpperShirt); + this.flowLayoutPanel3.Controls.Add(this.label6); + this.flowLayoutPanel3.Controls.Add(this.picUpperJacket); + this.flowLayoutPanel3.Controls.Add(this.label7); + this.flowLayoutPanel3.Controls.Add(this.picUpperBodyBake); + this.flowLayoutPanel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel3.Location = new System.Drawing.Point(3, 213); + this.flowLayoutPanel3.Name = "flowLayoutPanel3"; + this.flowLayoutPanel3.Size = new System.Drawing.Size(535, 142); + this.flowLayoutPanel3.TabIndex = 15; + // + // picUpperBodypaint + // + this.picUpperBodypaint.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picUpperBodypaint.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picUpperBodypaint.Cursor = System.Windows.Forms.Cursors.Hand; + this.picUpperBodypaint.Location = new System.Drawing.Point(3, 3); + this.picUpperBodypaint.Name = "picUpperBodypaint"; + this.picUpperBodypaint.Size = new System.Drawing.Size(64, 64); + this.picUpperBodypaint.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picUpperBodypaint.TabIndex = 3; + this.picUpperBodypaint.TabStop = false; + this.picUpperBodypaint.Tag = "Upper"; + this.toolTip.SetToolTip(this.picUpperBodypaint, "Upper Bodypaint"); + this.picUpperBodypaint.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(73, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(13, 70); + this.label3.TabIndex = 4; + this.label3.Text = "+"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picUpperGloves + // + this.picUpperGloves.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picUpperGloves.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picUpperGloves.Cursor = System.Windows.Forms.Cursors.Hand; + this.picUpperGloves.Location = new System.Drawing.Point(92, 3); + this.picUpperGloves.Name = "picUpperGloves"; + this.picUpperGloves.Size = new System.Drawing.Size(64, 64); + this.picUpperGloves.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picUpperGloves.TabIndex = 5; + this.picUpperGloves.TabStop = false; + this.picUpperGloves.Tag = "Upper"; + this.toolTip.SetToolTip(this.picUpperGloves, "Gloves"); + this.picUpperGloves.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label4 + // + this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(162, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(13, 70); + this.label4.TabIndex = 6; + this.label4.Text = "+"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picUpperUndershirt + // + this.picUpperUndershirt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picUpperUndershirt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picUpperUndershirt.Cursor = System.Windows.Forms.Cursors.Hand; + this.picUpperUndershirt.Location = new System.Drawing.Point(181, 3); + this.picUpperUndershirt.Name = "picUpperUndershirt"; + this.picUpperUndershirt.Size = new System.Drawing.Size(64, 64); + this.picUpperUndershirt.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picUpperUndershirt.TabIndex = 7; + this.picUpperUndershirt.TabStop = false; + this.picUpperUndershirt.Tag = "Upper"; + this.toolTip.SetToolTip(this.picUpperUndershirt, "Undershirt"); + this.picUpperUndershirt.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(251, 0); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(13, 70); + this.label5.TabIndex = 8; + this.label5.Text = "+"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picUpperShirt + // + this.picUpperShirt.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picUpperShirt.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picUpperShirt.Cursor = System.Windows.Forms.Cursors.Hand; + this.picUpperShirt.Location = new System.Drawing.Point(270, 3); + this.picUpperShirt.Name = "picUpperShirt"; + this.picUpperShirt.Size = new System.Drawing.Size(64, 64); + this.picUpperShirt.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picUpperShirt.TabIndex = 9; + this.picUpperShirt.TabStop = false; + this.picUpperShirt.Tag = "Upper"; + this.toolTip.SetToolTip(this.picUpperShirt, "Shirt"); + this.picUpperShirt.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label6 + // + this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(340, 0); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(13, 70); + this.label6.TabIndex = 10; + this.label6.Text = "+"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picUpperJacket + // + this.picUpperJacket.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picUpperJacket.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picUpperJacket.Cursor = System.Windows.Forms.Cursors.Hand; + this.picUpperJacket.Location = new System.Drawing.Point(359, 3); + this.picUpperJacket.Name = "picUpperJacket"; + this.picUpperJacket.Size = new System.Drawing.Size(64, 64); + this.picUpperJacket.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picUpperJacket.TabIndex = 11; + this.picUpperJacket.TabStop = false; + this.picUpperJacket.Tag = "Upper"; + this.toolTip.SetToolTip(this.picUpperJacket, "Jacket"); + this.picUpperJacket.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label7 + // + this.label7.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(429, 0); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(13, 70); + this.label7.TabIndex = 12; + this.label7.Text = "="; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picUpperBodyBake + // + this.picUpperBodyBake.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picUpperBodyBake.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picUpperBodyBake.Cursor = System.Windows.Forms.Cursors.Hand; + this.picUpperBodyBake.Location = new System.Drawing.Point(448, 3); + this.picUpperBodyBake.Name = "picUpperBodyBake"; + this.picUpperBodyBake.Size = new System.Drawing.Size(64, 64); + this.picUpperBodyBake.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picUpperBodyBake.TabIndex = 13; + this.picUpperBodyBake.TabStop = false; + this.picUpperBodyBake.Tag = "Bake"; + this.toolTip.SetToolTip(this.picUpperBodyBake, "Upper Final Bake"); + this.picUpperBodyBake.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // flowLayoutPanel4 + // + this.flowLayoutPanel4.Controls.Add(this.picLowerBodypaint); + this.flowLayoutPanel4.Controls.Add(this.label8); + this.flowLayoutPanel4.Controls.Add(this.picLowerUnderpants); + this.flowLayoutPanel4.Controls.Add(this.label9); + this.flowLayoutPanel4.Controls.Add(this.picLowerSocks); + this.flowLayoutPanel4.Controls.Add(this.label10); + this.flowLayoutPanel4.Controls.Add(this.picLowerShoes); + this.flowLayoutPanel4.Controls.Add(this.label11); + this.flowLayoutPanel4.Controls.Add(this.picLowerPants); + this.flowLayoutPanel4.Controls.Add(this.label12); + this.flowLayoutPanel4.Controls.Add(this.picLowerJacket); + this.flowLayoutPanel4.Controls.Add(this.label13); + this.flowLayoutPanel4.Controls.Add(this.picLowerBodyBake); + this.flowLayoutPanel4.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel4.Location = new System.Drawing.Point(3, 381); + this.flowLayoutPanel4.Name = "flowLayoutPanel4"; + this.flowLayoutPanel4.Size = new System.Drawing.Size(535, 142); + this.flowLayoutPanel4.TabIndex = 16; + // + // picLowerBodypaint + // + this.picLowerBodypaint.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picLowerBodypaint.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picLowerBodypaint.Cursor = System.Windows.Forms.Cursors.Hand; + this.picLowerBodypaint.Location = new System.Drawing.Point(3, 3); + this.picLowerBodypaint.Name = "picLowerBodypaint"; + this.picLowerBodypaint.Size = new System.Drawing.Size(64, 64); + this.picLowerBodypaint.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picLowerBodypaint.TabIndex = 14; + this.picLowerBodypaint.TabStop = false; + this.picLowerBodypaint.Tag = "Lower"; + this.toolTip.SetToolTip(this.picLowerBodypaint, "Lower Bodypaint"); + this.picLowerBodypaint.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label8 + // + this.label8.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(73, 0); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(13, 70); + this.label8.TabIndex = 15; + this.label8.Text = "+"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picLowerUnderpants + // + this.picLowerUnderpants.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picLowerUnderpants.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picLowerUnderpants.Cursor = System.Windows.Forms.Cursors.Hand; + this.picLowerUnderpants.Location = new System.Drawing.Point(92, 3); + this.picLowerUnderpants.Name = "picLowerUnderpants"; + this.picLowerUnderpants.Size = new System.Drawing.Size(64, 64); + this.picLowerUnderpants.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picLowerUnderpants.TabIndex = 16; + this.picLowerUnderpants.TabStop = false; + this.picLowerUnderpants.Tag = "Lower"; + this.toolTip.SetToolTip(this.picLowerUnderpants, "Underpants"); + this.picLowerUnderpants.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label9 + // + this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(162, 0); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(13, 70); + this.label9.TabIndex = 17; + this.label9.Text = "+"; + this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picLowerSocks + // + this.picLowerSocks.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picLowerSocks.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picLowerSocks.Cursor = System.Windows.Forms.Cursors.Hand; + this.picLowerSocks.Location = new System.Drawing.Point(181, 3); + this.picLowerSocks.Name = "picLowerSocks"; + this.picLowerSocks.Size = new System.Drawing.Size(64, 64); + this.picLowerSocks.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picLowerSocks.TabIndex = 18; + this.picLowerSocks.TabStop = false; + this.picLowerSocks.Tag = "Lower"; + this.toolTip.SetToolTip(this.picLowerSocks, "Socks"); + this.picLowerSocks.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label10 + // + this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(251, 0); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(13, 70); + this.label10.TabIndex = 19; + this.label10.Text = "+"; + this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picLowerShoes + // + this.picLowerShoes.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picLowerShoes.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picLowerShoes.Cursor = System.Windows.Forms.Cursors.Hand; + this.picLowerShoes.Location = new System.Drawing.Point(270, 3); + this.picLowerShoes.Name = "picLowerShoes"; + this.picLowerShoes.Size = new System.Drawing.Size(64, 64); + this.picLowerShoes.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picLowerShoes.TabIndex = 20; + this.picLowerShoes.TabStop = false; + this.picLowerShoes.Tag = "Lower"; + this.toolTip.SetToolTip(this.picLowerShoes, "Shoes"); + this.picLowerShoes.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label11 + // + this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(340, 0); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(13, 70); + this.label11.TabIndex = 21; + this.label11.Text = "+"; + this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picLowerPants + // + this.picLowerPants.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picLowerPants.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picLowerPants.Cursor = System.Windows.Forms.Cursors.Hand; + this.picLowerPants.Location = new System.Drawing.Point(359, 3); + this.picLowerPants.Name = "picLowerPants"; + this.picLowerPants.Size = new System.Drawing.Size(64, 64); + this.picLowerPants.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picLowerPants.TabIndex = 22; + this.picLowerPants.TabStop = false; + this.picLowerPants.Tag = "Lower"; + this.toolTip.SetToolTip(this.picLowerPants, "Pants"); + this.picLowerPants.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label12 + // + this.label12.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(429, 0); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(13, 70); + this.label12.TabIndex = 23; + this.label12.Text = "+"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picLowerJacket + // + this.picLowerJacket.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picLowerJacket.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picLowerJacket.Cursor = System.Windows.Forms.Cursors.Hand; + this.picLowerJacket.Location = new System.Drawing.Point(448, 3); + this.picLowerJacket.Name = "picLowerJacket"; + this.picLowerJacket.Size = new System.Drawing.Size(64, 64); + this.picLowerJacket.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picLowerJacket.TabIndex = 24; + this.picLowerJacket.TabStop = false; + this.picLowerJacket.Tag = "Lower"; + this.toolTip.SetToolTip(this.picLowerJacket, "Jacket"); + this.picLowerJacket.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // label13 + // + this.label13.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom))); + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(518, 0); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(13, 70); + this.label13.TabIndex = 25; + this.label13.Text = "="; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // picLowerBodyBake + // + this.picLowerBodyBake.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; + this.picLowerBodyBake.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picLowerBodyBake.Cursor = System.Windows.Forms.Cursors.Hand; + this.picLowerBodyBake.Location = new System.Drawing.Point(3, 73); + this.picLowerBodyBake.Name = "picLowerBodyBake"; + this.picLowerBodyBake.Size = new System.Drawing.Size(64, 64); + this.picLowerBodyBake.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; + this.picLowerBodyBake.TabIndex = 26; + this.picLowerBodyBake.TabStop = false; + this.picLowerBodyBake.Tag = "Bake"; + this.toolTip.SetToolTip(this.picLowerBodyBake, "Lower Final Bake"); + this.picLowerBodyBake.MouseClick += new System.Windows.Forms.MouseEventHandler(this.pic_MouseClick); + // + // flowLayoutPanel5 + // + this.flowLayoutPanel5.Controls.Add(this.picSkirtBake); + this.flowLayoutPanel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.flowLayoutPanel5.Location = new System.Drawing.Point(3, 549); + this.flowLayoutPanel5.Name = "flowLayoutPanel5"; + this.flowLayoutPanel5.Size = new System.Drawing.Size(535, 69); + this.flowLayoutPanel5.TabIndex = 17; + // + // picSkirtBake + // + this.picSkirtBake.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.picSkirtBake.Location = new System.Drawing.Point(3, 3); + this.picSkirtBake.Name = "picSkirtBake"; + this.picSkirtBake.Size = new System.Drawing.Size(64, 64); + this.picSkirtBake.TabIndex = 2; + this.picSkirtBake.TabStop = false; + this.picSkirtBake.Tag = "Bake"; + this.toolTip.SetToolTip(this.picSkirtBake, "Skirt Final Bake"); + // + // tabAnimations + // + this.tabAnimations.Controls.Add(this.button1); + this.tabAnimations.Controls.Add(this.label14); + this.tabAnimations.Controls.Add(this.textBox1); + this.tabAnimations.Location = new System.Drawing.Point(4, 22); + this.tabAnimations.Name = "tabAnimations"; + this.tabAnimations.Size = new System.Drawing.Size(547, 627); + this.tabAnimations.TabIndex = 2; + this.tabAnimations.Text = "Animations"; + this.tabAnimations.UseVisualStyleBackColor = true; + // + // button1 + // + this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.button1.Location = new System.Drawing.Point(464, 20); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 2; + this.button1.Text = "Browse..."; + this.button1.UseVisualStyleBackColor = true; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(7, 7); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(168, 13); + this.label14.TabIndex = 1; + this.label14.Text = "Animation File (.animation or .bvh):"; + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Location = new System.Drawing.Point(10, 23); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(448, 20); + this.textBox1.TabIndex = 0; + // + // skirtToolStripMenuItem + // + this.skirtToolStripMenuItem.Name = "skirtToolStripMenuItem"; + this.skirtToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.skirtToolStripMenuItem.Text = "Skirt"; + this.skirtToolStripMenuItem.Click += new System.EventHandler(this.skirtToolStripMenuItem_Click); + // + // frmAvatar + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1117, 677); + this.Controls.Add(this.splitContainer1); + this.Controls.Add(this.menu); + this.Name = "frmAvatar"; + this.Text = "Avatar Preview"; + this.menu.ResumeLayout(false); + this.menu.PerformLayout(); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.ResumeLayout(false); + this.tabControl.ResumeLayout(false); + this.tavView.ResumeLayout(false); + this.tavView.PerformLayout(); + this.tabMorphs.ResumeLayout(false); + this.splitContainer2.Panel1.ResumeLayout(false); + this.splitContainer2.ResumeLayout(false); + this.tabTextures.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.tableLayoutPanel1.PerformLayout(); + this.flowLayoutPanel1.ResumeLayout(false); + this.flowLayoutPanel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picHeadBodypaint)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picHair)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picHeadBake)).EndInit(); + this.flowLayoutPanel2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picEyesBake)).EndInit(); + this.flowLayoutPanel3.ResumeLayout(false); + this.flowLayoutPanel3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperBodypaint)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperGloves)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperUndershirt)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperShirt)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperJacket)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picUpperBodyBake)).EndInit(); + this.flowLayoutPanel4.ResumeLayout(false); + this.flowLayoutPanel4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerBodypaint)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerUnderpants)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerSocks)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerShoes)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerPants)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerJacket)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.picLowerBodyBake)).EndInit(); + this.flowLayoutPanel5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.picSkirtBake)).EndInit(); + this.tabAnimations.ResumeLayout(false); + this.tabAnimations.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.MenuStrip menu; + private System.Windows.Forms.ToolStripMenuItem fileToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem opToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem lindenLabMeshToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem textureToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem viewToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem wireframeToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem helpToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; + private System.Windows.Forms.SplitContainer splitContainer1; + private Tao.Platform.Windows.SimpleOpenGlControl glControl; + private System.Windows.Forms.TabControl tabControl; + private System.Windows.Forms.TabPage tabMorphs; + private System.Windows.Forms.TabPage tabTextures; + private System.Windows.Forms.TabPage tabAnimations; + private System.Windows.Forms.SplitContainer splitContainer2; + private System.Windows.Forms.ListBox lstMorphs; + private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Label lblUpper; + private System.Windows.Forms.Label lblEyes; + private System.Windows.Forms.Label lblHead; + private System.Windows.Forms.Label lblSkirt; + private System.Windows.Forms.Label lblLower; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; + private System.Windows.Forms.PictureBox picHeadBodypaint; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel2; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel4; + private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel5; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.PictureBox picHair; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.PictureBox picHeadBake; + private System.Windows.Forms.PictureBox picEyesBake; + private System.Windows.Forms.PictureBox picUpperBodypaint; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.PictureBox picUpperGloves; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.PictureBox picUpperUndershirt; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.PictureBox picUpperShirt; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.PictureBox picUpperJacket; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.PictureBox picUpperBodyBake; + private System.Windows.Forms.PictureBox picLowerBodypaint; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.PictureBox picLowerUnderpants; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.PictureBox picLowerSocks; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.PictureBox picLowerShoes; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.PictureBox picLowerPants; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.PictureBox picLowerJacket; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.PictureBox picLowerBodyBake; + private System.Windows.Forms.PictureBox picSkirtBake; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TabPage tavView; + private System.Windows.Forms.HScrollBar scrollRoll; + private System.Windows.Forms.HScrollBar scrollPitch; + private System.Windows.Forms.HScrollBar scrollYaw; + private System.Windows.Forms.HScrollBar scrollZoom; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.ToolStripMenuItem skirtToolStripMenuItem; + private System.Windows.Forms.ToolTip toolTip; + } +} + diff --git a/Programs/AvatarPreview/frmAvatar.cs b/Programs/AvatarPreview/frmAvatar.cs new file mode 100644 index 00000000..964921c3 --- /dev/null +++ b/Programs/AvatarPreview/frmAvatar.cs @@ -0,0 +1,465 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.IO; +using System.Xml; + +using Tao.OpenGl; +using Tao.Platform.Windows; + +using OpenMetaverse; +using OpenMetaverse.Imaging; +using OpenMetaverse.Rendering; + +namespace AvatarPreview +{ + public partial class frmAvatar : Form + { + GridClient _client = new GridClient(); + Dictionary _meshes = new Dictionary(); + bool _wireframe = true; + bool _showSkirt = false; + + public frmAvatar() + { + InitializeComponent(); + + glControl.InitializeContexts(); + + Gl.glShadeModel(Gl.GL_SMOOTH); + Gl.glClearColor(0f, 0f, 0f, 0f); + + Gl.glClearDepth(1.0f); + Gl.glEnable(Gl.GL_DEPTH_TEST); + Gl.glDepthMask(Gl.GL_TRUE); + Gl.glDepthFunc(Gl.GL_LEQUAL); + Gl.glHint(Gl.GL_PERSPECTIVE_CORRECTION_HINT, Gl.GL_NICEST); + + glControl_Resize(null, null); + } + + private void lindenLabMeshToolStripMenuItem_Click(object sender, EventArgs e) + { + OpenFileDialog dialog = new OpenFileDialog(); + dialog.Filter = "avatar_lad.xml|avatar_lad.xml"; + + if (dialog.ShowDialog() == DialogResult.OK) + { + _meshes.Clear(); + + try + { + // Parse through avatar_lad.xml to find all of the mesh references + XmlDocument lad = new XmlDocument(); + lad.Load(dialog.FileName); + + XmlNodeList meshes = lad.GetElementsByTagName("mesh"); + + foreach (XmlNode meshNode in meshes) + { + string type = meshNode.Attributes.GetNamedItem("type").Value; + int lod = Int32.Parse(meshNode.Attributes.GetNamedItem("lod").Value); + string fileName = meshNode.Attributes.GetNamedItem("file_name").Value; + string minPixelWidth = meshNode.Attributes.GetNamedItem("min_pixel_width").Value; + + // Mash up the filename with the current path + fileName = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(dialog.FileName), fileName); + + GLMesh mesh = (_meshes.ContainsKey(type) ? _meshes[type] : new GLMesh(type)); + + if (lod == 0) + { + mesh.LoadMesh(fileName); + } + else + { + mesh.LoadLODMesh(lod, fileName); + } + + _meshes[type] = mesh; + glControl_Resize(null, null); + glControl.Invalidate(); + } + } + catch (Exception ex) + { + MessageBox.Show("Failed to load avatar mesh: " + ex.Message); + } + } + } + + private void textureToolStripMenuItem_Click(object sender, EventArgs e) + { + + } + + private void exitToolStripMenuItem_Click(object sender, EventArgs e) + { + + } + + private void wireframeToolStripMenuItem_Click(object sender, EventArgs e) + { + wireframeToolStripMenuItem.Checked = !wireframeToolStripMenuItem.Checked; + _wireframe = wireframeToolStripMenuItem.Checked; + + glControl.Invalidate(); + } + + private void skirtToolStripMenuItem_Click(object sender, EventArgs e) + { + skirtToolStripMenuItem.Checked = !skirtToolStripMenuItem.Checked; + _showSkirt = skirtToolStripMenuItem.Checked; + + glControl.Invalidate(); + } + + private void aboutToolStripMenuItem_Click(object sender, EventArgs e) + { + MessageBox.Show( + "Written by John Hurliman (http://www.jhurliman.org/)"); + } + + private void glControl_Paint(object sender, PaintEventArgs e) + { + Gl.glClear(Gl.GL_COLOR_BUFFER_BIT | Gl.GL_DEPTH_BUFFER_BIT); + Gl.glLoadIdentity(); + + // Setup wireframe or solid fill drawing mode + if (_wireframe) + Gl.glPolygonMode(Gl.GL_FRONT_AND_BACK, Gl.GL_LINE); + else + Gl.glPolygonMode(Gl.GL_FRONT, Gl.GL_FILL); + + // Push the world matrix + Gl.glPushMatrix(); + + Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY); + Gl.glEnableClientState(Gl.GL_TEXTURE_COORD_ARRAY); + + // World rotations + Gl.glRotatef((float)scrollRoll.Value, 1f, 0f, 0f); + Gl.glRotatef((float)scrollPitch.Value, 0f, 1f, 0f); + Gl.glRotatef((float)scrollYaw.Value, 0f, 0f, 1f); + + if (_meshes.Count > 0) + { + foreach (GLMesh mesh in _meshes.Values) + { + if (!_showSkirt && mesh.Name == "skirtMesh") + continue; + + Gl.glColor3f(1f, 1f, 1f); + + // Individual prim matrix + Gl.glPushMatrix(); + + //Gl.glTranslatef(mesh.Position.X, mesh.Position.Y, mesh.Position.Z); + + Gl.glRotatef(mesh.RotationAngles.X, 1f, 0f, 0f); + Gl.glRotatef(mesh.RotationAngles.Y, 0f, 1f, 0f); + Gl.glRotatef(mesh.RotationAngles.Z, 0f, 0f, 1f); + + Gl.glScalef(mesh.Scale.X, mesh.Scale.Y, mesh.Scale.Z); + + // TODO: Texturing + + Gl.glTexCoordPointer(2, Gl.GL_FLOAT, 0, mesh.RenderData.TexCoords); + Gl.glVertexPointer(3, Gl.GL_FLOAT, 0, mesh.RenderData.Vertices); + Gl.glDrawElements(Gl.GL_TRIANGLES, mesh.RenderData.Indices.Length, Gl.GL_UNSIGNED_SHORT, mesh.RenderData.Indices); + } + } + + // Pop the world matrix + Gl.glPopMatrix(); + + Gl.glDisableClientState(Gl.GL_TEXTURE_COORD_ARRAY); + Gl.glDisableClientState(Gl.GL_VERTEX_ARRAY); + + Gl.glFlush(); + } + + private void glControl_Resize(object sender, EventArgs e) + { + //Gl.glClearColor(0.39f, 0.58f, 0.93f, 1.0f); // Cornflower blue anyone? + Gl.glClearColor(0f, 0f, 0f, 1f); + + Gl.glPushMatrix(); + Gl.glMatrixMode(Gl.GL_PROJECTION); + Gl.glLoadIdentity(); + + Gl.glViewport(0, 0, glControl.Width, glControl.Height); + + Glu.gluPerspective(50.0d, 1.0d, 0.001d, 50d); + + LLVector3 center = LLVector3.Zero; + GLMesh head, lowerBody; + if (_meshes.TryGetValue("headMesh", out head) && _meshes.TryGetValue("lowerBodyMesh", out lowerBody)) + center = (head.RenderData.Center + lowerBody.RenderData.Center) / 2f; + + Glu.gluLookAt( + center.X, (double)scrollZoom.Value * 0.1d + center.Y, center.Z, + center.X, (double)scrollZoom.Value * 0.1d + center.Y + 1d, center.Z, + 0d, 0d, 1d); + + Gl.glMatrixMode(Gl.GL_MODELVIEW); + } + + private void scroll_ValueChanged(object sender, EventArgs e) + { + glControl_Resize(null, null); + glControl.Invalidate(); + } + + private void pic_MouseClick(object sender, MouseEventArgs e) + { + PictureBox control = (PictureBox)sender; + + OpenFileDialog dialog = new OpenFileDialog(); + // TODO: Setup a dialog.Filter for supported image types + + if (dialog.ShowDialog() == DialogResult.OK) + { + try + { + System.Drawing.Image image = System.Drawing.Image.FromFile(dialog.FileName); + + #region Dimensions Check + + if (control == picEyesBake) + { + // Eyes texture is 128x128 + if (Width != 128 || Height != 128) + { + Bitmap resized = new Bitmap(128, 128, image.PixelFormat); + Graphics graphics = Graphics.FromImage(resized); + + graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + graphics.DrawImage(image, 0, 0, 128, 128); + + image.Dispose(); + image = resized; + } + } + else + { + // Other textures are 512x512 + if (Width != 128 || Height != 128) + { + Bitmap resized = new Bitmap(512, 512, image.PixelFormat); + Graphics graphics = Graphics.FromImage(resized); + + graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; + graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; + graphics.DrawImage(image, 0, 0, 512, 512); + + image.Dispose(); + image = resized; + } + } + + #endregion Dimensions Check + + // Set the control image + control.Image = image; + } + catch (Exception ex) + { + MessageBox.Show("Failed to load image: " + ex.Message); + } + } + else + { + control.Image = null; + } + + #region Baking + + Dictionary paramValues = GetParamValues(); + Dictionary layers = + new Dictionary(); + int textureCount = 0; + + if ((string)control.Tag == "Head") + { + if (picHair.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.Hair, + new AssetTexture(new ManagedImage((Bitmap)picHair.Image))); + ++textureCount; + } + if (picHeadBodypaint.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.HeadBodypaint, + new AssetTexture(new ManagedImage((Bitmap)picHeadBodypaint.Image))); + ++textureCount; + } + + // Compute the head bake + Baker baker = new Baker( + _client, AppearanceManager.BakeType.Head, textureCount, paramValues); + + foreach (KeyValuePair kvp in layers) + baker.AddTexture(kvp.Key, kvp.Value, false); + + if (baker.BakedTexture != null) + { + AssetTexture bakeAsset = baker.BakedTexture; + // Baked textures use the alpha layer for other purposes, so we need to not use it + bakeAsset.Image.Channels = ManagedImage.ImageChannels.Color; + picHeadBake.Image = LoadTGAClass.LoadTGA(new MemoryStream(bakeAsset.Image.ExportTGA())); + } + else + { + MessageBox.Show("Failed to create the bake layer, unknown error"); + } + } + else if ((string)control.Tag == "Upper") + { + if (picUpperBodypaint.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.UpperBodypaint, + new AssetTexture(new ManagedImage((Bitmap)picUpperBodypaint.Image))); + ++textureCount; + } + if (picUpperGloves.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.UpperGloves, + new AssetTexture(new ManagedImage((Bitmap)picUpperGloves.Image))); + ++textureCount; + } + if (picUpperUndershirt.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.UpperUndershirt, + new AssetTexture(new ManagedImage((Bitmap)picUpperUndershirt.Image))); + ++textureCount; + } + if (picUpperShirt.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.UpperShirt, + new AssetTexture(new ManagedImage((Bitmap)picUpperShirt.Image))); + ++textureCount; + } + if (picUpperJacket.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.UpperJacket, + new AssetTexture(new ManagedImage((Bitmap)picUpperJacket.Image))); + ++textureCount; + } + + // Compute the upper body bake + Baker baker = new Baker( + _client, AppearanceManager.BakeType.UpperBody, textureCount, paramValues); + + foreach (KeyValuePair kvp in layers) + baker.AddTexture(kvp.Key, kvp.Value, false); + + if (baker.BakedTexture != null) + { + AssetTexture bakeAsset = baker.BakedTexture; + // Baked textures use the alpha layer for other purposes, so we need to not use it + bakeAsset.Image.Channels = ManagedImage.ImageChannels.Color; + picUpperBodyBake.Image = LoadTGAClass.LoadTGA(new MemoryStream(bakeAsset.Image.ExportTGA())); + } + else + { + MessageBox.Show("Failed to create the bake layer, unknown error"); + } + } + else if ((string)control.Tag == "Lower") + { + if (picLowerBodypaint.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.LowerBodypaint, + new AssetTexture(new ManagedImage((Bitmap)picLowerBodypaint.Image))); + ++textureCount; + } + if (picLowerUnderpants.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.LowerUnderpants, + new AssetTexture(new ManagedImage((Bitmap)picLowerUnderpants.Image))); + ++textureCount; + } + if (picLowerSocks.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.LowerSocks, + new AssetTexture(new ManagedImage((Bitmap)picLowerSocks.Image))); + ++textureCount; + } + if (picLowerShoes.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.LowerShoes, + new AssetTexture(new ManagedImage((Bitmap)picLowerShoes.Image))); + ++textureCount; + } + if (picLowerPants.Image != null) + { + layers.Add(AppearanceManager.TextureIndex.LowerPants, + new AssetTexture(new ManagedImage((Bitmap)picLowerPants.Image))); + ++textureCount; + } + + // Compute the lower body bake + Baker baker = new Baker( + _client, AppearanceManager.BakeType.LowerBody, textureCount, paramValues); + + foreach (KeyValuePair kvp in layers) + baker.AddTexture(kvp.Key, kvp.Value, false); + + if (baker.BakedTexture != null) + { + AssetTexture bakeAsset = baker.BakedTexture; + // Baked textures use the alpha layer for other purposes, so we need to not use it + bakeAsset.Image.Channels = ManagedImage.ImageChannels.Color; + picLowerBodyBake.Image = LoadTGAClass.LoadTGA(new MemoryStream(bakeAsset.Image.ExportTGA())); + } + else + { + MessageBox.Show("Failed to create the bake layer, unknown error"); + } + } + else if ((string)control.Tag == "Bake") + { + // Bake image has been set manually, no need to manually calculate a bake + // FIXME: + } + + #endregion Baking + } + + private Dictionary GetParamValues() + { + Dictionary paramValues = new Dictionary(VisualParams.Params.Count); + + foreach (KeyValuePair kvp in VisualParams.Params) + { + VisualParam vp = kvp.Value; + paramValues.Add(vp.ParamID, vp.DefaultValue); + } + + return paramValues; + } + + private static System.Drawing.Image ConvertToRGB(System.Drawing.Image image) + { + int width = image.Width; + int height = image.Height; + + Bitmap noAlpha = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); + Graphics graphics = Graphics.FromImage(noAlpha); + graphics.DrawImage(image, 0, 0, width, height); + + return noAlpha; + } + + private static bool IsPowerOfTwo(uint n) + { + return (n & (n - 1)) == 0 && n != 0; + } + } +} diff --git a/Programs/AvatarPreview/frmAvatar.resx b/Programs/AvatarPreview/frmAvatar.resx new file mode 100644 index 00000000..c85db068 --- /dev/null +++ b/Programs/AvatarPreview/frmAvatar.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + 96, 17 + + \ No newline at end of file diff --git a/bin/Prebuild.exe b/bin/Prebuild.exe index bbef8aed..93f964b5 100644 Binary files a/bin/Prebuild.exe and b/bin/Prebuild.exe differ diff --git a/prebuild.xml b/prebuild.xml index 8dd126e1..326fab18 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1,6 +1,6 @@ - - + + TRACE;DEBUG @@ -151,7 +151,35 @@ - + + + + ../../bin/ + + + + + ../../bin/ + + + + ../../bin/ + + + + + + + + + + + frmAvatarPreview.resx + + + + + ../../bin/ @@ -219,7 +247,7 @@ - + ../../bin/ @@ -240,16 +268,16 @@ - + - frmPrimPreview.resx + frmPrimWorkshop.resx - + ../../bin/ @@ -275,7 +303,7 @@ - + ../../bin/ @@ -368,7 +396,7 @@ - + ../../../bin/ @@ -394,7 +422,7 @@ - + ../../../bin/ @@ -419,7 +447,7 @@ - + ../../../bin/ @@ -444,7 +472,7 @@ - + ../../../bin/