diff --git a/libsecondlife-cs/AssetSystem/AppearanceManager.cs b/libsecondlife-cs/AssetSystem/AppearanceManager.cs index 07cdd2b7..9ec68933 100644 --- a/libsecondlife-cs/AssetSystem/AppearanceManager.cs +++ b/libsecondlife-cs/AssetSystem/AppearanceManager.cs @@ -347,84 +347,51 @@ namespace libsecondlife.AssetSystem // Add Texture Data p.ObjectData.TextureEntry = AgentTextureEntry.ToBytes(); - // Add Visual Params - Dictionary VisualParams = GetAssetParamsAsVisualParams(); + p.VisualParam = new AgentSetAppearancePacket.VisualParamBlock[218]; - for (int i = 0; i < 218; i++) + + // Add Visual Params + lock (AgentAppearanceParams) { - p.VisualParam[i] = new AgentSetAppearancePacket.VisualParamBlock(); - - if (VisualParams.ContainsKey(i)) + for (int i = 0; i < 218; i++) { - p.VisualParam[i].ParamValue = VisualParams[i]; - } - else - { - int paramid = GetParamID(i + 1); + VisualParam param = VisualParams.Params[i]; + p.VisualParam[i] = new AgentSetAppearancePacket.VisualParamBlock(); - if (!libsecondlife.VisualParams.Params.ContainsKey(paramid)) + if (AgentAppearanceParams.ContainsKey(param.ParamID)) { - Client.Log("Unknown VisualParam ID encountered :: " + paramid, Helpers.LogLevel.Debug); + p.VisualParam[i].ParamValue = Helpers.FloatToByte(AgentAppearanceParams[param.ParamID], + param.MinValue, param.MaxValue); + } + else + { + // Use the default value for this parameter + p.VisualParam[i].ParamValue = Helpers.FloatToByte(param.DefaultValue, param.MinValue, + param.MaxValue); } - - VisualParam vp = libsecondlife.VisualParams.Params[paramid]; - p.VisualParam[i].ParamValue = Helpers.FloatToByte(vp.DefaultValue, vp.MinValue, vp.MaxValue); } } // Add Size Data - p.AgentData.Size = GetAgentSizeFromVisualParams(VisualParams); + p.AgentData.Size = GetAgentSizeFromVisualParam(Helpers.ByteToFloat(p.VisualParam[25].ParamValue, + VisualParams.Params[25].MinValue, VisualParams.Params[25].MaxValue)); Client.Network.SendPacket(p); } - - /// - /// Convert the morph params as they are stored in assets, to the byte values needed for - /// AgentSetAppearance packet - /// - /// Visual Param information for AgentSetAppearance packets - protected Dictionary GetAssetParamsAsVisualParams() - { - Dictionary VisualParams = new Dictionary(); - - int packetIdx = 0; - - lock (AgentAppearanceParams) - { - foreach (KeyValuePair kvp in AgentAppearanceParams) - { - packetIdx = AppearanceManager.GetAgentSetAppearanceIndex(kvp.Key) - 1; //TODO/FIXME: this should be zero indexed, not 1 based. - - VisualParam vp = libsecondlife.VisualParams.Params[kvp.Key]; - VisualParams[packetIdx] = Helpers.FloatToByte(kvp.Value, vp.MinValue, vp.MaxValue); - } - } - - return VisualParams; - } - /// /// Determine agent size for AgentSetAppearance based on Visual Param data. /// - /// + /// /// - protected LLVector3 GetAgentSizeFromVisualParams(Dictionary VisualParams) + protected LLVector3 GetAgentSizeFromVisualParam(float heightParam) { - if (VisualParams.ContainsKey(25)) - { - float AV_Height_Range = 2.025506f - 1.50856f; - float AV_Height = 1.50856f + (((float)VisualParams[25] / 255.0f) * AV_Height_Range); - return new LLVector3(0.45f, 0.6f, AV_Height); - } - else - { - return new LLVector3(0.45f, 0.6f, 1.0f); - } + float AV_Height_Range = 2.025506f - 1.50856f; + float AV_Height = 1.50856f + ((heightParam / 255.0f) * AV_Height_Range); + return new LLVector3(0.45f, 0.6f, AV_Height); + //return new LLVector3(0.45f, 0.6f, 1.0f); } - - #region Callback Handlers private void AgentWearablesUpdateCallbackHandler(Packet packet, Simulator simulator) @@ -525,477 +492,6 @@ namespace libsecondlife.AssetSystem } } - - #endregion - - #region Lookup Tables - - /// - /// Convert a Visual Params index number from the ParamID provided in Assets and from avatar_lad.xml - /// - /// - /// - protected static int GetAgentSetAppearanceIndex(int AssetParamID) - { - switch (AssetParamID) - { - case 1: return 1; - case 2: return 2; - case 4: return 3; - case 5: return 4; - case 6: return 5; - case 7: return 6; - case 8: return 7; - case 10: return 8; - case 11: return 9; - case 12: return 10; - case 13: return 11; - case 14: return 12; - case 15: return 13; - case 16: return 14; - case 17: return 15; - case 18: return 16; - case 19: return 17; - case 20: return 18; - case 21: return 19; - case 22: return 20; - case 23: return 21; - case 24: return 22; - case 25: return 23; - case 27: return 24; - case 31: return 25; - case 33: return 26; - case 34: return 27; - case 35: return 28; - case 36: return 29; - case 37: return 30; - case 38: return 31; - case 80: return 32; - case 93: return 33; - case 98: return 34; - case 99: return 35; - case 105: return 36; - case 108: return 37; - case 110: return 38; - case 111: return 39; - case 112: return 40; - case 113: return 41; - case 114: return 42; - case 115: return 43; - case 116: return 44; - case 117: return 45; - case 119: return 46; - case 130: return 47; - case 131: return 48; - case 132: return 49; - case 133: return 50; - case 134: return 51; - case 135: return 52; - case 136: return 53; - case 137: return 54; - case 140: return 55; - case 141: return 56; - case 142: return 57; - case 143: return 58; - case 150: return 59; - case 155: return 60; - case 157: return 61; - case 162: return 62; - case 163: return 63; - case 165: return 64; - case 166: return 65; - case 167: return 66; - case 168: return 67; - case 169: return 68; - case 177: return 69; - case 181: return 70; - case 182: return 71; - case 183: return 72; - case 184: return 73; - case 185: return 74; - case 192: return 75; - case 193: return 76; - case 196: return 77; - case 198: return 78; - case 503: return 79; - case 505: return 80; - case 506: return 81; - case 507: return 82; - case 508: return 83; - case 513: return 84; - case 514: return 85; - case 515: return 86; - case 517: return 87; - case 518: return 88; - case 603: return 89; - case 604: return 90; - case 605: return 91; - case 606: return 92; - case 607: return 93; - case 608: return 94; - case 609: return 95; - case 616: return 96; - case 617: return 97; - case 619: return 98; - case 624: return 99; - case 625: return 100; - case 629: return 101; - case 637: return 102; - case 638: return 103; - case 646: return 104; - case 647: return 105; - case 649: return 106; - case 650: return 107; - case 652: return 108; - case 653: return 109; - case 654: return 110; - case 656: return 111; - case 659: return 112; - case 662: return 113; - case 663: return 114; - case 664: return 115; - case 665: return 116; - case 674: return 117; - case 675: return 118; - case 676: return 119; - case 678: return 120; - case 682: return 121; - case 683: return 122; - case 684: return 123; - case 685: return 124; - case 690: return 125; - case 692: return 126; - case 693: return 127; - case 700: return 128; - case 701: return 129; - case 702: return 130; - case 703: return 131; - case 704: return 132; - case 705: return 133; - case 706: return 134; - case 707: return 135; - case 708: return 136; - case 709: return 137; - case 710: return 138; - case 711: return 139; - case 712: return 140; - case 713: return 141; - case 714: return 142; - case 715: return 143; - case 750: return 144; - case 752: return 145; - case 753: return 146; - case 754: return 147; - case 755: return 148; - case 756: return 149; - case 757: return 150; - case 758: return 151; - case 759: return 152; - case 760: return 153; - case 762: return 154; - case 763: return 155; - case 764: return 156; - case 765: return 157; - case 769: return 158; - case 773: return 159; - case 775: return 160; - case 779: return 161; - case 780: return 162; - case 781: return 163; - case 785: return 164; - case 789: return 165; - case 795: return 166; - case 796: return 167; - case 799: return 168; - case 800: return 169; - case 801: return 170; - case 802: return 171; - case 803: return 172; - case 804: return 173; - case 805: return 174; - case 806: return 175; - case 807: return 176; - case 808: return 177; - case 812: return 178; - case 813: return 179; - case 814: return 180; - case 815: return 181; - case 816: return 182; - case 817: return 183; - case 818: return 184; - case 819: return 185; - case 820: return 186; - case 821: return 187; - case 822: return 188; - case 823: return 189; - case 824: return 190; - case 825: return 191; - case 826: return 192; - case 827: return 193; - case 828: return 194; - case 829: return 195; - case 830: return 196; - case 834: return 197; - case 835: return 198; - case 836: return 199; - case 840: return 200; - case 841: return 201; - case 842: return 202; - case 844: return 203; - case 848: return 204; - case 858: return 205; - case 859: return 206; - case 860: return 207; - case 861: return 208; - case 862: return 209; - case 863: return 210; - case 868: return 211; - case 869: return 212; - case 877: return 213; - case 879: return 214; - case 880: return 215; - case 921: return 216; - case 922: return 217; - case 923: return 218; - - default: - throw new Exception("Unknown Asset/Avatar_lad.xml ParamID: " + AssetParamID); - } - } - - /// - /// Get the Asset ParamID (avatar_lad.xml) value based on a Visual Param index from AgentSetApperance - /// - /// - /// - protected static int GetParamID(int VisualParamIdx) - { - switch (VisualParamIdx) - { - case 1: return 1; - case 2: return 2; - case 3: return 4; - case 4: return 5; - case 5: return 6; - case 6: return 7; - case 7: return 8; - case 8: return 10; - case 9: return 11; - case 10: return 12; - case 11: return 13; - case 12: return 14; - case 13: return 15; - case 14: return 16; - case 15: return 17; - case 16: return 18; - case 17: return 19; - case 18: return 20; - case 19: return 21; - case 20: return 22; - case 21: return 23; - case 22: return 24; - case 23: return 25; - case 24: return 27; - case 25: return 31; - case 26: return 33; - case 27: return 34; - case 28: return 35; - case 29: return 36; - case 30: return 37; - case 31: return 38; - case 32: return 80; - case 33: return 93; - case 34: return 98; - case 35: return 99; - case 36: return 105; - case 37: return 108; - case 38: return 110; - case 39: return 111; - case 40: return 112; - case 41: return 113; - case 42: return 114; - case 43: return 115; - case 44: return 116; - case 45: return 117; - case 46: return 119; - case 47: return 130; - case 48: return 131; - case 49: return 132; - case 50: return 133; - case 51: return 134; - case 52: return 135; - case 53: return 136; - case 54: return 137; - case 55: return 140; - case 56: return 141; - case 57: return 142; - case 58: return 143; - case 59: return 150; - case 60: return 155; - case 61: return 157; - case 62: return 162; - case 63: return 163; - case 64: return 165; - case 65: return 166; - case 66: return 167; - case 67: return 168; - case 68: return 169; - case 69: return 177; - case 70: return 181; - case 71: return 182; - case 72: return 183; - case 73: return 184; - case 74: return 185; - case 75: return 192; - case 76: return 193; - case 77: return 196; - case 78: return 198; - case 79: return 503; - case 80: return 505; - case 81: return 506; - case 82: return 507; - case 83: return 508; - case 84: return 513; - case 85: return 514; - case 86: return 515; - case 87: return 517; - case 88: return 518; - case 89: return 603; - case 90: return 604; - case 91: return 605; - case 92: return 606; - case 93: return 607; - case 94: return 608; - case 95: return 609; - case 96: return 616; - case 97: return 617; - case 98: return 619; - case 99: return 624; - case 100: return 625; - case 101: return 629; - case 102: return 637; - case 103: return 638; - case 104: return 646; - case 105: return 647; - case 106: return 649; - case 107: return 650; - case 108: return 652; - case 109: return 653; - case 110: return 654; - case 111: return 656; - case 112: return 659; - case 113: return 662; - case 114: return 663; - case 115: return 664; - case 116: return 665; - case 117: return 674; - case 118: return 675; - case 119: return 676; - case 120: return 678; - case 121: return 682; - case 122: return 683; - case 123: return 684; - case 124: return 685; - case 125: return 690; - case 126: return 692; - case 127: return 693; - case 128: return 700; - case 129: return 701; - case 130: return 702; - case 131: return 703; - case 132: return 704; - case 133: return 705; - case 134: return 706; - case 135: return 707; - case 136: return 708; - case 137: return 709; - case 138: return 710; - case 139: return 711; - case 140: return 712; - case 141: return 713; - case 142: return 714; - case 143: return 715; - case 144: return 750; - case 145: return 752; - case 146: return 753; - case 147: return 754; - case 148: return 755; - case 149: return 756; - case 150: return 757; - case 151: return 758; - case 152: return 759; - case 153: return 760; - case 154: return 762; - case 155: return 763; - case 156: return 764; - case 157: return 765; - case 158: return 769; - case 159: return 773; - case 160: return 775; - case 161: return 779; - case 162: return 780; - case 163: return 781; - case 164: return 785; - case 165: return 789; - case 166: return 795; - case 167: return 796; - case 168: return 799; - case 169: return 800; - case 170: return 801; - case 171: return 802; - case 172: return 803; - case 173: return 804; - case 174: return 805; - case 175: return 806; - case 176: return 807; - case 177: return 808; - case 178: return 812; - case 179: return 813; - case 180: return 814; - case 181: return 815; - case 182: return 816; - case 183: return 817; - case 184: return 818; - case 185: return 819; - case 186: return 820; - case 187: return 821; - case 188: return 822; - case 189: return 823; - case 190: return 824; - case 191: return 825; - case 192: return 826; - case 193: return 827; - case 194: return 828; - case 195: return 829; - case 196: return 830; - case 197: return 834; - case 198: return 835; - case 199: return 836; - case 200: return 840; - case 201: return 841; - case 202: return 842; - case 203: return 844; - case 204: return 848; - case 205: return 858; - case 206: return 859; - case 207: return 860; - case 208: return 861; - case 209: return 862; - case 210: return 863; - case 211: return 868; - case 212: return 869; - case 213: return 877; - case 214: return 879; - case 215: return 880; - case 216: return 921; - case 217: return 922; - case 218: return 923; - - default: - throw new Exception("Unknown Visual Param (AgentSetApperance) index: " + VisualParamIdx); - } - } - #endregion } } diff --git a/libsecondlife-cs/GridManager.cs b/libsecondlife-cs/GridManager.cs index 8afafd90..2ed2c505 100644 --- a/libsecondlife-cs/GridManager.cs +++ b/libsecondlife-cs/GridManager.cs @@ -89,24 +89,35 @@ namespace libsecondlife /// public class GridManager { + public enum MapLayerType : uint + { + Objects = 0, + Terrain = 1 + } + + /// /// Triggered when a new region is discovered through GridManager /// public event GridRegionCallback OnRegionAdd; + // FIXME: These publically accessible dictionaries are a recipe for multi-threading disaster + /// A dictionary of all the regions, indexed by region ID public Dictionary Regions = new Dictionary(); - /// A dictionary of all the regions, indexed by region handle public Dictionary RegionsByHandle = new Dictionary(); - + /// Unknown + public float SunPhase { get { return sunPhase; } } /// Current direction of the sun - public LLVector3 SunDirection; + public LLVector3 SunDirection { get { return sunDirection; } } + /// Current angular velocity of the sun + public LLVector3 SunAngVelocity { get { return sunAngVelocity; } } private SecondLife Client; - // This is used for BeginGetGridRegion - private GridRegionCallback OnRegionAddInternal; - private string BeginGetGridRegionName; + private float sunPhase = 0.0f; + private LLVector3 sunDirection = LLVector3.Zero; + private LLVector3 sunAngVelocity = LLVector3.Zero; /// /// Constructor @@ -115,43 +126,22 @@ namespace libsecondlife public GridManager(SecondLife client) { Client = client; - SunDirection = LLVector3.Zero; Client.Network.RegisterCallback(PacketType.MapBlockReply, new NetworkManager.PacketCallback(MapBlockReplyHandler)); Client.Network.RegisterCallback(PacketType.SimulatorViewerTimeMessage, new NetworkManager.PacketCallback(TimeMessageHandler)); } - /// - /// If the client does not have data on this region already, request the region data for it - /// - /// Name of the region to add - public void AddSim(string name) - { - name = name.ToLower(); - - if(!Regions.ContainsKey(name)) - { - MapNameRequestPacket map = new MapNameRequestPacket(); - - map.AgentData.AgentID = Client.Network.AgentID; - map.AgentData.SessionID = Client.Network.SessionID; - map.NameData.Name = Helpers.StringToField(name); - - Client.Network.SendPacket(map); - } - } - /// /// Fire off packet for Estate/Island sim data request. /// - public void AddEstateSims() + public void RequestEstateSims(MapLayerType layer) { MapLayerRequestPacket request = new MapLayerRequestPacket(); request.AgentData.AgentID = Client.Network.AgentID; request.AgentData.SessionID = Client.Network.SessionID; request.AgentData.Godlike = true; - request.AgentData.Flags = 0; + request.AgentData.Flags = (uint)layer; request.AgentData.EstateID = 0; // TODO get a better value here. Client.Network.SendPacket(request); @@ -160,14 +150,14 @@ namespace libsecondlife /// /// Fire off packet for Linden/Mainland sim data request. /// - public void AddLindenSims() + public void RequestLindenSims(MapLayerType layer) { MapBlockRequestPacket request = new MapBlockRequestPacket(); request.AgentData.AgentID = Client.Network.AgentID; request.AgentData.SessionID = Client.Network.SessionID; - request.AgentData.EstateID = 0; - request.AgentData.Flags = 0; + request.AgentData.EstateID = 0; // TODO: ? + request.AgentData.Flags = (uint)layer; request.PositionData.MaxX = 65535; request.PositionData.MaxY = 65535; request.PositionData.MinX = 0; @@ -182,47 +172,34 @@ namespace libsecondlife /// LL's protocol for some reason uses a different request packet for Estate sims. /// /// - public void AddAllSims() + public void RequestAllSims(MapLayerType layer) { - AddLindenSims(); - AddEstateSims(); + RequestLindenSims(layer); + RequestEstateSims(layer); } /// /// Begin process to get information for a Region /// - /// Region Name you're requesting data for - /// CallBack being used to process the response - public void BeginGetGridRegion(string name, GridRegionCallback grc) + /// Region name you're requesting data for + public void BeginGetGridRegion(string name) { - OnRegionAddInternal = grc; + MapNameRequestPacket map = new MapNameRequestPacket(); - BeginGetGridRegionName = name.ToLower(); + map.AgentData.AgentID = Client.Network.AgentID; + map.AgentData.SessionID = Client.Network.SessionID; + map.NameData.Name = Helpers.StringToField(name.ToLower()); - if (Regions.ContainsKey(BeginGetGridRegionName)) - { - OnRegionAdd(Regions[BeginGetGridRegionName]); - } - else - { - MapNameRequestPacket map = new MapNameRequestPacket(); - - map.AgentData.AgentID = Client.Network.AgentID; - map.AgentData.SessionID = Client.Network.SessionID; - map.NameData.Name = Helpers.StringToField(BeginGetGridRegionName); - - Client.Network.SendPacket(map); - } + Client.Network.SendPacket(map); } /// - /// Get grid region information using the region name + /// Get grid region information using the region name, this function + /// will block until it can find the region or gives up /// - /// - /// regiondata = GetGridRegion("Ahern"); - /// /// Name of sim you're looking for /// GridRegion for the sim you're looking for, or null if it's not available + /// GridRegion regiondata = GetGridRegion("Ahern"); public GridRegion GetGridRegion(string name) { name = name.ToLower(); @@ -233,7 +210,7 @@ namespace libsecondlife } else { - AddSim(name); + BeginGetGridRegion(name); // FIXME: We shouldn't be sleeping in a library call, hopefully this goes away soon System.Threading.Thread.Sleep(1000); @@ -276,23 +253,13 @@ namespace libsecondlife region.MapImageID = block.MapImageID; region.RegionHandle = Helpers.UIntsToLong((uint)region.X * (uint)256, (uint)region.Y * (uint)256); - lock (Regions) - { - Regions[region.Name.ToLower()] = region; - } + lock (Regions) Regions[region.Name.ToLower()] = region; + lock (RegionsByHandle) RegionsByHandle[region.RegionHandle] = region; - lock (RegionsByHandle) - { - RegionsByHandle[region.RegionHandle] = region; - } - - if (OnRegionAddInternal != null && BeginGetGridRegionName == region.Name.ToLower()) + if (OnRegionAdd != null) { - OnRegionAddInternal(region); - } - else if (OnRegionAdd != null) - { - OnRegionAdd(region); + try { OnRegionAdd(region); } + catch (Exception e) { Client.Log(e.ToString(), Helpers.LogLevel.Error); } } } } @@ -305,7 +272,13 @@ namespace libsecondlife /// Unused private void TimeMessageHandler(Packet packet, Simulator simulator) { - SunDirection = ((SimulatorViewerTimeMessagePacket)packet).TimeInfo.SunDirection; + SimulatorViewerTimeMessagePacket time = (SimulatorViewerTimeMessagePacket)packet; + + sunPhase = time.TimeInfo.SunPhase; + sunDirection = time.TimeInfo.SunDirection; + sunAngVelocity = time.TimeInfo.SunAngVelocity; + + // TODO: Does anyone have a use for the time stuff? } } } diff --git a/libsecondlife-cs/MainAvatar.cs b/libsecondlife-cs/MainAvatar.cs index 82693977..6568dfbd 100644 --- a/libsecondlife-cs/MainAvatar.cs +++ b/libsecondlife-cs/MainAvatar.cs @@ -358,10 +358,10 @@ namespace libsecondlife #endregion - /// Your (client) Avatar UUID, asset server + /// Your (client) avatar UUID public LLUUID ID = LLUUID.Zero; - /// Your (client) Avatar ID, local to Region/sim - public uint LocalID; + /// Your (client) avatar ID, local to the current region/sim + public uint LocalID = 0; /// Avatar First Name (i.e. Philip) public string FirstName = String.Empty; /// Avatar Last Name (i.e. Linden) @@ -395,33 +395,17 @@ namespace libsecondlife /// Used for camera and control key state tracking public MainAvatarStatus Status; /// The UUID of your root inventory folder - public LLUUID InventoryRootFolderUUID; + public LLUUID InventoryRootFolderUUID = LLUUID.Zero; - /// Gets the health of the agent - public float Health - { - get { return health; } - } - + public float Health { get { return health; } } /// Gets the current balance of the agent - public int Balance - { - get { return balance; } - } - + public int Balance { get { return balance; } } /// Gets the local ID of the prim the avatar is sitting on, /// zero if the avatar is not currently sitting - public uint SittingOn - { - get { return sittingOn; } - } - + public uint SittingOn { get { return sittingOn; } } /// Gets the UUID of the active group. - public LLUUID ActiveGroup - { - get { return activeGroup; } - } + public LLUUID ActiveGroup { get { return activeGroup; } } internal uint sittingOn = 0; internal string teleportMessage = String.Empty; @@ -440,10 +424,9 @@ namespace libsecondlife /// public MainAvatar(SecondLife client) { - NetworkManager.PacketCallback callback; Client = client; - Status = new MainAvatarStatus(Client); + NetworkManager.PacketCallback callback; // Coarse location callback Client.Network.RegisterCallback(PacketType.CoarseLocationUpdate, new NetworkManager.PacketCallback(CoarseLocationHandler)); @@ -969,7 +952,10 @@ namespace libsecondlife } else { - while (attempts++ < 5) + // FIXME: It's been my experience that a request will either work or not work. + // Hammering the server with continual requests doesn't make it wake up and + // decide "Hey! You must really want that data!" + while (attempts++ < 3) { region = Client.Grid.GetGridRegion(simName); @@ -980,10 +966,7 @@ namespace libsecondlife else { // Request the region info again - Client.Grid.AddSim(simName); - - // FIXME: We shouldn't be sleeping in the library at all, hopefully this goes away soon - System.Threading.Thread.Sleep(1000); + Client.Grid.GetGridRegion(simName); } } } diff --git a/libsecondlife-cs/NetworkManager.cs b/libsecondlife-cs/NetworkManager.cs index abdfd3f0..d4ddf618 100644 --- a/libsecondlife-cs/NetworkManager.cs +++ b/libsecondlife-cs/NetworkManager.cs @@ -1148,14 +1148,16 @@ namespace libsecondlife public event LogoutCallback OnLogoutReply; /// - /// + /// Simplified login that takes the most common fields as parameters + /// and uses defaults for the rest /// - /// - /// - /// - /// - /// - /// + /// Account first name + /// Account last name + /// Account password + /// Client application name and version + /// Client application author + /// Whether the login was successful or not. On failure the + /// LoginError string will contain the error public bool Login(string firstName, string lastName, string password, string userAgent, string author) { Dictionary loginParams = DefaultLoginValues(firstName, lastName, @@ -1164,16 +1166,21 @@ namespace libsecondlife } /// - /// + /// Simplified login that takes the most common fields along with a + /// starting location URI, and can accept an MD5 string instead of a + /// plaintext password /// - /// - /// - /// - /// - /// - /// - /// - /// + /// Account first name + /// Account last name + /// Account password or MD5 hash of the password + /// such as $1$1682a1e45e9f957dcdf0bb56eb43319c + /// Client application name and version + /// Starting location URI that can be built with + /// StartLocation() + /// Client application author + /// If true, the password field contains + /// Whether the login was successful or not. On failure the + /// LoginError string will contain the error public bool Login(string firstName, string lastName, string password, string userAgent, string start, string author, bool md5pass) { @@ -1183,25 +1190,53 @@ namespace libsecondlife } /// - /// + /// Login that takes a custom built dictionary of login parameters and + /// values /// - /// - /// + /// Dictionary of login parameters and values + /// that can be created with DefaultLoginValues() + /// Whether the login was successful or not. On failure the + /// LoginError string will contain the error public bool Login(Dictionary loginParams) { - return Login(loginParams, Client.Settings.LOGIN_SERVER); + return Login(loginParams, Client.Settings.LOGIN_SERVER, "login_to_simulator"); } /// - /// + /// Login that takes a custom built dictionary of login parameters and + /// values and the URL of the login server /// - /// - /// - /// + /// Dictionary of login parameters and values + /// that can be created with DefaultLoginValues() + /// URL of the login server to authenticate with + /// Whether the login was successful or not. On failure the + /// LoginError string will contain the error public bool Login(Dictionary loginParams, string url) { + return Login(loginParams, url, "login_to_simulator"); + } + + /// + /// Login that takes a custom built dictionary of login parameters and + /// values, URL of the login server, and the name of the XML-RPC method + /// to use + /// + /// Dictionary of login parameters and values + /// that can be created with DefaultLoginValues() + /// URL of the login server to authenticate with + /// Whether the login was successful or not. On failure the + /// LoginError string will contain the error + public bool Login(Dictionary loginParams, string url, string method) + { + XmlRpcResponse result; + XmlRpcRequest xmlrpc; + Hashtable loginValues; + + // Clear possible old values from the last login + LoginValues.Clear(); + // Rebuild the Dictionary<> in to a Hashtable for compatibility with XmlRpcCS - Hashtable loginValues = new Hashtable(loginParams.Count); + loginValues = new Hashtable(loginParams.Count); foreach (KeyValuePair kvp in loginParams) { if (kvp.Value is IList) @@ -1220,9 +1255,9 @@ namespace libsecondlife } } - XmlRpcResponse result; - XmlRpcRequest xmlrpc = new XmlRpcRequest(); - xmlrpc.MethodName = "login_to_simulator"; + // Build the XML-RPC request + xmlrpc = new XmlRpcRequest(); + xmlrpc.MethodName = method; xmlrpc.Params.Clear(); xmlrpc.Params.Add(loginValues); @@ -1233,7 +1268,6 @@ namespace libsecondlife catch (Exception e) { LoginError = "XML-RPC Error: " + e.Message; - LoginValues.Clear(); return false; } @@ -1241,7 +1275,6 @@ namespace libsecondlife { Client.Log("Fault " + result.FaultCode + ": " + result.FaultString, Helpers.LogLevel.Error); LoginError = "XML-RPC Fault: " + result.FaultCode + ": " + result.FaultString; - LoginValues.Clear(); return false; } @@ -1253,9 +1286,12 @@ namespace libsecondlife if ((string)LoginValues["login"] == "indeterminate") { - //FIXME: We need to do another XML-RPC, handle this case - LoginError = "Got a redirect, login with the official client to update"; - return false; + string nexturl = (string)LoginValues["next_url"]; + string nextmethod = (string)LoginValues["next_method"]; + string message = (string)LoginValues["message"]; + Client.Log("Login redirected: " + nexturl + ", message: " + message, Helpers.LogLevel.Info); + + return Login(loginParams, nexturl, nextmethod); } else if ((string)LoginValues["login"] == "false") { @@ -1435,13 +1471,14 @@ namespace libsecondlife } /// - /// + /// Connect to a simulator /// - /// - /// - /// - /// - /// + /// IP address to connect to + /// Port to connect to + /// Circuit code to use for the connection + /// Whether to set CurrentSim to this new + /// connection, use this if the avatar is moving in to this simulator + /// A Simulator object on success, otherwise null public Simulator Connect(IPAddress ip, ushort port, uint circuitCode, bool setDefault, string seedcaps) { Simulator simulator = new Simulator(Client, this.Callbacks, circuitCode, ip, (int)port); @@ -1516,17 +1553,6 @@ namespace libsecondlife LogoutTimer.Start(); } - /// - /// Triggered if a LogoutReply is not received - /// - /// - /// - public void LogoutTimer_Elapsed(object sender, ElapsedEventArgs ev) - { - Client.Log("Logout due to timeout on server acknowledgement", Helpers.LogLevel.Debug); - ForceLogout(); - } - /// /// Uses a LogoutDemand packet to force initiate a logout /// @@ -1540,33 +1566,6 @@ namespace libsecondlife FinalizeLogout(); } - /// - /// Finalize the logout procedure. Close down sockets, etc. - /// - private void FinalizeLogout() - { - LogoutTimer.Stop(); - - // Shutdown the network layer - Shutdown(); - - if (OnDisconnected != null) - { - try - { - OnDisconnected(DisconnectType.ClientInitiated, ""); - } - catch (Exception e) - { - Client.Log("Caught an exception in OnDisconnected(): " + e.ToString(), - Helpers.LogLevel.Error); - } - } - - // In case we are blocking in Logout() - LogoutReplyEvent.Set(); - } - /// /// /// @@ -1602,6 +1601,33 @@ namespace libsecondlife } } + /// + /// Finalize the logout procedure. Close down sockets, etc. + /// + private void FinalizeLogout() + { + LogoutTimer.Stop(); + + // Shutdown the network layer + Shutdown(); + + if (OnDisconnected != null) + { + try + { + OnDisconnected(DisconnectType.ClientInitiated, ""); + } + catch (Exception e) + { + Client.Log("Caught an exception in OnDisconnected(): " + e.ToString(), + Helpers.LogLevel.Error); + } + } + + // In case we are blocking in Logout() + LogoutReplyEvent.Set(); + } + /// /// Shutdown will disconnect all the sims except for the current sim /// first, and then kill the connection to CurrentSim. @@ -1683,6 +1709,15 @@ namespace libsecondlife Client.Self.SetAlwaysRun(false); } + /// + /// Triggered if a LogoutReply is not received + /// + private void LogoutTimer_Elapsed(object sender, ElapsedEventArgs ev) + { + Client.Log("Logout due to timeout on server acknowledgement", Helpers.LogLevel.Debug); + ForceLogout(); + } + private void DisconnectTimer_Elapsed(object sender, ElapsedEventArgs ev) { if (connected) diff --git a/libsecondlife-cs/SecondLife.cs b/libsecondlife-cs/SecondLife.cs index 9f5767f0..d22d71b4 100644 --- a/libsecondlife-cs/SecondLife.cs +++ b/libsecondlife-cs/SecondLife.cs @@ -104,23 +104,14 @@ namespace libsecondlife } /// - /// + /// Return the full name of this instance /// - /// Client avatar's full name + /// Client avatars full name public override string ToString() { return Self.FirstName + " " + Self.LastName; } - /// - /// A simple sleep function that will allow pending threads to run - /// - /// NOTE - just use System.Threading.Thread.Sleep(1); in your code =O - public void Tick() - { - System.Threading.Thread.Sleep(1); - } - /// /// Send a log message to the debugging output system /// diff --git a/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.cs b/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.cs index 76a83ddb..d9236f0a 100644 --- a/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.cs +++ b/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.cs @@ -59,11 +59,16 @@ namespace VisualParamGenerator return; } + SortedList IDs = new SortedList(); StringWriter output = new StringWriter(); - bool first = true; foreach (XmlNode node in list) { + if ((node.Attributes["group"] == null) || !(node.Attributes["group"].Value.Equals("0"))) + { + // We're only interested in group 0 parameters + continue; + } if ((node.Attributes["shared"] != null) && (node.Attributes["shared"].Value.Equals("1"))) { // This param will have been already been defined @@ -80,18 +85,14 @@ namespace VisualParamGenerator node.Attributes["name"] != null && node.Attributes["wearable"] != null) { - if (!first) - { - output.Write(Environment.NewLine); - } - else - { - first = false; - } - try { int id = Int32.Parse(node.Attributes["id"].Value); + + // Check for duplicates + if (IDs.ContainsKey(id)) + continue; + string name = node.Attributes["name"].Value; int group = Int32.Parse(node.Attributes["group"].Value); string wearable = node.Attributes["wearable"].Value; @@ -116,10 +117,10 @@ namespace VisualParamGenerator def = Single.Parse(node.Attributes["value_default"].Value); else def = min; - - output.Write(" paramsDict.Add(" + id + ", new VisualParam(" + id + ", \"" + name + "\", " + group + + + IDs.Add(id, " new VisualParam(" + id + ", \"" + name + "\", " + group + ", \"" + wearable + "\", \"" + label + "\", \"" + label_min + "\", \"" + label_max + - "\", " + def + "f, " + min + "f, " + max + "f));"); + "\", " + def + "f, " + min + "f, " + max + "f)," + Environment.NewLine); } catch (Exception e) { @@ -128,10 +129,13 @@ namespace VisualParamGenerator } } - output.Write(Environment.NewLine + " }" + Environment.NewLine); - output.Write(" return paramsDict;" + Environment.NewLine); - output.Write(" }" + Environment.NewLine); - output.Write(" }" + Environment.NewLine); + // Now that we've collected all the entries and sorted them, add them to our output buffer + foreach (string line in IDs.Values) + { + output.Write(line); + } + + output.Write(" };" + Environment.NewLine); output.Write(" }" + Environment.NewLine); output.Write("}" + Environment.NewLine); diff --git a/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.csproj b/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.csproj index 954a8f41..7c5d1584 100644 --- a/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.csproj +++ b/libsecondlife-cs/VisualParamGenerator/VisualParamGenerator.csproj @@ -13,7 +13,7 @@ true full false - bin\Debug\ + ..\..\bin\ DEBUG;TRACE prompt 4 diff --git a/libsecondlife-cs/VisualParamGenerator/template.cs b/libsecondlife-cs/VisualParamGenerator/template.cs index f3b28919..7ed9503e 100644 --- a/libsecondlife-cs/VisualParamGenerator/template.cs +++ b/libsecondlife-cs/VisualParamGenerator/template.cs @@ -62,11 +62,5 @@ namespace libsecondlife /// public static class VisualParams { - private static Dictionary paramsDict = new Dictionary(); - - public static Dictionary Params - { - get - { - if (paramsDict.Count == 0) - { \ No newline at end of file + public static VisualParam[] Params = new VisualParam[] + { \ No newline at end of file diff --git a/libsecondlife-cs/_VisualParam_.cs b/libsecondlife-cs/_VisualParam_.cs index 8a1cd71f..d96ee9ca 100644 --- a/libsecondlife-cs/_VisualParam_.cs +++ b/libsecondlife-cs/_VisualParam_.cs @@ -62,355 +62,226 @@ namespace libsecondlife /// public static class VisualParams { - private static Dictionary paramsDict = new Dictionary(); - - public static Dictionary Params + public static VisualParam[] Params = new VisualParam[] { - get - { - if (paramsDict.Count == 0) - { - paramsDict.Add(32, new VisualParam(32, "Male_Skeleton", 1, "shape", "", "Female", "Male", 0f, 0f, 1f)); - paramsDict.Add(33, new VisualParam(33, "Height", 0, "shape", "Height", "Short", "Tall", -2.3f, -2.3f, 2f)); - paramsDict.Add(34, new VisualParam(34, "Thickness", 0, "shape", "Body Thickness", "Body Thin", "Body Thick", -0.7f, -0.7f, 1.5f)); - paramsDict.Add(36, new VisualParam(36, "Shoulders", 0, "shape", "Shoulders", "Narrow", "Broad", -0.5f, -1.8f, 1.4f)); - paramsDict.Add(37, new VisualParam(37, "Hip Width", 0, "shape", "Hip Width", "Narrow", "Wide", -3.2f, -3.2f, 2.8f)); - paramsDict.Add(842, new VisualParam(842, "Hip Length", 0, "shape", "", "Short hips", "Long Hips", -1f, -1f, 1f)); - paramsDict.Add(38, new VisualParam(38, "Torso Length", 0, "shape", "", "Short Torso", "Long Torso", -1f, -1f, 1f)); - paramsDict.Add(195, new VisualParam(195, "EyeBone_Spread", 1, "shape", "", "Eyes Together", "Eyes Spread", -1f, -1f, 1f)); - paramsDict.Add(661, new VisualParam(661, "EyeBone_Head_Shear", 1, "shape", "", "Eyes Shear Left Up", "Eyes Shear Right Up", -2f, -2f, 2f)); - paramsDict.Add(772, new VisualParam(772, "EyeBone_Head_Elongate", 1, "shape", "", "Eyes Short Head", "Eyes Long Head", -1f, -1f, 1f)); - paramsDict.Add(768, new VisualParam(768, "EyeBone_Bug", 1, "shape", "", "Eyes Sunken", "Eyes Bugged", -2f, -2f, 2f)); - paramsDict.Add(655, new VisualParam(655, "Head Size", 1, "shape", "Head Size", "Small Head", "Big Head", -0.25f, -0.25f, 0.1f)); - paramsDict.Add(197, new VisualParam(197, "Shoe_Heels", 1, "shoes", "", "No Heels", "High Heels", 0f, 0f, 1f)); - paramsDict.Add(502, new VisualParam(502, "Shoe_Platform", 1, "shoes", "", "No Heels", "High Heels", 0f, 0f, 1f)); - paramsDict.Add(675, new VisualParam(675, "Hand Size", 0, "shape", "", "Small Hands", "Large Hands", -0.3f, -0.3f, 0.3f)); - paramsDict.Add(683, new VisualParam(683, "Neck Thickness", 0, "shape", "", "Skinny Neck", "Thick Neck", -0.15f, -0.4f, 0.2f)); - paramsDict.Add(689, new VisualParam(689, "EyeBone_Big_Eyes", 1, "shape", "", "Eyes Back", "Eyes Forward", -1f, -1f, 1f)); - paramsDict.Add(692, new VisualParam(692, "Leg Length", 0, "shape", "", "Short Legs", "Long Legs", -1f, -1f, 1f)); - paramsDict.Add(693, new VisualParam(693, "Arm Length", 0, "shape", "", "Short Arms", "Long arms", 0.6f, -1f, 1f)); - paramsDict.Add(756, new VisualParam(756, "Neck Length", 0, "shape", "", "Short Neck", "Long Neck", 0f, -1f, 1f)); - paramsDict.Add(180, new VisualParam(180, "Hair_Volume", 1, "hair", "Hair Volume", "Less", "More", 0f, 0f, 1.3f)); - paramsDict.Add(761, new VisualParam(761, "Hair_Volume_Small", 1, "hair", "Hair Volume", "Less", "More", 0f, 0f, 1.3f)); - paramsDict.Add(181, new VisualParam(181, "Hair_Big_Front", 0, "hair", "Big Hair Front", "Less", "More", 0.14f, -1f, 1f)); - paramsDict.Add(182, new VisualParam(182, "Hair_Big_Top", 0, "hair", "Big Hair Top", "Less", "More", 0.7f, -1f, 1f)); - paramsDict.Add(183, new VisualParam(183, "Hair_Big_Back", 0, "hair", "Big Hair Back", "Less", "More", 0.05f, -1f, 1f)); - paramsDict.Add(184, new VisualParam(184, "Hair_Spiked", 0, "hair", "Spiked Hair", "No Spikes", "Big Spikes", 0f, 0f, 1f)); - paramsDict.Add(140, new VisualParam(140, "Hair_Part_Middle", 0, "hair", "Middle Part", "No Part", "Part", 0f, 0f, 2f)); - paramsDict.Add(141, new VisualParam(141, "Hair_Part_Right", 0, "hair", "Right Part", "No Part", "Part", 0f, 0f, 2f)); - paramsDict.Add(142, new VisualParam(142, "Hair_Part_Left", 0, "hair", "Left Part", "No Part", "Part", 0f, 0f, 2f)); - paramsDict.Add(143, new VisualParam(143, "Hair_Sides_Full", 0, "hair", "Full Hair Sides", "Mowhawk", "Full Sides", 0.125f, -4f, 1.5f)); - paramsDict.Add(144, new VisualParam(144, "Bangs_Front_Up", 1, "hair", "Front Bangs Up", "Bangs", "Bangs Up", 0f, 0f, 1f)); - paramsDict.Add(145, new VisualParam(145, "Bangs_Front_Down", 1, "hair", "Front Bangs Down", "Bangs", "Bangs Down", 0f, 0f, 5f)); - paramsDict.Add(146, new VisualParam(146, "Bangs_Sides_Up", 1, "hair", "Side Bangs Up", "Side Bangs", "Side Bangs Up", 0f, 0f, 1f)); - paramsDict.Add(147, new VisualParam(147, "Bangs_Sides_Down", 1, "hair", "Side Bangs Down", "Side Bangs", "Side Bangs Down", 0f, 0f, 2f)); - paramsDict.Add(148, new VisualParam(148, "Bangs_Back_Up", 1, "hair", "Back Bangs Up", "Back Bangs", "Back Bangs Up", 0f, 0f, 1f)); - paramsDict.Add(149, new VisualParam(149, "Bangs_Back_Down", 1, "hair", "Back Bangs Down", "Back Bangs", "Back Bangs Down", 0f, 0f, 2f)); - paramsDict.Add(171, new VisualParam(171, "Hair_Front_Down", 1, "hair", "Front Hair Down", "Front Hair", "Front Hair Down", 0f, 0f, 1f)); - paramsDict.Add(172, new VisualParam(172, "Hair_Front_Up", 1, "hair", "Front Hair Up", "Front Hair", "Front Hair Up", 0f, 0f, 1f)); - paramsDict.Add(173, new VisualParam(173, "Hair_Sides_Down", 1, "hair", "Sides Hair Down", "Sides Hair", "Sides Hair Down", 0f, 0f, 1f)); - paramsDict.Add(174, new VisualParam(174, "Hair_Sides_Up", 1, "hair", "Sides Hair Up", "Sides Hair", "Sides Hair Up", 0f, 0f, 1f)); - paramsDict.Add(175, new VisualParam(175, "Hair_Back_Down", 1, "hair", "Back Hair Down", "Back Hair", "Back Hair Down", 0f, 0f, 3f)); - paramsDict.Add(176, new VisualParam(176, "Hair_Back_Up", 1, "hair", "Back Hair Up", "Back Hair", "Back Hair Up", 0f, 0f, 1f)); - paramsDict.Add(177, new VisualParam(177, "Hair_Rumpled", 0, "hair", "Rumpled Hair", "Smooth Hair", "Rumpled Hair", 0f, 0f, 1f)); - paramsDict.Add(178, new VisualParam(178, "Hair_Swept_Back", 1, "hair", "Swept Back Hair", "NotHair", "Swept Back", 0f, 0f, 1f)); - paramsDict.Add(179, new VisualParam(179, "Hair_Swept_Forward", 1, "hair", "Swept Forward Hair", "Hair", "Swept Forward", 0f, 0f, 1f)); - paramsDict.Add(190, new VisualParam(190, "Hair_Tilt_Right", 1, "hair", "Hair Tilted Right", "Hair", "Tilt Right", 0f, 0f, 1f)); - paramsDict.Add(191, new VisualParam(191, "Hair_Tilt_Left", 1, "hair", "Hair Tilted Left", "Hair", "Tilt Left", 0f, 0f, 1f)); - paramsDict.Add(192, new VisualParam(192, "Bangs_Part_Middle", 0, "hair", "Part Bangs", "No Part", "Part Bangs", 0f, 0f, 1f)); - paramsDict.Add(640, new VisualParam(640, "Hair_Egg_Head", 1, "hair", "", "", "", -1.3f, -1.3f, 1f)); - paramsDict.Add(641, new VisualParam(641, "Hair_Squash_Stretch_Head", 1, "hair", "", "", "", -0.5f, -0.5f, 1f)); - paramsDict.Add(642, new VisualParam(642, "Hair_Square_Head", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(643, new VisualParam(643, "Hair_Round_Head", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(644, new VisualParam(644, "Hair_Forehead_Round", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(645, new VisualParam(645, "Hair_Forehead_Slant", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(774, new VisualParam(774, "Shear_Head_Hair", 1, "hair", "", "", "", -2f, -2f, 2f)); - paramsDict.Add(771, new VisualParam(771, "Elongate_Head_Hair", 1, "hair", "", "", "", -1f, -1f, 1f)); - paramsDict.Add(674, new VisualParam(674, "Hair_Shear_Back", 0, "hair", "Shear Back", "Full Back", "Sheared Back", -0.3f, -1f, 2f)); - paramsDict.Add(762, new VisualParam(762, "Hair_Shear_Front", 0, "hair", "Shear Front", "Full Front", "Sheared Front", 0f, 0f, 3f)); - paramsDict.Add(754, new VisualParam(754, "Hair_Taper_Back", 0, "hair", "Taper Back", "Wide Back", "Narrow Back", 0f, -1f, 2f)); - paramsDict.Add(755, new VisualParam(755, "Hair_Taper_Front", 0, "hair", "Taper Front", "Wide Front", "Narrow Front", 0.05f, -1.5f, 1.5f)); - paramsDict.Add(782, new VisualParam(782, "Hair_Pigtails_Short", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(783, new VisualParam(783, "Hair_Pigtails_Med", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(790, new VisualParam(790, "Hair_Pigtails_Medlong", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(784, new VisualParam(784, "Hair_Pigtails_Long", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(786, new VisualParam(786, "Hair_Ponytail_Short", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(787, new VisualParam(787, "Hair_Ponytail_Med", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(788, new VisualParam(788, "Hair_Ponytail_Long", 1, "hair", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(1, new VisualParam(1, "Big_Brow", 0, "shape", "Brow Size", "Small", "Large", -0.3f, -0.3f, 2f)); - paramsDict.Add(2, new VisualParam(2, "Nose_Big_Out", 0, "shape", "Nose Size", "Small", "Large", -0.8f, -0.8f, 2.5f)); - paramsDict.Add(4, new VisualParam(4, "Broad_Nostrils", 0, "shape", "Nostril Width", "Narrow", "Broad", -0.5f, -0.5f, 1f)); - paramsDict.Add(759, new VisualParam(759, "Low_Septum_Nose", 0, "shape", "Nostril Division", "High", "Low", 0.5f, -1f, 1.5f)); - paramsDict.Add(517, new VisualParam(517, "Wide_Nose", 0, "shape", "Nose Width", "Narrow", "Wide", -0.5f, -0.5f, 1f)); - paramsDict.Add(5, new VisualParam(5, "Cleft_Chin", 0, "shape", "Chin Cleft", "Round", "Cleft", -0.1f, -0.1f, 1f)); - paramsDict.Add(6, new VisualParam(6, "Bulbous_Nose_Tip", 0, "shape", "Nose Tip Shape", "Pointy", "Bulbous", -0.3f, -0.3f, 1f)); - paramsDict.Add(7, new VisualParam(7, "Weak_Chin", 0, "shape", "Chin Angle", "Chin Out", "Chin In", -0.5f, -0.5f, 0.5f)); - paramsDict.Add(8, new VisualParam(8, "Double_Chin", 0, "shape", "Chin-Neck", "Tight Chin", "Double Chin", -0.5f, -0.5f, 1.5f)); - paramsDict.Add(10, new VisualParam(10, "Sunken_Cheeks", 0, "shape", "Lower Cheeks", "Well-Fed", "Sunken", -1.5f, -1.5f, 3f)); - paramsDict.Add(11, new VisualParam(11, "Noble_Nose_Bridge", 0, "shape", "Upper Bridge", "Low", "High", -0.5f, -0.5f, 1.5f)); - paramsDict.Add(758, new VisualParam(758, "Lower_Bridge_Nose", 0, "shape", "Lower Bridge", "Low", "High", -1.5f, -1.5f, 1.5f)); - paramsDict.Add(12, new VisualParam(12, "Jowls", 0, "shape", "", "Less", "More", -0.5f, -0.5f, 2.5f)); - paramsDict.Add(13, new VisualParam(13, "Cleft_Chin_Upper", 0, "shape", "Upper Chin Cleft", "Round", "Cleft", 0f, 0f, 1.5f)); - paramsDict.Add(14, new VisualParam(14, "High_Cheek_Bones", 0, "shape", "Cheek Bones", "Low", "High", -0.5f, -0.5f, 1f)); - paramsDict.Add(15, new VisualParam(15, "Ears_Out", 0, "shape", "Ear Angle", "In", "Out", -0.5f, -0.5f, 1.5f)); - paramsDict.Add(870, new VisualParam(870, "Pointy_Eyebrows", 1, "hair", "Eyebrow Points", "Smooth", "Pointy", -0.5f, -0.5f, 1f)); - paramsDict.Add(17, new VisualParam(17, "Square_Jaw", 0, "shape", "Jaw Shape", "Pointy", "Square", -0.5f, -0.5f, 1f)); - paramsDict.Add(18, new VisualParam(18, "Puffy_Upper_Cheeks", 0, "shape", "Upper Cheeks", "Thin", "Puffy", -1.5f, -1.5f, 2.5f)); - paramsDict.Add(19, new VisualParam(19, "Upturned_Nose_Tip", 0, "shape", "Nose Tip Angle", "Downturned", "Upturned", -1.5f, -1.5f, 1f)); - paramsDict.Add(20, new VisualParam(20, "Bulbous_Nose", 0, "shape", "Nose Thickness", "Thin Nose", "Bulbous Nose", -0.5f, -0.5f, 1.5f)); - paramsDict.Add(21, new VisualParam(21, "Upper_Eyelid_Fold", 0, "shape", "Upper Eyelid Fold", "Uncreased", "Creased", -0.2f, -0.2f, 1.3f)); - paramsDict.Add(22, new VisualParam(22, "Attached_Earlobes", 0, "shape", "Attached Earlobes", "Unattached", "Attached", 0f, 0f, 1f)); - paramsDict.Add(23, new VisualParam(23, "Baggy_Eyes", 0, "shape", "Eye Bags", "Smooth", "Baggy", -0.5f, -0.5f, 1.5f)); - paramsDict.Add(765, new VisualParam(765, "Puffy_Lower_Lids", 0, "shape", "Puffy Eyelids", "Flat", "Puffy", -0.3f, -0.3f, 2.5f)); - paramsDict.Add(24, new VisualParam(24, "Wide_Eyes", 0, "shape", "Eye Opening", "Narrow", "Wide", -1.5f, -1.5f, 2f)); - paramsDict.Add(25, new VisualParam(25, "Wide_Lip_Cleft", 0, "shape", "Lip Cleft", "Narrow", "Wide", -0.8f, -0.8f, 1.5f)); - paramsDict.Add(764, new VisualParam(764, "Lip_Cleft_Deep", 0, "shape", "Lip Cleft Depth", "Shallow", "Deep", -0.5f, -0.5f, 1.2f)); - paramsDict.Add(27, new VisualParam(27, "Wide_Nose_Bridge", 0, "shape", "Bridge Width", "Narrow", "Wide", -1.3f, -1.3f, 1.2f)); - paramsDict.Add(872, new VisualParam(872, "Arced_Eyebrows", 1, "hair", "Eyebrow Arc", "Flat", "Arced", 0f, 0f, 1f)); - paramsDict.Add(871, new VisualParam(871, "Lower_Eyebrows", 1, "hair", "Eyebrow Height", "Higher", "Lower", -2f, -2f, 2f)); - paramsDict.Add(35, new VisualParam(35, "Big_Ears", 0, "shape", "Ear Size", "Small", "Large", -1f, -1f, 2f)); - paramsDict.Add(796, new VisualParam(796, "Pointy_Ears", 0, "shape", "Ear Tips", "Flat", "Pointy", -0.4f, -0.4f, 3f)); - paramsDict.Add(185, new VisualParam(185, "Deep_Chin", 0, "shape", "Chin Depth", "Shallow", "Deep", -1f, -1f, 1f)); - paramsDict.Add(186, new VisualParam(186, "Egg_Head", 1, "shape", "Egg Head", "Chin Heavy", "Forehead Heavy", -1.3f, -1.3f, 1f)); - paramsDict.Add(187, new VisualParam(187, "Squash_Stretch_Head", 1, "shape", "Squash/Stretch Head", "Squash Head", "Stretch Head", -0.5f, -0.5f, 1f)); - paramsDict.Add(188, new VisualParam(188, "Square_Head", 1, "shape", "", "Less Square", "More Square", 0f, 0f, 0.7f)); - paramsDict.Add(189, new VisualParam(189, "Round_Head", 1, "shape", "", "Less Round", "More Round", 0f, 0f, 1f)); - paramsDict.Add(194, new VisualParam(194, "Eye_Spread", 1, "shape", "", "Eyes Together", "Eyes Spread", -2f, -2f, 2f)); - paramsDict.Add(400, new VisualParam(400, "Displace_Hair_Facial", 1, "hair", "Hair Thickess", "Cropped Hair", "Bushy Hair", 0f, 0f, 2f)); - paramsDict.Add(506, new VisualParam(506, "Mouth_Height", 0, "shape", "Mouth Position", "High", "Low", -2f, -2f, 2f)); - paramsDict.Add(633, new VisualParam(633, "Fat_Head", 1, "shape", "Fat Head", "Skinny", "Fat", 0f, 0f, 1f)); - paramsDict.Add(630, new VisualParam(630, "Forehead_Round", 1, "shape", "Round Forehead", "Less", "More", 0f, 0f, 1f)); - paramsDict.Add(631, new VisualParam(631, "Forehead_Slant", 1, "shape", "Slanted Forehead", "Less", "More", 0f, 0f, 1f)); - paramsDict.Add(650, new VisualParam(650, "Eyelid_Corner_Up", 0, "shape", "Outer Eye Corner", "Corner Down", "Corner Up", -1.3f, -1.3f, 1.2f)); - paramsDict.Add(880, new VisualParam(880, "Eyelid_Inner_Corner_Up", 0, "shape", "Inner Eye Corner", "Corner Down", "Corner Up", -1.3f, -1.3f, 1.2f)); - paramsDict.Add(653, new VisualParam(653, "Tall_Lips", 0, "shape", "Lip Fullness", "Less Full", "More Full", -1f, -1f, 2f)); - paramsDict.Add(656, new VisualParam(656, "Crooked_Nose", 0, "shape", "Crooked Nose", "Nose Left", "Nose Right", -2f, -2f, 2f)); - paramsDict.Add(657, new VisualParam(657, "Smile_Mouth", 1, "shape", "Mouth Corner", "Corner Normal", "Corner Up", 0f, 0f, 1.4f)); - paramsDict.Add(658, new VisualParam(658, "Frown_Mouth", 1, "shape", "Mouth Corner", "Corner Normal", "Corner Down", 0f, 0f, 1.2f)); - paramsDict.Add(797, new VisualParam(797, "Fat_Upper_Lip", 1, "shape", "Fat Upper Lip", "Normal Upper", "Fat Upper", 0f, 0f, 1.5f)); - paramsDict.Add(798, new VisualParam(798, "Fat_Lower_Lip", 1, "shape", "Fat Lower Lip", "Normal Lower", "Fat Lower", 0f, 0f, 1.5f)); - paramsDict.Add(660, new VisualParam(660, "Shear_Head", 1, "shape", "Shear Face", "Shear Left", "Shear Right", 0f, -2f, 2f)); - paramsDict.Add(770, new VisualParam(770, "Elongate_Head", 1, "shape", "Shear Face", "Flat Head", "Long Head", 0f, -1f, 1f)); - paramsDict.Add(663, new VisualParam(663, "Shift_Mouth", 0, "shape", "Shift Mouth", "Shift Left", "Shift Right", 0f, -2f, 2f)); - paramsDict.Add(664, new VisualParam(664, "Pop_Eye", 0, "shape", "Eye Pop", "Pop Right Eye", "Pop Left Eye", 0f, -1.3f, 1.3f)); - paramsDict.Add(760, new VisualParam(760, "Jaw_Angle", 0, "shape", "Jaw Angle", "Low Jaw", "High Jaw", 0f, -1.2f, 2f)); - paramsDict.Add(665, new VisualParam(665, "Jaw_Jut", 0, "shape", "Jaw Jut", "Overbite", "Underbite", 0f, -2f, 2f)); - paramsDict.Add(686, new VisualParam(686, "Head_Eyes_Big", 1, "shape", "Eye Size", "Beady Eyes", "Anime Eyes", 0f, -2f, 2f)); - paramsDict.Add(767, new VisualParam(767, "Bug_Eyed_Head", 1, "shape", "Eye Depth", "Sunken Eyes", "Bug Eyes", 0f, -2f, 2f)); - paramsDict.Add(518, new VisualParam(518, "Eyelashes_Long", 0, "shape", "Eyelash Length", "Short", "Long", -0.3f, -0.3f, 1.5f)); - paramsDict.Add(626, new VisualParam(626, "Big_Chest", 1, "shape", "Chest Size", "Small", "Large", 0f, 0f, 1f)); - paramsDict.Add(627, new VisualParam(627, "Small_Chest", 1, "shape", "Chest Size", "Large", "Small", 0f, 0f, 1f)); - paramsDict.Add(843, new VisualParam(843, "No_Chest", 1, "shape", "Chest Size", "Some", "None", 0f, 0f, 1f)); - paramsDict.Add(106, new VisualParam(106, "Muscular_Torso", 1, "shape", "Torso Muscles", "Regular", "Muscular", 0f, 0f, 1.4f)); - paramsDict.Add(648, new VisualParam(648, "Scrawny_Torso", 1, "shape", "Torso Muscles", "Regular", "Scrawny", 0f, 0f, 1.3f)); - paramsDict.Add(677, new VisualParam(677, "Scrawny_Torso_Male", 1, "shape", "Torso Scrawny", "Regular", "Scrawny", 0f, 0f, 1.3f)); - paramsDict.Add(634, new VisualParam(634, "Fat_Torso", 1, "shape", "Fat Torso", "skinny", "fat", 0f, 0f, 1f)); - paramsDict.Add(507, new VisualParam(507, "Breast_Gravity", 0, "shape", "Breast Buoyancy", "Less Gravity", "More Gravity", 0f, -1.5f, 2f)); - paramsDict.Add(840, new VisualParam(840, "Shirtsleeve_flair", 0, "shirt", "Sleeve Looseness", "Tight Sleeves", "Loose Sleeves", 0f, 0f, 1.5f)); - paramsDict.Add(684, new VisualParam(684, "Breast_Female_Cleavage", 0, "shape", "Breast Cleavage", "Separate", "Join", 0f, -0.3f, 1.3f)); - paramsDict.Add(685, new VisualParam(685, "Chest_Male_No_Pecs", 0, "shape", "Pectorals", "Big Pectorals", "Sunken Chest", 0f, -0.5f, 1.1f)); - paramsDict.Add(151, new VisualParam(151, "Big_Butt_Legs", 1, "shape", "Butt Size", "Regular", "Large", 0f, 0f, 1f)); - paramsDict.Add(794, new VisualParam(794, "Small_Butt", 1, "shape", "Butt Size", "Regular", "Small", 0f, 0f, 1f)); - paramsDict.Add(152, new VisualParam(152, "Muscular_Legs", 1, "shape", "Leg Muscles", "Regular Muscles", "More Muscles", 0f, 0f, 1.5f)); - paramsDict.Add(651, new VisualParam(651, "Scrawny_Legs", 1, "shape", "Scrawny Leg", "Regular Muscles", "Less Muscles", 0f, 0f, 1.5f)); - paramsDict.Add(853, new VisualParam(853, "Bowed_Legs", 1, "shape", "Knee Angle", "", "", -1f, -1f, 1f)); - paramsDict.Add(500, new VisualParam(500, "Shoe_Heel_Height", 1, "shoes", "Heel Height", "Low Heels", "High Heels", 0f, 0f, 1f)); - paramsDict.Add(501, new VisualParam(501, "Shoe_Platform_Height", 1, "shoes", "Platform Height", "Low Platforms", "High Platforms", 0f, 0f, 1f)); - paramsDict.Add(508, new VisualParam(508, "Shoe_Platform_Width", 0, "shoes", "Platform Width", "Narrow", "Wide", -1f, -1f, 2f)); - paramsDict.Add(509, new VisualParam(509, "Shoe_Heel_Point", 1, "shoes", "Heel Shape", "Default Heels", "Pointy Heels", 0f, 0f, 1f)); - paramsDict.Add(510, new VisualParam(510, "Shoe_Heel_Thick", 1, "shoes", "Heel Shape", "default Heels", "Thick Heels", 0f, 0f, 1f)); - paramsDict.Add(511, new VisualParam(511, "Shoe_Toe_Point", 1, "shoes", "Toe Shape", "Default Toe", "Pointy Toe", 0f, 0f, 1f)); - paramsDict.Add(512, new VisualParam(512, "Shoe_Toe_Square", 1, "shoes", "Toe Shape", "Default Toe", "Square Toe", 0f, 0f, 1f)); - paramsDict.Add(654, new VisualParam(654, "Shoe_Toe_Thick", 0, "shoes", "Toe Thickness", "Flat Toe", "Thick Toe", 0f, 0f, 2f)); - paramsDict.Add(515, new VisualParam(515, "Foot_Size", 0, "shape", "Foot Size", "Small", "Big", -1f, -1f, 3f)); - paramsDict.Add(625, new VisualParam(625, "Leg_Pantflair", 0, "pants", "Cuff Flare", "Tight Cuffs", "Flared Cuffs", 0f, 0f, 1.5f)); - paramsDict.Add(638, new VisualParam(638, "Low_Crotch", 0, "pants", "Pants Crotch", "High and Tight", "Low and Loose", 0f, 0f, 1.3f)); - paramsDict.Add(635, new VisualParam(635, "Fat_Legs", 1, "shape", "Fat Torso", "skinny", "fat", 0f, 0f, 1f)); - paramsDict.Add(879, new VisualParam(879, "Male_Package", 0, "shape", "Package", "Coin Purse", "Duffle Bag", 0f, -0.5f, 2f)); - paramsDict.Add(679, new VisualParam(679, "Eyeball_Size", 1, "shape", "Eyeball Size", "small eye", "big eye", -0.25f, -0.25f, 0.1f)); - paramsDict.Add(687, new VisualParam(687, "Eyeball_Size", 1, "shape", "Big Eyeball", "small eye", "big eye", -0.25f, -0.25f, 0.25f)); - paramsDict.Add(694, new VisualParam(694, "Eyeball_Size", 1, "shape", "Eyeball Size", "small eye", "big eye", -0.25f, -0.25f, 0.1f)); - paramsDict.Add(695, new VisualParam(695, "Eyeball_Size", 1, "shape", "Big Eyeball", "small eye", "big eye", -0.25f, -0.25f, 0.25f)); - paramsDict.Add(680, new VisualParam(680, "Eyeball_Size", 1, "shape", "Eyeball Size", "small eye", "big eye", -0.25f, -0.25f, 0.1f)); - paramsDict.Add(688, new VisualParam(688, "Eyeball_Size", 1, "shape", "Big Eyeball", "small eye", "big eye", -0.25f, -0.25f, 0.25f)); - paramsDict.Add(681, new VisualParam(681, "Eyeball_Size", 1, "shape", "Eyeball Size", "small eye", "big eye", -0.25f, -0.25f, 0.1f)); - paramsDict.Add(691, new VisualParam(691, "Eyeball_Size", 1, "shape", "Big Eyeball", "small eye", "big eye", -0.25f, -0.25f, 0.25f)); - paramsDict.Add(845, new VisualParam(845, "skirt_poofy", 1, "skirt", "poofy skirt", "less poofy", "more poofy", 0f, 0f, 1.5f)); - paramsDict.Add(846, new VisualParam(846, "skirt_loose", 1, "skirt", "loose skirt", "form fitting", "loose", 0f, 0f, 1f)); - paramsDict.Add(866, new VisualParam(866, "skirt_tight", 1, "skirt", "tight skirt", "form fitting", "loose", 0f, 0f, 1f)); - paramsDict.Add(867, new VisualParam(867, "skirt_smallbutt", 1, "skirt", "tight skirt", "form fitting", "loose", 0f, 0f, 1f)); - paramsDict.Add(848, new VisualParam(848, "skirt_bustle", 0, "skirt", "bustle skirt", "no bustle", "more bustle", 0.2f, 0f, 2f)); - paramsDict.Add(847, new VisualParam(847, "skirt_bowlegs", 1, "skirt", "legs skirt", "", "", 0f, -1f, 1f)); - paramsDict.Add(111, new VisualParam(111, "Pigment", 0, "skin", "", "Light", "Dark", 0.5f, 0f, 1f)); - paramsDict.Add(110, new VisualParam(110, "Red Skin", 0, "skin", "Ruddiness", "Pale", "Ruddy", 0f, 0f, 0.1f)); - paramsDict.Add(108, new VisualParam(108, "Rainbow Color", 0, "skin", "", "None", "Wild", 0f, 0f, 1f)); - paramsDict.Add(114, new VisualParam(114, "Blonde Hair", 0, "hair", "", "Black", "Blonde", 0.5f, 0f, 1f)); - paramsDict.Add(113, new VisualParam(113, "Red Hair", 0, "hair", "", "No Red", "Very Red", 0f, 0f, 1f)); - paramsDict.Add(115, new VisualParam(115, "White Hair", 0, "hair", "", "No White", "All White", 0f, 0f, 1f)); - paramsDict.Add(112, new VisualParam(112, "Rainbow Color", 0, "hair", "", "None", "Wild", 0f, 0f, 1f)); - paramsDict.Add(99, new VisualParam(99, "Eye Color", 0, "eyes", "", "Natural", "Unnatural", 0f, 0f, 1f)); - paramsDict.Add(98, new VisualParam(98, "Eye Lightness", 0, "eyes", "", "Darker", "Lighter", 0f, 0f, 1f)); - paramsDict.Add(158, new VisualParam(158, "Shading", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(159, new VisualParam(159, "Shading", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(116, new VisualParam(116, "Rosy Complexion", 0, "skin", "", "Less Rosy", "More Rosy", 0f, 0f, 1f)); - paramsDict.Add(117, new VisualParam(117, "Lip Pinkness", 0, "skin", "", "Darker", "Pinker", 0f, 0f, 1f)); - paramsDict.Add(118, new VisualParam(118, "Wrinkles", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(165, new VisualParam(165, "Freckles", 0, "skin", "", "Less", "More", 0f, 0f, 1f)); - paramsDict.Add(1001, new VisualParam(1001, "Eyebrow Size", 1, "hair", "", "", "", 0.5f, 0f, 1f)); - paramsDict.Add(700, new VisualParam(700, "Lipstick Color", 0, "skin", "", "Pink", "Black", 0.25f, 0f, 1f)); - paramsDict.Add(701, new VisualParam(701, "Lipstick", 0, "skin", "", "No Lipstick", "More Lipstick", 0f, 0f, 0.9f)); - paramsDict.Add(702, new VisualParam(702, "Lipgloss", 0, "skin", "", "No Lipgloss", "Glossy", 0f, 0f, 1f)); - paramsDict.Add(704, new VisualParam(704, "Blush", 0, "skin", "", "No Blush", "More Blush", 0f, 0f, 0.9f)); - paramsDict.Add(705, new VisualParam(705, "Blush Color", 0, "skin", "", "Pink", "Orange", 0.5f, 0f, 1f)); - paramsDict.Add(711, new VisualParam(711, "Blush Opacity", 0, "skin", "", "Clear", "Opaque", 0.5f, 0f, 1f)); - paramsDict.Add(708, new VisualParam(708, "Out Shdw Color", 0, "skin", "", "Light", "Dark", 0f, 0f, 1f)); - paramsDict.Add(706, new VisualParam(706, "Out Shdw Opacity", 0, "skin", "", "Clear", "Opaque", 0.6f, 0.2f, 1f)); - paramsDict.Add(707, new VisualParam(707, "Outer Shadow", 0, "skin", "", "No Eyeshadow", "More Eyeshadow", 0f, 0f, 0.7f)); - paramsDict.Add(712, new VisualParam(712, "In Shdw Color", 0, "skin", "", "Light", "Dark", 0f, 0f, 1f)); - paramsDict.Add(713, new VisualParam(713, "In Shdw Opacity", 0, "skin", "", "Clear", "Opaque", 0.7f, 0.2f, 1f)); - paramsDict.Add(709, new VisualParam(709, "Inner Shadow", 0, "skin", "", "No Eyeshadow", "More Eyeshadow", 0f, 0f, 1f)); - paramsDict.Add(703, new VisualParam(703, "Eyeliner", 0, "skin", "", "No Eyeliner", "Full Eyeliner", 0f, 0f, 1f)); - paramsDict.Add(714, new VisualParam(714, "Eyeliner Color", 0, "skin", "", "Dark Green", "Black", 0f, 0f, 1f)); - paramsDict.Add(751, new VisualParam(751, "5 O'Clock Shadow", 1, "hair", "", "Dense hair", "Shadow hair", 0.7f, 0f, 1f)); - paramsDict.Add(125, new VisualParam(125, "Shading", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(126, new VisualParam(126, "Shading", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(776, new VisualParam(776, "freckles upper", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(1045, new VisualParam(1045, "Bottom bump", 1, "undershirt", "", "", "", 0.8f, 0f, 1f)); - paramsDict.Add(821, new VisualParam(821, "undershirt_red", 0, "undershirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(822, new VisualParam(822, "undershirt_green", 0, "undershirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(823, new VisualParam(823, "undershirt_blue", 0, "undershirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(710, new VisualParam(710, "Nail Polish", 0, "skin", "", "No Polish", "Painted Nails", 0f, 0f, 1f)); - paramsDict.Add(715, new VisualParam(715, "Nail Polish Color", 0, "skin", "", "Pink", "Black", 0f, 0f, 1f)); - paramsDict.Add(827, new VisualParam(827, "gloves_red", 0, "gloves", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(829, new VisualParam(829, "gloves_green", 0, "gloves", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(830, new VisualParam(830, "gloves_blue", 0, "gloves", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(868, new VisualParam(868, "Shirt Wrinkles", 0, "shirt", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(803, new VisualParam(803, "shirt_red", 0, "shirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(804, new VisualParam(804, "shirt_green", 0, "shirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(805, new VisualParam(805, "shirt_blue", 0, "shirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(875, new VisualParam(875, "jacket upper Wrinkles", 1, "jacket", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(831, new VisualParam(831, "upper_jacket_red", 1, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(832, new VisualParam(832, "upper_jacket_green", 1, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(833, new VisualParam(833, "upper_jacket_blue", 1, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(620, new VisualParam(620, "bottom length upper", 1, "jacket", "", "hi cut", "low cut", 0.8f, 0f, 1f)); - paramsDict.Add(622, new VisualParam(622, "open upper", 1, "jacket", "", "closed", "open", 0.8f, 0f, 1f)); - paramsDict.Add(160, new VisualParam(160, "Shading", 1, "pants", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(161, new VisualParam(161, "Shading", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(777, new VisualParam(777, "freckles lower", 1, "skin", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(1055, new VisualParam(1055, "Pants Length", 1, "underpants", "", "", "", 0.3f, 0f, 1f)); - paramsDict.Add(1057, new VisualParam(1057, "Pants Waist", 1, "underpants", "", "", "", 0.8f, 0f, 1f)); - paramsDict.Add(824, new VisualParam(824, "underpants_red", 0, "underpants", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(825, new VisualParam(825, "underpants_green", 0, "underpants", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(826, new VisualParam(826, "underpants_blue", 0, "underpants", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(818, new VisualParam(818, "socks_red", 0, "socks", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(819, new VisualParam(819, "socks_green", 0, "socks", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(820, new VisualParam(820, "socks_blue", 0, "socks", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(812, new VisualParam(812, "shoes_red", 0, "shoes", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(813, new VisualParam(813, "shoes_green", 0, "shoes", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(817, new VisualParam(817, "shoes_blue", 0, "shoes", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(869, new VisualParam(869, "Pants Wrinkles", 0, "pants", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(806, new VisualParam(806, "pants_red", 0, "pants", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(807, new VisualParam(807, "pants_green", 0, "pants", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(808, new VisualParam(808, "pants_blue", 0, "pants", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(876, new VisualParam(876, "jacket upper Wrinkles", 1, "jacket", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(809, new VisualParam(809, "lower_jacket_red", 1, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(810, new VisualParam(810, "lower_jacket_green", 1, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(811, new VisualParam(811, "lower_jacket_blue", 1, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(621, new VisualParam(621, "bottom length lower", 1, "jacket", "", "hi cut", "low cut", 0.8f, 0f, 1f)); - paramsDict.Add(623, new VisualParam(623, "open lower", 1, "jacket", "", "open", "closed", 0.8f, 0f, 1f)); - paramsDict.Add(921, new VisualParam(921, "skirt_red", 0, "skirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(922, new VisualParam(922, "skirt_green", 0, "skirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(923, new VisualParam(923, "skirt_blue", 0, "skirt", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(858, new VisualParam(858, "Skirt Length", 0, "skirt", "", "Short", "Long", 0.4f, 0.01f, 1f)); - paramsDict.Add(859, new VisualParam(859, "Slit Front", 0, "skirt", "", "Open Front", "Closed Front", 1f, 0f, 1f)); - paramsDict.Add(860, new VisualParam(860, "Slit Back", 0, "skirt", "", "Open Back", "Closed Back", 1f, 0f, 1f)); - paramsDict.Add(861, new VisualParam(861, "Slit Left", 0, "skirt", "", "Open Left", "Closed Left", 1f, 0f, 1f)); - paramsDict.Add(862, new VisualParam(862, "Slit Right", 0, "skirt", "", "Open Right", "Closed Right", 1f, 0f, 1f)); - paramsDict.Add(828, new VisualParam(828, "Loose Upper Clothing", 0, "shirt", "Shirt Fit", "Tight Shirt", "Loose Shirt", 0f, 0f, 1f)); - paramsDict.Add(816, new VisualParam(816, "Loose Lower Clothing", 0, "pants", "Pants Fit", "Tight Pants", "Loose Pants", 0f, 0f, 1f)); - paramsDict.Add(814, new VisualParam(814, "Waist Height", 0, "pants", "", "Low", "High", 1f, 0f, 1f)); - paramsDict.Add(815, new VisualParam(815, "Pants Length", 0, "pants", "", "Short", "Long", 0.8f, 0f, 1f)); - paramsDict.Add(800, new VisualParam(800, "Sleeve Length", 0, "shirt", "", "Short", "Long", 0.89f, 0f, 1f)); - paramsDict.Add(801, new VisualParam(801, "Shirt Bottom", 0, "shirt", "", "Short", "Long", 1f, 0f, 1f)); - paramsDict.Add(802, new VisualParam(802, "Collar Front", 0, "shirt", "", "Low", "High", 0.78f, 0f, 1f)); - paramsDict.Add(781, new VisualParam(781, "Collar Back", 0, "shirt", "", "Low", "High", 0.78f, 0f, 1f)); - paramsDict.Add(150, new VisualParam(150, "Body Definition", 0, "skin", "", "Less", "More", 0f, 0f, 1f)); - paramsDict.Add(775, new VisualParam(775, "Body Freckles", 0, "skin", "", "Less Freckles", "More Freckles", 0f, 0f, 1f)); - paramsDict.Add(162, new VisualParam(162, "Facial Definition", 0, "skin", "", "Less", "More", 0f, 0f, 1f)); - paramsDict.Add(163, new VisualParam(163, "wrinkles", 0, "skin", "", "Less", "More", 0f, 0f, 1f)); - paramsDict.Add(505, new VisualParam(505, "Lip Thickness", 0, "shape", "", "Thin Lips", "Fat Lips", 0.5f, 0f, 1f)); - paramsDict.Add(799, new VisualParam(799, "Lip Ratio", 0, "shape", "Lip Ratio", "More Upper Lip", "More Lower Lip", 0.5f, 0f, 1f)); - paramsDict.Add(155, new VisualParam(155, "Lip Width", 0, "shape", "Lip Width", "Narrow Lips", "Wide Lips", 0f, -0.9f, 1.3f)); - paramsDict.Add(196, new VisualParam(196, "Eye Spacing", 0, "shape", "Eye Spacing", "Close Set Eyes", "Far Set Eyes", 0f, -2f, 1f)); - paramsDict.Add(769, new VisualParam(769, "Eye Depth", 0, "shape", "", "Sunken Eyes", "Bugged Eyes", 0.5f, 0f, 1f)); - paramsDict.Add(198, new VisualParam(198, "Heel Height", 0, "shoes", "", "Low Heels", "High Heels", 0f, 0f, 1f)); - paramsDict.Add(513, new VisualParam(513, "Heel Shape", 0, "shoes", "", "Pointy Heels", "Thick Heels", 0.5f, 0f, 1f)); - paramsDict.Add(514, new VisualParam(514, "Toe Shape", 0, "shoes", "", "Pointy", "Square", 0.5f, 0f, 1f)); - paramsDict.Add(503, new VisualParam(503, "Platform Height", 0, "shoes", "", "Low Platforms", "High Platforms", 0f, 0f, 1f)); - paramsDict.Add(193, new VisualParam(193, "Head Shape", 0, "shape", "Head Shape", "More Square", "More Round", 0.5f, 0f, 1f)); - paramsDict.Add(157, new VisualParam(157, "Belly Size", 0, "shape", "", "Small", "Big", 0f, 0f, 1f)); - paramsDict.Add(637, new VisualParam(637, "Body Fat", 0, "shape", "", "Less Body Fat", "More Body Fat", 0f, 0f, 1f)); - paramsDict.Add(130, new VisualParam(130, "Front Fringe", 0, "hair", "", "Short", "Long", 0.45f, 0f, 1f)); - paramsDict.Add(131, new VisualParam(131, "Side Fringe", 0, "hair", "", "Short", "Long", 0.5f, 0f, 1f)); - paramsDict.Add(132, new VisualParam(132, "Back Fringe", 0, "hair", "", "Short", "Long", 0.39f, 0f, 1f)); - paramsDict.Add(133, new VisualParam(133, "Hair Front", 0, "hair", "", "Short", "Long", 0.25f, 0f, 1f)); - paramsDict.Add(134, new VisualParam(134, "Hair Sides", 0, "hair", "", "Short", "Long", 0.5f, 0f, 1f)); - paramsDict.Add(135, new VisualParam(135, "Hair Back", 0, "hair", "", "Short", "Long", 0.55f, 0f, 1f)); - paramsDict.Add(136, new VisualParam(136, "Hair Sweep", 0, "hair", "", "Sweep Forward", "Sweep Back", 0.5f, 0f, 1f)); - paramsDict.Add(137, new VisualParam(137, "Hair Tilt", 0, "hair", "", "Left", "Right", 0.5f, 0f, 1f)); - paramsDict.Add(608, new VisualParam(608, "bottom length lower", 0, "jacket", "Jacket Length", "Short", "Long", 0.8f, 0f, 1f)); - paramsDict.Add(609, new VisualParam(609, "open jacket", 0, "jacket", "Open Front", "Open", "Closed", 0.2f, 0f, 1f)); - paramsDict.Add(105, new VisualParam(105, "Breast Size", 0, "shape", "", "Small", "Large", 0.5f, 0f, 1f)); - paramsDict.Add(629, new VisualParam(629, "Forehead Angle", 0, "shape", "", "More Vertical", "More Sloped", 0.5f, 0f, 1f)); - paramsDict.Add(646, new VisualParam(646, "Egg_Head", 0, "shape", "Egg Head", "Chin Heavy", "Forehead Heavy", 0f, -1.3f, 1f)); - paramsDict.Add(647, new VisualParam(647, "Squash_Stretch_Head", 0, "shape", "Head Stretch", "Squash Head", "Stretch Head", 0f, -0.5f, 1f)); - paramsDict.Add(649, new VisualParam(649, "Torso Muscles", 0, "shape", "Torso Muscles", "Less Muscular", "More Muscular", 0.5f, 0f, 1f)); - paramsDict.Add(678, new VisualParam(678, "Torso Muscles", 0, "shape", "", "Less Muscular", "More Muscular", 0.5f, 0f, 1f)); - paramsDict.Add(652, new VisualParam(652, "Leg Muscles", 0, "shape", "", "Less Muscular", "More Muscular", 0.5f, 0f, 1f)); - paramsDict.Add(80, new VisualParam(80, "male", 0, "shape", "", "", "", 0f, 0f, 1f)); - paramsDict.Add(659, new VisualParam(659, "Mouth Corner", 0, "shape", "", "Corner Down", "Corner Up", 0.5f, 0f, 1f)); - paramsDict.Add(662, new VisualParam(662, "Face Shear", 0, "shape", "", "Shear Right Up", "Shear Left Up", 0.5f, 0f, 1f)); - paramsDict.Add(773, new VisualParam(773, "Head Length", 0, "shape", "", "Flat Head", "Long Head", 0.5f, 0f, 1f)); - paramsDict.Add(682, new VisualParam(682, "Head Size", 0, "shape", "Head Size", "Small Head", "Big Head", 0.5f, 0f, 1f)); - paramsDict.Add(690, new VisualParam(690, "Eye Size", 0, "shape", "Eye Size", "Beady Eyes", "Anime Eyes", 0.5f, 0f, 1f)); - paramsDict.Add(752, new VisualParam(752, "Hair Thickness", 0, "hair", "", "5 O'Clock Shadow", "Bushy Hair", 0.5f, 0f, 1f)); - paramsDict.Add(763, new VisualParam(763, "Hair Volume", 0, "hair", "", "Less Volume", "More Volume", 0.55f, 0f, 1f)); - paramsDict.Add(834, new VisualParam(834, "jacket_red", 0, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(835, new VisualParam(835, "jacket_green", 0, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(836, new VisualParam(836, "jacket_blue", 0, "jacket", "", "", "", 1f, 0f, 1f)); - paramsDict.Add(785, new VisualParam(785, "Pigtails", 0, "hair", "", "Short Pigtails", "Long Pigtails", 0f, 0f, 1f)); - paramsDict.Add(789, new VisualParam(789, "Ponytail", 0, "hair", "", "Short Ponytail", "Long Ponytail", 0f, 0f, 1f)); - paramsDict.Add(795, new VisualParam(795, "Butt Size", 0, "shape", "Butt Size", "Flat Butt", "Big Butt", 0.25f, 0f, 1f)); - paramsDict.Add(841, new VisualParam(841, "Bowed_Legs", 0, "shape", "Knee Angle", "Knock Kneed", "Bow Legged", 0f, -1f, 1f)); - paramsDict.Add(753, new VisualParam(753, "Saddlebags", 0, "shape", "Saddle Bags", "Less Saddle", "More Saddle", 0f, -0.5f, 3f)); - paramsDict.Add(676, new VisualParam(676, "Love_Handles", 0, "shape", "Love Handles", "Less Love", "More Love", 0f, -1f, 2f)); - paramsDict.Add(863, new VisualParam(863, "skirt_looseness", 0, "skirt", "Skirt Fit", "Tight Skirt", "Poofy Skirt", 0.333f, 0f, 1f)); - paramsDict.Add(119, new VisualParam(119, "Eyebrow Size", 0, "hair", "", "Thin Eyebrows", "Bushy Eyebrows", 0.5f, 0f, 1f)); - paramsDict.Add(750, new VisualParam(750, "Eyebrow Density", 0, "hair", "", "Sparse", "Dense", 0.7f, 0f, 1f)); - paramsDict.Add(166, new VisualParam(166, "Sideburns", 0, "hair", "", "Short Sideburns", "Mutton Chops", 0f, 0f, 1f)); - paramsDict.Add(167, new VisualParam(167, "Moustache", 0, "hair", "", "Chaplin", "Handlebars", 0f, 0f, 1f)); - paramsDict.Add(168, new VisualParam(168, "Soulpatch", 0, "hair", "", "Less soul", "More soul", 0f, 0f, 1f)); - paramsDict.Add(169, new VisualParam(169, "Chin Curtains", 0, "hair", "", "Less Curtains", "More Curtains", 0f, 0f, 1f)); - paramsDict.Add(606, new VisualParam(606, "Sleeve Length", 0, "jacket", "", "Short", "Long", 0.8f, 0f, 1f)); - paramsDict.Add(607, new VisualParam(607, "Collar Front", 0, "jacket", "", "Low", "High", 0.8f, 0f, 1f)); - paramsDict.Add(780, new VisualParam(780, "Collar Back", 0, "jacket", "", "Low", "High", 0.8f, 0f, 1f)); - paramsDict.Add(603, new VisualParam(603, "Sleeve Length", 0, "undershirt", "", "Short", "Long", 0.4f, 0.01f, 1f)); - paramsDict.Add(604, new VisualParam(604, "Bottom", 0, "undershirt", "", "Short", "Long", 0.85f, 0f, 1f)); - paramsDict.Add(605, new VisualParam(605, "Collar Front", 0, "undershirt", "", "Low", "High", 0.84f, 0f, 1f)); - paramsDict.Add(779, new VisualParam(779, "Collar Back", 0, "undershirt", "", "Low", "High", 0.84f, 0f, 1f)); - paramsDict.Add(617, new VisualParam(617, "Socks Length", 0, "socks", "", "Short", "Long", 0.35f, 0f, 1f)); - paramsDict.Add(616, new VisualParam(616, "Shoe Height", 0, "shoes", "", "Short", "Tall", 0.1f, 0f, 1f)); - paramsDict.Add(619, new VisualParam(619, "Pants Length", 0, "underpants", "", "Short", "Long", 0.3f, 0f, 1f)); - paramsDict.Add(624, new VisualParam(624, "Pants Waist", 0, "underpants", "", "Low", "High", 0.8f, 0f, 1f)); - paramsDict.Add(93, new VisualParam(93, "Glove Length", 0, "gloves", "", "Short", "Long", 0.8f, 0.01f, 1f)); - paramsDict.Add(844, new VisualParam(844, "Glove Fingers", 0, "gloves", "", "Fingerless", "Fingers", 1f, 0.01f, 1f)); - paramsDict.Add(16, new VisualParam(16, "Pointy_Eyebrows", 0, "hair", "Eyebrow Points", "Smooth", "Pointy", -0.5f, -0.5f, 3f)); - paramsDict.Add(757, new VisualParam(757, "Lower_Eyebrows", 0, "hair", "Eyebrow Height", "Higher", "Lower", -1f, -4f, 2f)); - paramsDict.Add(31, new VisualParam(31, "Arced_Eyebrows", 0, "hair", "Eyebrow Arc", "Flat", "Arced", 0.5f, 0f, 2f)); - paramsDict.Add(877, new VisualParam(877, "Jacket Wrinkles", 0, "jacket", "Jacket Wrinkles", "No Wrinkles", "Wrinkles", 0f, 0f, 1f)); - } - return paramsDict; - } - } + new VisualParam(1, "Big_Brow", 0, "shape", "Brow Size", "Small", "Large", -0.3f, -0.3f, 2f), + new VisualParam(2, "Nose_Big_Out", 0, "shape", "Nose Size", "Small", "Large", -0.8f, -0.8f, 2.5f), + new VisualParam(4, "Broad_Nostrils", 0, "shape", "Nostril Width", "Narrow", "Broad", -0.5f, -0.5f, 1f), + new VisualParam(5, "Cleft_Chin", 0, "shape", "Chin Cleft", "Round", "Cleft", -0.1f, -0.1f, 1f), + new VisualParam(6, "Bulbous_Nose_Tip", 0, "shape", "Nose Tip Shape", "Pointy", "Bulbous", -0.3f, -0.3f, 1f), + new VisualParam(7, "Weak_Chin", 0, "shape", "Chin Angle", "Chin Out", "Chin In", -0.5f, -0.5f, 0.5f), + new VisualParam(8, "Double_Chin", 0, "shape", "Chin-Neck", "Tight Chin", "Double Chin", -0.5f, -0.5f, 1.5f), + new VisualParam(10, "Sunken_Cheeks", 0, "shape", "Lower Cheeks", "Well-Fed", "Sunken", -1.5f, -1.5f, 3f), + new VisualParam(11, "Noble_Nose_Bridge", 0, "shape", "Upper Bridge", "Low", "High", -0.5f, -0.5f, 1.5f), + new VisualParam(12, "Jowls", 0, "shape", "", "Less", "More", -0.5f, -0.5f, 2.5f), + new VisualParam(13, "Cleft_Chin_Upper", 0, "shape", "Upper Chin Cleft", "Round", "Cleft", 0f, 0f, 1.5f), + new VisualParam(14, "High_Cheek_Bones", 0, "shape", "Cheek Bones", "Low", "High", -0.5f, -0.5f, 1f), + new VisualParam(15, "Ears_Out", 0, "shape", "Ear Angle", "In", "Out", -0.5f, -0.5f, 1.5f), + new VisualParam(16, "Pointy_Eyebrows", 0, "hair", "Eyebrow Points", "Smooth", "Pointy", -0.5f, -0.5f, 3f), + new VisualParam(17, "Square_Jaw", 0, "shape", "Jaw Shape", "Pointy", "Square", -0.5f, -0.5f, 1f), + new VisualParam(18, "Puffy_Upper_Cheeks", 0, "shape", "Upper Cheeks", "Thin", "Puffy", -1.5f, -1.5f, 2.5f), + new VisualParam(19, "Upturned_Nose_Tip", 0, "shape", "Nose Tip Angle", "Downturned", "Upturned", -1.5f, -1.5f, 1f), + new VisualParam(20, "Bulbous_Nose", 0, "shape", "Nose Thickness", "Thin Nose", "Bulbous Nose", -0.5f, -0.5f, 1.5f), + new VisualParam(21, "Upper_Eyelid_Fold", 0, "shape", "Upper Eyelid Fold", "Uncreased", "Creased", -0.2f, -0.2f, 1.3f), + new VisualParam(22, "Attached_Earlobes", 0, "shape", "Attached Earlobes", "Unattached", "Attached", 0f, 0f, 1f), + new VisualParam(23, "Baggy_Eyes", 0, "shape", "Eye Bags", "Smooth", "Baggy", -0.5f, -0.5f, 1.5f), + new VisualParam(24, "Wide_Eyes", 0, "shape", "Eye Opening", "Narrow", "Wide", -1.5f, -1.5f, 2f), + new VisualParam(25, "Wide_Lip_Cleft", 0, "shape", "Lip Cleft", "Narrow", "Wide", -0.8f, -0.8f, 1.5f), + new VisualParam(27, "Wide_Nose_Bridge", 0, "shape", "Bridge Width", "Narrow", "Wide", -1.3f, -1.3f, 1.2f), + new VisualParam(31, "Arced_Eyebrows", 0, "hair", "Eyebrow Arc", "Flat", "Arced", 0.5f, 0f, 2f), + new VisualParam(33, "Height", 0, "shape", "Height", "Short", "Tall", -2.3f, -2.3f, 2f), + new VisualParam(34, "Thickness", 0, "shape", "Body Thickness", "Body Thin", "Body Thick", -0.7f, -0.7f, 1.5f), + new VisualParam(35, "Big_Ears", 0, "shape", "Ear Size", "Small", "Large", -1f, -1f, 2f), + new VisualParam(36, "Shoulders", 0, "shape", "Shoulders", "Narrow", "Broad", -0.5f, -1.8f, 1.4f), + new VisualParam(37, "Hip Width", 0, "shape", "Hip Width", "Narrow", "Wide", -3.2f, -3.2f, 2.8f), + new VisualParam(38, "Torso Length", 0, "shape", "", "Short Torso", "Long Torso", -1f, -1f, 1f), + new VisualParam(80, "male", 0, "shape", "", "", "", 0f, 0f, 1f), + new VisualParam(93, "Glove Length", 0, "gloves", "", "Short", "Long", 0.8f, 0.01f, 1f), + new VisualParam(98, "Eye Lightness", 0, "eyes", "", "Darker", "Lighter", 0f, 0f, 1f), + new VisualParam(99, "Eye Color", 0, "eyes", "", "Natural", "Unnatural", 0f, 0f, 1f), + new VisualParam(105, "Breast Size", 0, "shape", "", "Small", "Large", 0.5f, 0f, 1f), + new VisualParam(108, "Rainbow Color", 0, "skin", "", "None", "Wild", 0f, 0f, 1f), + new VisualParam(110, "Red Skin", 0, "skin", "Ruddiness", "Pale", "Ruddy", 0f, 0f, 0.1f), + new VisualParam(111, "Pigment", 0, "skin", "", "Light", "Dark", 0.5f, 0f, 1f), + new VisualParam(112, "Rainbow Color", 0, "hair", "", "None", "Wild", 0f, 0f, 1f), + new VisualParam(113, "Red Hair", 0, "hair", "", "No Red", "Very Red", 0f, 0f, 1f), + new VisualParam(114, "Blonde Hair", 0, "hair", "", "Black", "Blonde", 0.5f, 0f, 1f), + new VisualParam(115, "White Hair", 0, "hair", "", "No White", "All White", 0f, 0f, 1f), + new VisualParam(116, "Rosy Complexion", 0, "skin", "", "Less Rosy", "More Rosy", 0f, 0f, 1f), + new VisualParam(117, "Lip Pinkness", 0, "skin", "", "Darker", "Pinker", 0f, 0f, 1f), + new VisualParam(119, "Eyebrow Size", 0, "hair", "", "Thin Eyebrows", "Bushy Eyebrows", 0.5f, 0f, 1f), + new VisualParam(130, "Front Fringe", 0, "hair", "", "Short", "Long", 0.45f, 0f, 1f), + new VisualParam(131, "Side Fringe", 0, "hair", "", "Short", "Long", 0.5f, 0f, 1f), + new VisualParam(132, "Back Fringe", 0, "hair", "", "Short", "Long", 0.39f, 0f, 1f), + new VisualParam(133, "Hair Front", 0, "hair", "", "Short", "Long", 0.25f, 0f, 1f), + new VisualParam(134, "Hair Sides", 0, "hair", "", "Short", "Long", 0.5f, 0f, 1f), + new VisualParam(135, "Hair Back", 0, "hair", "", "Short", "Long", 0.55f, 0f, 1f), + new VisualParam(136, "Hair Sweep", 0, "hair", "", "Sweep Forward", "Sweep Back", 0.5f, 0f, 1f), + new VisualParam(137, "Hair Tilt", 0, "hair", "", "Left", "Right", 0.5f, 0f, 1f), + new VisualParam(140, "Hair_Part_Middle", 0, "hair", "Middle Part", "No Part", "Part", 0f, 0f, 2f), + new VisualParam(141, "Hair_Part_Right", 0, "hair", "Right Part", "No Part", "Part", 0f, 0f, 2f), + new VisualParam(142, "Hair_Part_Left", 0, "hair", "Left Part", "No Part", "Part", 0f, 0f, 2f), + new VisualParam(143, "Hair_Sides_Full", 0, "hair", "Full Hair Sides", "Mowhawk", "Full Sides", 0.125f, -4f, 1.5f), + new VisualParam(150, "Body Definition", 0, "skin", "", "Less", "More", 0f, 0f, 1f), + new VisualParam(155, "Lip Width", 0, "shape", "Lip Width", "Narrow Lips", "Wide Lips", 0f, -0.9f, 1.3f), + new VisualParam(157, "Belly Size", 0, "shape", "", "Small", "Big", 0f, 0f, 1f), + new VisualParam(162, "Facial Definition", 0, "skin", "", "Less", "More", 0f, 0f, 1f), + new VisualParam(163, "wrinkles", 0, "skin", "", "Less", "More", 0f, 0f, 1f), + new VisualParam(165, "Freckles", 0, "skin", "", "Less", "More", 0f, 0f, 1f), + new VisualParam(166, "Sideburns", 0, "hair", "", "Short Sideburns", "Mutton Chops", 0f, 0f, 1f), + new VisualParam(167, "Moustache", 0, "hair", "", "Chaplin", "Handlebars", 0f, 0f, 1f), + new VisualParam(168, "Soulpatch", 0, "hair", "", "Less soul", "More soul", 0f, 0f, 1f), + new VisualParam(169, "Chin Curtains", 0, "hair", "", "Less Curtains", "More Curtains", 0f, 0f, 1f), + new VisualParam(177, "Hair_Rumpled", 0, "hair", "Rumpled Hair", "Smooth Hair", "Rumpled Hair", 0f, 0f, 1f), + new VisualParam(181, "Hair_Big_Front", 0, "hair", "Big Hair Front", "Less", "More", 0.14f, -1f, 1f), + new VisualParam(182, "Hair_Big_Top", 0, "hair", "Big Hair Top", "Less", "More", 0.7f, -1f, 1f), + new VisualParam(183, "Hair_Big_Back", 0, "hair", "Big Hair Back", "Less", "More", 0.05f, -1f, 1f), + new VisualParam(184, "Hair_Spiked", 0, "hair", "Spiked Hair", "No Spikes", "Big Spikes", 0f, 0f, 1f), + new VisualParam(185, "Deep_Chin", 0, "shape", "Chin Depth", "Shallow", "Deep", -1f, -1f, 1f), + new VisualParam(192, "Bangs_Part_Middle", 0, "hair", "Part Bangs", "No Part", "Part Bangs", 0f, 0f, 1f), + new VisualParam(193, "Head Shape", 0, "shape", "Head Shape", "More Square", "More Round", 0.5f, 0f, 1f), + new VisualParam(196, "Eye Spacing", 0, "shape", "Eye Spacing", "Close Set Eyes", "Far Set Eyes", 0f, -2f, 1f), + new VisualParam(198, "Heel Height", 0, "shoes", "", "Low Heels", "High Heels", 0f, 0f, 1f), + new VisualParam(503, "Platform Height", 0, "shoes", "", "Low Platforms", "High Platforms", 0f, 0f, 1f), + new VisualParam(505, "Lip Thickness", 0, "shape", "", "Thin Lips", "Fat Lips", 0.5f, 0f, 1f), + new VisualParam(506, "Mouth_Height", 0, "shape", "Mouth Position", "High", "Low", -2f, -2f, 2f), + new VisualParam(507, "Breast_Gravity", 0, "shape", "Breast Buoyancy", "Less Gravity", "More Gravity", 0f, -1.5f, 2f), + new VisualParam(508, "Shoe_Platform_Width", 0, "shoes", "Platform Width", "Narrow", "Wide", -1f, -1f, 2f), + new VisualParam(513, "Heel Shape", 0, "shoes", "", "Pointy Heels", "Thick Heels", 0.5f, 0f, 1f), + new VisualParam(514, "Toe Shape", 0, "shoes", "", "Pointy", "Square", 0.5f, 0f, 1f), + new VisualParam(515, "Foot_Size", 0, "shape", "Foot Size", "Small", "Big", -1f, -1f, 3f), + new VisualParam(517, "Wide_Nose", 0, "shape", "Nose Width", "Narrow", "Wide", -0.5f, -0.5f, 1f), + new VisualParam(518, "Eyelashes_Long", 0, "shape", "Eyelash Length", "Short", "Long", -0.3f, -0.3f, 1.5f), + new VisualParam(603, "Sleeve Length", 0, "undershirt", "", "Short", "Long", 0.4f, 0.01f, 1f), + new VisualParam(604, "Bottom", 0, "undershirt", "", "Short", "Long", 0.85f, 0f, 1f), + new VisualParam(605, "Collar Front", 0, "undershirt", "", "Low", "High", 0.84f, 0f, 1f), + new VisualParam(606, "Sleeve Length", 0, "jacket", "", "Short", "Long", 0.8f, 0f, 1f), + new VisualParam(607, "Collar Front", 0, "jacket", "", "Low", "High", 0.8f, 0f, 1f), + new VisualParam(608, "bottom length lower", 0, "jacket", "Jacket Length", "Short", "Long", 0.8f, 0f, 1f), + new VisualParam(609, "open jacket", 0, "jacket", "Open Front", "Open", "Closed", 0.2f, 0f, 1f), + new VisualParam(616, "Shoe Height", 0, "shoes", "", "Short", "Tall", 0.1f, 0f, 1f), + new VisualParam(617, "Socks Length", 0, "socks", "", "Short", "Long", 0.35f, 0f, 1f), + new VisualParam(619, "Pants Length", 0, "underpants", "", "Short", "Long", 0.3f, 0f, 1f), + new VisualParam(624, "Pants Waist", 0, "underpants", "", "Low", "High", 0.8f, 0f, 1f), + new VisualParam(625, "Leg_Pantflair", 0, "pants", "Cuff Flare", "Tight Cuffs", "Flared Cuffs", 0f, 0f, 1.5f), + new VisualParam(629, "Forehead Angle", 0, "shape", "", "More Vertical", "More Sloped", 0.5f, 0f, 1f), + new VisualParam(637, "Body Fat", 0, "shape", "", "Less Body Fat", "More Body Fat", 0f, 0f, 1f), + new VisualParam(638, "Low_Crotch", 0, "pants", "Pants Crotch", "High and Tight", "Low and Loose", 0f, 0f, 1.3f), + new VisualParam(646, "Egg_Head", 0, "shape", "Egg Head", "Chin Heavy", "Forehead Heavy", 0f, -1.3f, 1f), + new VisualParam(647, "Squash_Stretch_Head", 0, "shape", "Head Stretch", "Squash Head", "Stretch Head", 0f, -0.5f, 1f), + new VisualParam(649, "Torso Muscles", 0, "shape", "Torso Muscles", "Less Muscular", "More Muscular", 0.5f, 0f, 1f), + new VisualParam(650, "Eyelid_Corner_Up", 0, "shape", "Outer Eye Corner", "Corner Down", "Corner Up", -1.3f, -1.3f, 1.2f), + new VisualParam(652, "Leg Muscles", 0, "shape", "", "Less Muscular", "More Muscular", 0.5f, 0f, 1f), + new VisualParam(653, "Tall_Lips", 0, "shape", "Lip Fullness", "Less Full", "More Full", -1f, -1f, 2f), + new VisualParam(654, "Shoe_Toe_Thick", 0, "shoes", "Toe Thickness", "Flat Toe", "Thick Toe", 0f, 0f, 2f), + new VisualParam(656, "Crooked_Nose", 0, "shape", "Crooked Nose", "Nose Left", "Nose Right", -2f, -2f, 2f), + new VisualParam(659, "Mouth Corner", 0, "shape", "", "Corner Down", "Corner Up", 0.5f, 0f, 1f), + new VisualParam(662, "Face Shear", 0, "shape", "", "Shear Right Up", "Shear Left Up", 0.5f, 0f, 1f), + new VisualParam(663, "Shift_Mouth", 0, "shape", "Shift Mouth", "Shift Left", "Shift Right", 0f, -2f, 2f), + new VisualParam(664, "Pop_Eye", 0, "shape", "Eye Pop", "Pop Right Eye", "Pop Left Eye", 0f, -1.3f, 1.3f), + new VisualParam(665, "Jaw_Jut", 0, "shape", "Jaw Jut", "Overbite", "Underbite", 0f, -2f, 2f), + new VisualParam(674, "Hair_Shear_Back", 0, "hair", "Shear Back", "Full Back", "Sheared Back", -0.3f, -1f, 2f), + new VisualParam(675, "Hand Size", 0, "shape", "", "Small Hands", "Large Hands", -0.3f, -0.3f, 0.3f), + new VisualParam(676, "Love_Handles", 0, "shape", "Love Handles", "Less Love", "More Love", 0f, -1f, 2f), + new VisualParam(678, "Torso Muscles", 0, "shape", "", "Less Muscular", "More Muscular", 0.5f, 0f, 1f), + new VisualParam(682, "Head Size", 0, "shape", "Head Size", "Small Head", "Big Head", 0.5f, 0f, 1f), + new VisualParam(683, "Neck Thickness", 0, "shape", "", "Skinny Neck", "Thick Neck", -0.15f, -0.4f, 0.2f), + new VisualParam(684, "Breast_Female_Cleavage", 0, "shape", "Breast Cleavage", "Separate", "Join", 0f, -0.3f, 1.3f), + new VisualParam(685, "Chest_Male_No_Pecs", 0, "shape", "Pectorals", "Big Pectorals", "Sunken Chest", 0f, -0.5f, 1.1f), + new VisualParam(690, "Eye Size", 0, "shape", "Eye Size", "Beady Eyes", "Anime Eyes", 0.5f, 0f, 1f), + new VisualParam(692, "Leg Length", 0, "shape", "", "Short Legs", "Long Legs", -1f, -1f, 1f), + new VisualParam(693, "Arm Length", 0, "shape", "", "Short Arms", "Long arms", 0.6f, -1f, 1f), + new VisualParam(700, "Lipstick Color", 0, "skin", "", "Pink", "Black", 0.25f, 0f, 1f), + new VisualParam(701, "Lipstick", 0, "skin", "", "No Lipstick", "More Lipstick", 0f, 0f, 0.9f), + new VisualParam(702, "Lipgloss", 0, "skin", "", "No Lipgloss", "Glossy", 0f, 0f, 1f), + new VisualParam(703, "Eyeliner", 0, "skin", "", "No Eyeliner", "Full Eyeliner", 0f, 0f, 1f), + new VisualParam(704, "Blush", 0, "skin", "", "No Blush", "More Blush", 0f, 0f, 0.9f), + new VisualParam(705, "Blush Color", 0, "skin", "", "Pink", "Orange", 0.5f, 0f, 1f), + new VisualParam(706, "Out Shdw Opacity", 0, "skin", "", "Clear", "Opaque", 0.6f, 0.2f, 1f), + new VisualParam(707, "Outer Shadow", 0, "skin", "", "No Eyeshadow", "More Eyeshadow", 0f, 0f, 0.7f), + new VisualParam(708, "Out Shdw Color", 0, "skin", "", "Light", "Dark", 0f, 0f, 1f), + new VisualParam(709, "Inner Shadow", 0, "skin", "", "No Eyeshadow", "More Eyeshadow", 0f, 0f, 1f), + new VisualParam(710, "Nail Polish", 0, "skin", "", "No Polish", "Painted Nails", 0f, 0f, 1f), + new VisualParam(711, "Blush Opacity", 0, "skin", "", "Clear", "Opaque", 0.5f, 0f, 1f), + new VisualParam(712, "In Shdw Color", 0, "skin", "", "Light", "Dark", 0f, 0f, 1f), + new VisualParam(713, "In Shdw Opacity", 0, "skin", "", "Clear", "Opaque", 0.7f, 0.2f, 1f), + new VisualParam(714, "Eyeliner Color", 0, "skin", "", "Dark Green", "Black", 0f, 0f, 1f), + new VisualParam(715, "Nail Polish Color", 0, "skin", "", "Pink", "Black", 0f, 0f, 1f), + new VisualParam(750, "Eyebrow Density", 0, "hair", "", "Sparse", "Dense", 0.7f, 0f, 1f), + new VisualParam(752, "Hair Thickness", 0, "hair", "", "5 O'Clock Shadow", "Bushy Hair", 0.5f, 0f, 1f), + new VisualParam(753, "Saddlebags", 0, "shape", "Saddle Bags", "Less Saddle", "More Saddle", 0f, -0.5f, 3f), + new VisualParam(754, "Hair_Taper_Back", 0, "hair", "Taper Back", "Wide Back", "Narrow Back", 0f, -1f, 2f), + new VisualParam(755, "Hair_Taper_Front", 0, "hair", "Taper Front", "Wide Front", "Narrow Front", 0.05f, -1.5f, 1.5f), + new VisualParam(756, "Neck Length", 0, "shape", "", "Short Neck", "Long Neck", 0f, -1f, 1f), + new VisualParam(757, "Lower_Eyebrows", 0, "hair", "Eyebrow Height", "Higher", "Lower", -1f, -4f, 2f), + new VisualParam(758, "Lower_Bridge_Nose", 0, "shape", "Lower Bridge", "Low", "High", -1.5f, -1.5f, 1.5f), + new VisualParam(759, "Low_Septum_Nose", 0, "shape", "Nostril Division", "High", "Low", 0.5f, -1f, 1.5f), + new VisualParam(760, "Jaw_Angle", 0, "shape", "Jaw Angle", "Low Jaw", "High Jaw", 0f, -1.2f, 2f), + new VisualParam(762, "Hair_Shear_Front", 0, "hair", "Shear Front", "Full Front", "Sheared Front", 0f, 0f, 3f), + new VisualParam(763, "Hair Volume", 0, "hair", "", "Less Volume", "More Volume", 0.55f, 0f, 1f), + new VisualParam(764, "Lip_Cleft_Deep", 0, "shape", "Lip Cleft Depth", "Shallow", "Deep", -0.5f, -0.5f, 1.2f), + new VisualParam(765, "Puffy_Lower_Lids", 0, "shape", "Puffy Eyelids", "Flat", "Puffy", -0.3f, -0.3f, 2.5f), + new VisualParam(769, "Eye Depth", 0, "shape", "", "Sunken Eyes", "Bugged Eyes", 0.5f, 0f, 1f), + new VisualParam(773, "Head Length", 0, "shape", "", "Flat Head", "Long Head", 0.5f, 0f, 1f), + new VisualParam(775, "Body Freckles", 0, "skin", "", "Less Freckles", "More Freckles", 0f, 0f, 1f), + new VisualParam(779, "Collar Back", 0, "undershirt", "", "Low", "High", 0.84f, 0f, 1f), + new VisualParam(780, "Collar Back", 0, "jacket", "", "Low", "High", 0.8f, 0f, 1f), + new VisualParam(781, "Collar Back", 0, "shirt", "", "Low", "High", 0.78f, 0f, 1f), + new VisualParam(785, "Pigtails", 0, "hair", "", "Short Pigtails", "Long Pigtails", 0f, 0f, 1f), + new VisualParam(789, "Ponytail", 0, "hair", "", "Short Ponytail", "Long Ponytail", 0f, 0f, 1f), + new VisualParam(795, "Butt Size", 0, "shape", "Butt Size", "Flat Butt", "Big Butt", 0.25f, 0f, 1f), + new VisualParam(796, "Pointy_Ears", 0, "shape", "Ear Tips", "Flat", "Pointy", -0.4f, -0.4f, 3f), + new VisualParam(799, "Lip Ratio", 0, "shape", "Lip Ratio", "More Upper Lip", "More Lower Lip", 0.5f, 0f, 1f), + new VisualParam(800, "Sleeve Length", 0, "shirt", "", "Short", "Long", 0.89f, 0f, 1f), + new VisualParam(801, "Shirt Bottom", 0, "shirt", "", "Short", "Long", 1f, 0f, 1f), + new VisualParam(802, "Collar Front", 0, "shirt", "", "Low", "High", 0.78f, 0f, 1f), + new VisualParam(803, "shirt_red", 0, "shirt", "", "", "", 1f, 0f, 1f), + new VisualParam(804, "shirt_green", 0, "shirt", "", "", "", 1f, 0f, 1f), + new VisualParam(805, "shirt_blue", 0, "shirt", "", "", "", 1f, 0f, 1f), + new VisualParam(806, "pants_red", 0, "pants", "", "", "", 1f, 0f, 1f), + new VisualParam(807, "pants_green", 0, "pants", "", "", "", 1f, 0f, 1f), + new VisualParam(808, "pants_blue", 0, "pants", "", "", "", 1f, 0f, 1f), + new VisualParam(812, "shoes_red", 0, "shoes", "", "", "", 1f, 0f, 1f), + new VisualParam(813, "shoes_green", 0, "shoes", "", "", "", 1f, 0f, 1f), + new VisualParam(814, "Waist Height", 0, "pants", "", "Low", "High", 1f, 0f, 1f), + new VisualParam(815, "Pants Length", 0, "pants", "", "Short", "Long", 0.8f, 0f, 1f), + new VisualParam(816, "Loose Lower Clothing", 0, "pants", "Pants Fit", "Tight Pants", "Loose Pants", 0f, 0f, 1f), + new VisualParam(817, "shoes_blue", 0, "shoes", "", "", "", 1f, 0f, 1f), + new VisualParam(818, "socks_red", 0, "socks", "", "", "", 1f, 0f, 1f), + new VisualParam(819, "socks_green", 0, "socks", "", "", "", 1f, 0f, 1f), + new VisualParam(820, "socks_blue", 0, "socks", "", "", "", 1f, 0f, 1f), + new VisualParam(821, "undershirt_red", 0, "undershirt", "", "", "", 1f, 0f, 1f), + new VisualParam(822, "undershirt_green", 0, "undershirt", "", "", "", 1f, 0f, 1f), + new VisualParam(823, "undershirt_blue", 0, "undershirt", "", "", "", 1f, 0f, 1f), + new VisualParam(824, "underpants_red", 0, "underpants", "", "", "", 1f, 0f, 1f), + new VisualParam(825, "underpants_green", 0, "underpants", "", "", "", 1f, 0f, 1f), + new VisualParam(826, "underpants_blue", 0, "underpants", "", "", "", 1f, 0f, 1f), + new VisualParam(827, "gloves_red", 0, "gloves", "", "", "", 1f, 0f, 1f), + new VisualParam(828, "Loose Upper Clothing", 0, "shirt", "Shirt Fit", "Tight Shirt", "Loose Shirt", 0f, 0f, 1f), + new VisualParam(829, "gloves_green", 0, "gloves", "", "", "", 1f, 0f, 1f), + new VisualParam(830, "gloves_blue", 0, "gloves", "", "", "", 1f, 0f, 1f), + new VisualParam(834, "jacket_red", 0, "jacket", "", "", "", 1f, 0f, 1f), + new VisualParam(835, "jacket_green", 0, "jacket", "", "", "", 1f, 0f, 1f), + new VisualParam(836, "jacket_blue", 0, "jacket", "", "", "", 1f, 0f, 1f), + new VisualParam(840, "Shirtsleeve_flair", 0, "shirt", "Sleeve Looseness", "Tight Sleeves", "Loose Sleeves", 0f, 0f, 1.5f), + new VisualParam(841, "Bowed_Legs", 0, "shape", "Knee Angle", "Knock Kneed", "Bow Legged", 0f, -1f, 1f), + new VisualParam(842, "Hip Length", 0, "shape", "", "Short hips", "Long Hips", -1f, -1f, 1f), + new VisualParam(844, "Glove Fingers", 0, "gloves", "", "Fingerless", "Fingers", 1f, 0.01f, 1f), + new VisualParam(848, "skirt_bustle", 0, "skirt", "bustle skirt", "no bustle", "more bustle", 0.2f, 0f, 2f), + new VisualParam(858, "Skirt Length", 0, "skirt", "", "Short", "Long", 0.4f, 0.01f, 1f), + new VisualParam(859, "Slit Front", 0, "skirt", "", "Open Front", "Closed Front", 1f, 0f, 1f), + new VisualParam(860, "Slit Back", 0, "skirt", "", "Open Back", "Closed Back", 1f, 0f, 1f), + new VisualParam(861, "Slit Left", 0, "skirt", "", "Open Left", "Closed Left", 1f, 0f, 1f), + new VisualParam(862, "Slit Right", 0, "skirt", "", "Open Right", "Closed Right", 1f, 0f, 1f), + new VisualParam(863, "skirt_looseness", 0, "skirt", "Skirt Fit", "Tight Skirt", "Poofy Skirt", 0.333f, 0f, 1f), + new VisualParam(868, "Shirt Wrinkles", 0, "shirt", "", "", "", 0f, 0f, 1f), + new VisualParam(869, "Pants Wrinkles", 0, "pants", "", "", "", 0f, 0f, 1f), + new VisualParam(877, "Jacket Wrinkles", 0, "jacket", "Jacket Wrinkles", "No Wrinkles", "Wrinkles", 0f, 0f, 1f), + new VisualParam(879, "Male_Package", 0, "shape", "Package", "Coin Purse", "Duffle Bag", 0f, -0.5f, 2f), + new VisualParam(880, "Eyelid_Inner_Corner_Up", 0, "shape", "Inner Eye Corner", "Corner Down", "Corner Up", -1.3f, -1.3f, 1.2f), + new VisualParam(921, "skirt_red", 0, "skirt", "", "", "", 1f, 0f, 1f), + new VisualParam(922, "skirt_green", 0, "skirt", "", "", "", 1f, 0f, 1f), + new VisualParam(923, "skirt_blue", 0, "skirt", "", "", "", 1f, 0f, 1f), + }; } } diff --git a/libsecondlife-cs/examples/IA_ImageTool/ImageTool.cs b/libsecondlife-cs/examples/IA_ImageTool/ImageTool.cs index 7cdd054c..52795fe6 100644 --- a/libsecondlife-cs/examples/IA_ImageTool/ImageTool.cs +++ b/libsecondlife-cs/examples/IA_ImageTool/ImageTool.cs @@ -21,7 +21,6 @@ namespace IA_ImageTool private List _ImageIDs = new List(); private string _FileName; private bool _Put; - private double _Rate; /// /// Used to upload/download images. @@ -29,28 +28,22 @@ namespace IA_ImageTool [STAThread] static void Main(string[] args) { - Bitmap bitmap = (Bitmap)Bitmap.FromFile("test.jpg"); - byte[] j2k = OpenJPEGNet.OpenJPEG.EncodeFromImage(bitmap, String.Empty); - File.WriteAllBytes("test.j2c", j2k); - return; - if (args.Length < 5) { ImageTool.Usage(); return; } - List uuidList = new List(); - string filename = ""; + List uuidList = new List();; + string filename = String.Empty; bool put = false; - double rate = 0; if (args[3].ToLower().Equals("put")) { put = true; if (args.Length == 6) { - double.TryParse(args[4], out rate); + // TODO: Parse a compression rate from argument 6 filename = args[5]; } else @@ -70,8 +63,6 @@ namespace IA_ImageTool { uuidList.Add(id); } - - } else { @@ -81,8 +72,8 @@ namespace IA_ImageTool return; } - uuidList = new List(); - uuidList.Add( new LLUUID(args[4]) ); + uuidList.Add(new LLUUID(args[4])); + if (args.Length == 6) { filename = args[5]; @@ -93,27 +84,23 @@ namespace IA_ImageTool } } - ImageTool it = new ImageTool(uuidList, filename, put, rate); - + ImageTool it = new ImageTool(uuidList, filename, put); if (it.Connect(args[0], args[1], args[2])) { if (it.ConnectedSignal.WaitOne(TimeSpan.FromMinutes(1), false)) { it.doStuff(); - it.Disconnect(); } - } } - protected ImageTool(List imageIDs, string filename, bool put, double rate) + protected ImageTool(List imageIDs, string filename, bool put) { _ImageIDs = imageIDs; _FileName = filename; _Put = put; - _Rate = rate; try { @@ -172,15 +159,8 @@ namespace IA_ImageTool byte[] j2cdata = null; - if (_Rate != 0) - { - //j2cdata = KakaduWrap.ReadJ2CData(_FileName, _Rate); - } - else - { - Bitmap bitmap = (Bitmap)Bitmap.FromFile(_FileName); - j2cdata = OpenJPEGNet.OpenJPEG.EncodeFromImage(bitmap, String.Empty); - } + Bitmap bitmap = (Bitmap)Bitmap.FromFile(_FileName); + j2cdata = OpenJPEGNet.OpenJPEG.EncodeFromImage(bitmap, String.Empty); if (j2cdata == null) { @@ -227,19 +207,17 @@ namespace IA_ImageTool int end = Environment.TickCount; Console.WriteLine("Elapsed download time, in TickCounts: " + (end - start)); - Console.WriteLine("Image Data Length :" + j2cdata.Length); + Console.WriteLine("Image Data Length: " + j2cdata.Length); Console.WriteLine("Writing to: " + FileName + ".tga"); File.WriteAllBytes(FileName + ".tga", OpenJPEGNet.OpenJPEG.DecodeToTGA(j2cdata)); } catch (Exception e) { - Console.WriteLine("ERROR: Can't download image :: " + e.Message); + Console.WriteLine("ERROR: Can't download image: " + e.Message); } } } - - Console.WriteLine("Done..."); } protected static void Usage() diff --git a/libsecondlife-cs/examples/Teleport/Teleport.cs b/libsecondlife-cs/examples/Teleport/Teleport.cs index 6db22a81..ef79f26f 100644 --- a/libsecondlife-cs/examples/Teleport/Teleport.cs +++ b/libsecondlife-cs/examples/Teleport/Teleport.cs @@ -82,14 +82,8 @@ namespace Teleport { Console.WriteLine("Attempting to connect and login to Second Life."); - // Setup Login to Second Life - Dictionary loginParams = Client.Network.DefaultLoginValues(FirstName, - LastName, Password, "00:00:00:00:00:00", "last", "Win", "0", "createnotecard", - "static.sprocket@gmail.com"); - Dictionary loginReply = new Dictionary(); - // Login - if (!Client.Network.Login(loginParams)) + if (!Client.Network.Login(FirstName, LastName, Password, "Teleport", "static.sprocket@gmail.com")) { // Login failed Console.WriteLine("Error logging in: " + Client.Network.LoginError); @@ -114,18 +108,18 @@ namespace Teleport Client.Grid.OnRegionAdd += new GridRegionCallback(GridRegionHandler); Console.WriteLine("Caching estate sims..."); - Client.Grid.AddEstateSims(); + Client.Grid.RequestEstateSims(GridManager.MapLayerType.Objects); System.Threading.Thread.Sleep(3000); if (RegionHandle == 0) { - Client.Grid.BeginGetGridRegion(sim, new GridRegionCallback(GridRegionHandler)); + Client.Grid.BeginGetGridRegion(sim); int start = Environment.TickCount; while (RegionHandle == 0) { - Client.Tick(); + System.Threading.Thread.Sleep(100); if (Environment.TickCount - start > 10000) { @@ -143,7 +137,9 @@ namespace Teleport while (!DoneTeleporting) { - Client.Tick(); + // FIXME: Sleeping while loops are a poor example, this is supposed to be + // model code. Replace this with a ManualResetEvent + System.Threading.Thread.Sleep(500); } } diff --git a/libsecondlife-cs/examples/TestClient/Commands/FindSimCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/FindSimCommand.cs index ed4c1850..07c14dde 100644 --- a/libsecondlife-cs/examples/TestClient/Commands/FindSimCommand.cs +++ b/libsecondlife-cs/examples/TestClient/Commands/FindSimCommand.cs @@ -33,7 +33,7 @@ namespace libsecondlife.TestClient if (!GridDataCached[Client]) { - Client.Grid.AddAllSims(); + Client.Grid.RequestAllSims(GridManager.MapLayerType.Objects); System.Threading.Thread.Sleep(5000); GridDataCached[Client] = true; } diff --git a/libsecondlife-cs/examples/TestClient/Commands/Movement/GotoCommand.cs b/libsecondlife-cs/examples/TestClient/Commands/Movement/GotoCommand.cs index 20460729..ae4586f2 100644 --- a/libsecondlife-cs/examples/TestClient/Commands/Movement/GotoCommand.cs +++ b/libsecondlife-cs/examples/TestClient/Commands/Movement/GotoCommand.cs @@ -44,7 +44,7 @@ namespace libsecondlife.TestClient if (!EstateLookupFinished) { - Client.Grid.AddEstateSims(); + Client.Grid.RequestEstateSims(GridManager.MapLayerType.Objects); System.Threading.Thread.Sleep(3000); EstateLookupFinished = true; diff --git a/libsecondlife-cs/examples/name2key/name2key.cs b/libsecondlife-cs/examples/name2key/name2key.cs index 57c13386..7084e053 100644 --- a/libsecondlife-cs/examples/name2key/name2key.cs +++ b/libsecondlife-cs/examples/name2key/name2key.cs @@ -73,6 +73,7 @@ namespace name2key client = new SecondLife(); // Setup the callback + // FIXME: Rewrite this code as soon as people searching is added to DirectoryManager client.Network.RegisterCallback(PacketType.DirPeopleReply, new NetworkManager.PacketCallback(QueryHandler)); // Setup the login values @@ -99,17 +100,12 @@ namespace name2key while (waiting) { - client.Tick(); + // FIXME: Sleeping while loops are a poor example, this is supposed to be + // model code. Replace this with a ManualResetEvent + System.Threading.Thread.Sleep(500); } client.Network.Logout(); - - waiting = true; - while (waiting) - { - waiting = client.Network.Connected; - client.Tick(); - } } } } diff --git a/openjpegnet/OpenJPEG.cs b/openjpegnet/OpenJPEG.cs index 041ab2d7..9c2f00e5 100644 --- a/openjpegnet/OpenJPEG.cs +++ b/openjpegnet/OpenJPEG.cs @@ -282,92 +282,104 @@ namespace OpenJPEGNet /// Byte array containing a Targa file public unsafe static byte[] DecodeToTGA(byte[] j2kdata) { - const int TGA_HEADER_SIZE = 32; + byte[] output; - opj_dparameters_t parameters = new opj_dparameters_t(); - opj_image_t image; - - opj_dinfo_t dinfo; - opj_cio_t cio; - - // TODO: configure the event callbacks - - // setup the decoding parameters - opj_set_default_decoder_parameters(ref parameters); - - // get a decoder handle - IntPtr dinfo_ptr = opj_create_decompress(OPJ_CODEC_FORMAT.CODEC_J2K); - dinfo = (opj_dinfo_t)Marshal.PtrToStructure(dinfo_ptr, typeof(opj_dinfo_t)); - - // TODO: setup the callbacks - - // setup the decoder - opj_setup_decoder(ref dinfo, ref parameters); - - // open a byte stream - IntPtr cio_ptr = (IntPtr)opj_cio_open((opj_common_struct_t*)dinfo_ptr, j2kdata, j2kdata.Length); - cio = (opj_cio_t)Marshal.PtrToStructure(cio_ptr, typeof(opj_cio_t)); - - // decode - IntPtr image_ptr = opj_decode(ref dinfo, ref cio); - image = (opj_image_t)Marshal.PtrToStructure(image_ptr, typeof(opj_image_t)); - - int width = image.x1 - image.x0; - int height = image.y1 - image.y0; - int components = image.numcomps; - - // create the targa file in memory - byte[] output = new byte[width * height * 4 + TGA_HEADER_SIZE]; - - int offset = 0; - output[offset++] = 0; // idlength - output[offset++] = 0; // colormaptype = 0: no colormap - output[offset++] = 2; // image type = 2: uncompressed RGB - output[offset++] = 0; // color map spec is five zeroes for no color map - output[offset++] = 0; // color map spec is five zeroes for no color map - output[offset++] = 0; // color map spec is five zeroes for no color map - output[offset++] = 0; // color map spec is five zeroes for no color map - output[offset++] = 0; // color map spec is five zeroes for no color map - output[offset++] = 0; // x origin = two bytes - output[offset++] = 0; // x origin = two bytes - output[offset++] = 0; // y origin = two bytes - output[offset++] = 0; // y origin = two bytes - output[offset++] = (byte)(width & 0xFF); // width - low byte - output[offset++] = (byte)(width >> 8); // width - hi byte - output[offset++] = (byte)(height & 0xFF); // height - low byte - output[offset++] = (byte)(height >> 8); // height - hi byte - output[offset++] = 32; // 32 bits per pixel - output[offset++] = 40; // image descriptor byte - - switch (image.numcomps) + try { - case 4: - for (int i = 0; i < (width * height); i++) - { - output[offset++] = (byte)image.comps[2].data[i]; // red - output[offset++] = (byte)image.comps[1].data[i]; // green - output[offset++] = (byte)image.comps[0].data[i]; // blue - output[offset++] = (byte)image.comps[3].data[i]; // alpha - } - break; - case 3: - for (int i = 0; i < (width * height); i++) - { - output[offset++] = (byte)image.comps[2].data[i]; // red - output[offset++] = (byte)image.comps[1].data[i]; // green - output[offset++] = (byte)image.comps[0].data[i]; // blue - output[offset++] = 0xFF; // alpha - } - break; - default: - // ??? - break; + const int TGA_HEADER_SIZE = 32; + + opj_dparameters_t parameters = new opj_dparameters_t(); + opj_image_t image; + + opj_dinfo_t dinfo; + opj_cio_t cio; + + // TODO: configure the event callbacks + + // setup the decoding parameters + opj_set_default_decoder_parameters(ref parameters); + + // get a decoder handle + IntPtr dinfo_ptr = opj_create_decompress(OPJ_CODEC_FORMAT.CODEC_J2K); + dinfo = (opj_dinfo_t)Marshal.PtrToStructure(dinfo_ptr, typeof(opj_dinfo_t)); + + // TODO: setup the callbacks + + // setup the decoder + opj_setup_decoder(ref dinfo, ref parameters); + + // open a byte stream + IntPtr cio_ptr = (IntPtr)opj_cio_open((opj_common_struct_t*)dinfo_ptr, j2kdata, j2kdata.Length); + cio = (opj_cio_t)Marshal.PtrToStructure(cio_ptr, typeof(opj_cio_t)); + + // decode + IntPtr image_ptr = opj_decode(ref dinfo, ref cio); + image = (opj_image_t)Marshal.PtrToStructure(image_ptr, typeof(opj_image_t)); + + int width = image.x1 - image.x0; + int height = image.y1 - image.y0; + int components = image.numcomps; + + // create the targa file in memory + output = new byte[width * height * 4 + TGA_HEADER_SIZE]; + + int offset = 0; + output[offset++] = 0; // idlength + output[offset++] = 0; // colormaptype = 0: no colormap + output[offset++] = 2; // image type = 2: uncompressed RGB + output[offset++] = 0; // color map spec is five zeroes for no color map + output[offset++] = 0; // color map spec is five zeroes for no color map + output[offset++] = 0; // color map spec is five zeroes for no color map + output[offset++] = 0; // color map spec is five zeroes for no color map + output[offset++] = 0; // color map spec is five zeroes for no color map + output[offset++] = 0; // x origin = two bytes + output[offset++] = 0; // x origin = two bytes + output[offset++] = 0; // y origin = two bytes + output[offset++] = 0; // y origin = two bytes + output[offset++] = (byte)(width & 0xFF); // width - low byte + output[offset++] = (byte)(width >> 8); // width - hi byte + output[offset++] = (byte)(height & 0xFF); // height - low byte + output[offset++] = (byte)(height >> 8); // height - hi byte + output[offset++] = 32; // 32 bits per pixel + output[offset++] = 40; // image descriptor byte + + switch (image.numcomps) + { + case 5: + // We can't represent the fifth + case 4: + for (int i = 0; i < (width * height); i++) + { + output[offset++] = (byte)image.comps[2].data[i]; // red + output[offset++] = (byte)image.comps[1].data[i]; // green + output[offset++] = (byte)image.comps[0].data[i]; // blue + output[offset++] = (byte)image.comps[3].data[i]; // alpha + } + break; + case 3: + for (int i = 0; i < (width * height); i++) + { + output[offset++] = (byte)image.comps[2].data[i]; // red + output[offset++] = (byte)image.comps[1].data[i]; // green + output[offset++] = (byte)image.comps[0].data[i]; // blue + output[offset++] = 0xFF; // alpha + } + break; + default: + Console.WriteLine("Unhandled numcomps: " + image.numcomps); + return null; + } + + File.WriteAllBytes("out.tga", output); + + opj_cio_close((opj_cio_t*)cio_ptr); + opj_destroy_decompress(dinfo_ptr); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); + return null; } - - File.WriteAllBytes("out.tga", output); - - opj_cio_close((opj_cio_t*)cio_ptr); - opj_destroy_decompress(dinfo_ptr); return output; } @@ -385,159 +397,169 @@ namespace OpenJPEGNet public unsafe static byte[] EncodeFromImage(Bitmap bitmap, string comment) { - const int MAX_COMPS = 4; + byte[] output = null; - // setup the parameters - IntPtr parameters_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(opj_cparameters_t))); - opj_set_default_encoder_parameters(parameters_ptr); - - opj_cparameters_t parameters = (opj_cparameters_t)Marshal.PtrToStructure(parameters_ptr, typeof(opj_cparameters_t)); - - parameters.tcp_rates[0] = 0; - parameters.tcp_numlayers++; - parameters.cp_disto_alloc = 1; - parameters.cod_format = 0; - parameters.subsampling_dx = 1; - parameters.subsampling_dy = 1; - parameters.cp_comment = comment; - - OPJ_COLOR_SPACE color_space = OPJ_COLOR_SPACE.CLRSPC_SRGB; - opj_image_cmptparm_t[] cmptparm = new opj_image_cmptparm_t[MAX_COMPS]; - int width = bitmap.Width; - int height = bitmap.Height; - - for (int c = 0; c < MAX_COMPS; c++) + try { - cmptparm[c] = new opj_image_cmptparm_t(); + const int MAX_COMPS = 4; - cmptparm[c].prec = 8; - cmptparm[c].bpp = 8; - cmptparm[c].sgnd = 0; - cmptparm[c].dx = parameters.subsampling_dx; - cmptparm[c].dy = parameters.subsampling_dy; - cmptparm[c].w = width; - cmptparm[c].h = height; - } + // setup the parameters + IntPtr parameters_ptr = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(opj_cparameters_t))); + opj_set_default_encoder_parameters(parameters_ptr); - // create the image - int i = 0; - int numcomps; - PixelFormat format = bitmap.PixelFormat; + opj_cparameters_t parameters = (opj_cparameters_t)Marshal.PtrToStructure(parameters_ptr, typeof(opj_cparameters_t)); - if ((format & PixelFormat.Alpha) != 0 || (format & PixelFormat.PAlpha) != 0) - numcomps = 4; - else if (format == PixelFormat.Format16bppGrayScale) - numcomps = 1; - else - numcomps = 3; + parameters.tcp_rates[0] = 0; + parameters.tcp_numlayers++; + parameters.cp_disto_alloc = 1; + parameters.cod_format = 0; + parameters.subsampling_dx = 1; + parameters.subsampling_dy = 1; + parameters.cp_comment = comment; - opj_image_t* image_ptr = opj_image_create(numcomps, cmptparm, color_space); - image_ptr->x1 = width; - image_ptr->y1 = height; + OPJ_COLOR_SPACE color_space = OPJ_COLOR_SPACE.CLRSPC_SRGB; + opj_image_cmptparm_t[] cmptparm = new opj_image_cmptparm_t[MAX_COMPS]; + int width = bitmap.Width; + int height = bitmap.Height; - BitmapData data; - - // Build the raw image buffer for openjpeg to read - if ((format & PixelFormat.Alpha) != 0 || (format & PixelFormat.PAlpha) != 0) - { - // four layers, RGBA - data = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, - PixelFormat.Format32bppArgb); - - for (int y = 0; y < height; y++) + for (int c = 0; c < MAX_COMPS; c++) { - for (int x = 0; x < width; x++) - { - byte* pixel = (byte*)data.Scan0; - pixel += (y * width + x) * numcomps; + cmptparm[c] = new opj_image_cmptparm_t(); - // GDI+ gives us BGRA and we need to turn that in to RGBA - (*image_ptr).comps[0].data[i] = *(pixel + 2); - (*image_ptr).comps[1].data[i] = *(pixel + 1); - (*image_ptr).comps[2].data[i] = *(pixel); - (*image_ptr).comps[3].data[i] = *(pixel + 3); - - pixel += 4; - i++; - } + cmptparm[c].prec = 8; + cmptparm[c].bpp = 8; + cmptparm[c].sgnd = 0; + cmptparm[c].dx = parameters.subsampling_dx; + cmptparm[c].dy = parameters.subsampling_dy; + cmptparm[c].w = width; + cmptparm[c].h = height; } - } - else if (format == PixelFormat.Format16bppGrayScale) - { - // one layer - data = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, - PixelFormat.Format16bppGrayScale); - for (int y = 0; y < height; y++) + // create the image + int i = 0; + int numcomps; + PixelFormat format = bitmap.PixelFormat; + + if ((format & PixelFormat.Alpha) != 0 || (format & PixelFormat.PAlpha) != 0) + numcomps = 4; + else if (format == PixelFormat.Format16bppGrayScale) + numcomps = 1; + else + numcomps = 3; + + opj_image_t* image_ptr = opj_image_create(numcomps, cmptparm, color_space); + image_ptr->x1 = width; + image_ptr->y1 = height; + + BitmapData data; + + // Build the raw image buffer for openjpeg to read + if ((format & PixelFormat.Alpha) != 0 || (format & PixelFormat.PAlpha) != 0) { - for (int x = 0; x < width; x++) + // four layers, RGBA + data = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, + PixelFormat.Format32bppArgb); + + for (int y = 0; y < height; y++) { - byte* pixel = (byte*)data.Scan0; - pixel += (y * width + x) * numcomps; - - // turn 16 bit data in to 8 bit data (TODO: Does this work?) - (*image_ptr).comps[0].data[i] = *(pixel); - - pixel += 2; - i++; - } - } - } - else - { - // three layers, RGB - data = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, - PixelFormat.Format24bppRgb); - - for (int y = 0; y < height; y++) - { - for (int x = 0; x < width; x++) - { - byte* pixel = (byte*)data.Scan0; - pixel += (y * width + x) * numcomps; - - for (int c = numcomps - 1; c >= 0; c--) + for (int x = 0; x < width; x++) { - (*image_ptr).comps[c].data[i] = *pixel; - pixel++; + byte* pixel = (byte*)data.Scan0; + pixel += (y * width + x) * numcomps; + + // GDI+ gives us BGRA and we need to turn that in to RGBA + (*image_ptr).comps[0].data[i] = *(pixel + 2); + (*image_ptr).comps[1].data[i] = *(pixel + 1); + (*image_ptr).comps[2].data[i] = *(pixel); + (*image_ptr).comps[3].data[i] = *(pixel + 3); + + pixel += 4; + i++; } - i++; } } - } + else if (format == PixelFormat.Format16bppGrayScale) + { + // one layer + data = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, + PixelFormat.Format16bppGrayScale); - bitmap.UnlockBits(data); + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + byte* pixel = (byte*)data.Scan0; + pixel += (y * width + x) * numcomps; - // get a J2K compressor handle - opj_cinfo_t* cinfo_ptr = opj_create_compress(OPJ_CODEC_FORMAT.CODEC_J2K); + // turn 16 bit data in to 8 bit data (TODO: Does this work?) + (*image_ptr).comps[0].data[i] = *(pixel); - // TODO: setup the callbacks + pixel += 2; + i++; + } + } + } + else + { + // three layers, RGB + data = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, + PixelFormat.Format24bppRgb); - // setup the encoder parameters - Marshal.StructureToPtr(parameters, parameters_ptr, true); - opj_setup_encoder(cinfo_ptr, parameters_ptr, image_ptr); + for (int y = 0; y < height; y++) + { + for (int x = 0; x < width; x++) + { + byte* pixel = (byte*)data.Scan0; + pixel += (y * width + x) * numcomps; - // open a byte stream for writing - opj_cio_t* cio_ptr = opj_cio_open((void*)cinfo_ptr, null, 0); + for (int c = numcomps - 1; c >= 0; c--) + { + (*image_ptr).comps[c].data[i] = *pixel; + pixel++; + } + i++; + } + } + } + + bitmap.UnlockBits(data); + + // get a J2K compressor handle + opj_cinfo_t* cinfo_ptr = opj_create_compress(OPJ_CODEC_FORMAT.CODEC_J2K); + + // TODO: setup the callbacks + + // setup the encoder parameters + Marshal.StructureToPtr(parameters, parameters_ptr, true); + opj_setup_encoder(cinfo_ptr, parameters_ptr, image_ptr); + + // open a byte stream for writing + opj_cio_t* cio_ptr = opj_cio_open((void*)cinfo_ptr, null, 0); + + // encode the image + bool success = opj_encode(cinfo_ptr, cio_ptr, image_ptr, null); + if (!success) + { + opj_cio_close(cio_ptr); + return null; + } + + int codestream_length = cio_tell(cio_ptr); + + output = new byte[codestream_length]; + Marshal.Copy((IntPtr)(*cio_ptr).buffer, output, 0, codestream_length); - // encode the image - bool success = opj_encode(cinfo_ptr, cio_ptr, image_ptr, null); - if (!success) - { opj_cio_close(cio_ptr); + opj_destroy_compress(cinfo_ptr); + opj_image_destroy(image_ptr); + Marshal.FreeHGlobal(parameters_ptr); + } + catch (Exception e) + { + Console.WriteLine(e.ToString()); return null; } - int codestream_length = cio_tell(cio_ptr); - - byte[] output = new byte[codestream_length]; - Marshal.Copy((IntPtr)(*cio_ptr).buffer, output, 0, codestream_length); - - opj_cio_close(cio_ptr); - opj_destroy_compress(cinfo_ptr); - opj_image_destroy(image_ptr); - Marshal.FreeHGlobal(parameters_ptr); - return output; } }