public static void LoadSimBody(Sim sim) { var appearance = SimCatalog.GetOutfit(sim.BodyOutfitID) .GetAppearanceObject(sim.AppearanceType); sim.BodyBindings = appearance.Bindings.Select( x => new SimModelBinding(x.ID) ).ToList(); }
public static Texture2D LoadTexture(this Binding binding) { return(SimCatalog.GetOutfitTexture(binding.TextureAssetID)); }
public static Mesh LoadMesh(this Binding binding) { return(SimCatalog.GetOutfitMesh(binding.MeshAssetID)); }
public static Binding GetBinding(this Appearance appearance) { return(SimCatalog.GetBinding(appearance.Bindings[0].ID)); }
public static Appearance GetAppearanceObject(this Outfit outfit, AppearanceType type) { return(SimCatalog.GetAppearance(outfit.GetAppearance(type))); }
public static void LoadSimHands(Sim sim) { ulong ID = SimCatalog.GetOutfit(sim.BodyOutfitID).HandGroup; Hag HandGrp = new Hag(new MemoryStream(ContentManager.GetResourceFromLongID(ID))); Appearance Apr; //This is UGLY, there must be a better way of doing this. :\ switch (sim.AppearanceType) { case AppearanceType.Light: if (HandGrp.LightSkin.LeftHand.FistGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.LightSkin.LeftHand.FistGesture))); sim.LeftHandBindings.FistBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.LightSkin.RightHand.FistGesture))); sim.RightHandBindings.FistBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } if (HandGrp.LightSkin.LeftHand.IdleGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.LightSkin.LeftHand.IdleGesture))); sim.LeftHandBindings.IdleBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.LightSkin.RightHand.IdleGesture))); sim.RightHandBindings.IdleBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } if (HandGrp.LightSkin.LeftHand.PointingGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.LightSkin.LeftHand.PointingGesture))); sim.LeftHandBindings.PointingBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.LightSkin.RightHand.PointingGesture))); sim.RightHandBindings.PointingBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } break; case AppearanceType.Medium: if (HandGrp.MediumSkin.LeftHand.FistGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.MediumSkin.LeftHand.FistGesture))); sim.LeftHandBindings.FistBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.MediumSkin.RightHand.FistGesture))); sim.RightHandBindings.FistBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } if (HandGrp.MediumSkin.LeftHand.IdleGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.MediumSkin.LeftHand.IdleGesture))); sim.LeftHandBindings.IdleBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.MediumSkin.RightHand.IdleGesture))); sim.RightHandBindings.IdleBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } if (HandGrp.MediumSkin.LeftHand.PointingGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.MediumSkin.LeftHand.PointingGesture))); sim.LeftHandBindings.PointingBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.MediumSkin.RightHand.PointingGesture))); sim.RightHandBindings.PointingBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } break; case AppearanceType.Dark: if (HandGrp.DarkSkin.LeftHand.FistGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.DarkSkin.LeftHand.FistGesture))); sim.LeftHandBindings.FistBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.DarkSkin.RightHand.FistGesture))); sim.RightHandBindings.FistBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } if (HandGrp.DarkSkin.LeftHand.IdleGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.DarkSkin.LeftHand.IdleGesture))); sim.LeftHandBindings.IdleBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.DarkSkin.RightHand.IdleGesture))); sim.RightHandBindings.IdleBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } if (HandGrp.DarkSkin.LeftHand.PointingGesture != 0) { Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.DarkSkin.LeftHand.PointingGesture))); sim.LeftHandBindings.PointingBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); Apr = new Appearance(); Apr.Read(new MemoryStream(ContentManager.GetResourceFromLongID( HandGrp.DarkSkin.RightHand.PointingGesture))); sim.RightHandBindings.PointingBindings = Apr.Bindings.Select(x => new SimModelBinding(x.ID)).ToList(); } break; } }