ClothingContainerclass

Holds a collection of clothing items. Won't let you add items that aren't compatible.

object→ClothingContainer
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.ClothingContainer

Constructors1

Showing 1 constructors

Methods21

Showing 21 methods

public void Apply(Sandbox.SkinnedModelRenderer body)PUBLICOBSOLETE

Dresses a body with this outfit and appearance without downloading missing clothing.

Obsolete: Use Dresser.UpdateAppearance and Dresser.Apply instead.

ParameterTypeDescription
bodySkinnedModelRenderer—
Returns:void—

public System.Threading.Tasks.Task ApplyAsync(Sandbox.SkinnedModelRenderer body, System.Threading.CancellationToken token)PUBLICOBSOLETE

Dresses a body with this outfit and appearance, downloading missing clothing.

Obsolete: Use Dresser.UpdateAppearance and Dresser.ApplyAsync instead.

ParameterTypeDescription
bodySkinnedModelRenderer—
tokenCancellationToken—
Returns:Task—

public Sandbox.GameObject ApplyDeforms(Sandbox.SkinnedModelRenderer body, bool enabled = True)PUBLICOBSOLETE

Updates deforms without rebuilding clothing. Returns the prefab instance, if the model supports one.

Obsolete: Use Dresser.UpdateAppearance instead.

ParameterTypeDescription
bodySkinnedModelRenderer—
enabled = Truebool—
Returns:GameObject—

public void ApplyEyes(Sandbox.SkinnedModelRenderer body)PUBLICOBSOLETE

Updates eye render attributes on the body and clothing without rebuilding the outfit. Materials using the procedural eye shader consume these per-renderer values.

Obsolete: Use Dresser.UpdateAppearance instead.

ParameterTypeDescription
bodySkinnedModelRenderer—
Returns:void—

public static Sandbox.ClothingContainer CreateFromConnection(Sandbox.Connection connection, bool removeUnowned = True)PUBLICSTATIC

Create the container from a connection's avatar, filtered to only items they are verified to own.

ParameterTypeDescription
connectionConnection—
removeUnowned = Truebool—

public static Sandbox.ClothingContainer CreateFromJson(string json)PUBLICSTATIC

Create the container from json definitions

ParameterTypeDescription
jsonstring—

public static Sandbox.ClothingContainer CreateFromLocalUser()PUBLICSTATIC

Create the container from the local user's setup, stripped of any unowned items.

public void Deserialize(string json)PUBLIC

Deserialize from Json

ParameterTypeDescription
jsonstring—
Returns:void—

public bool Has(Sandbox.Clothing clothing)PUBLIC

Returns true if we have this clothing item

ParameterTypeDescription
clothingClothing—
Returns:bool—

public void Normalize()PUBLIC

Restrict things like Height to their sensible limits

Returns:void—

public void Reset(Sandbox.SkinnedModelRenderer body)PUBLICOBSOLETE

Removes clothing and resets the body's height, material group and bodygroups.

Obsolete: Use Dresser.Clear to remove clothing while preserving appearance.

ParameterTypeDescription
bodySkinnedModelRenderer—
Returns:void—

public string Serialize()PUBLIC

Serialize to Json

Returns:string—

public void Toggle(Sandbox.Clothing clothing)PUBLIC

Add a clothing item if we don't already contain it, else remove it

ParameterTypeDescription
clothingClothing—
Returns:void—

Properties13

Showing 13 properties

public float Sandbox.ClothingContainer.Age { get; set; }PUBLICGETSET

The avatar's age. Default is 0.0f. We'll pick a skin based on this.

Returns:float—

public float Sandbox.ClothingContainer.ChestSize { get; set; }PUBLICGETSET

Normalized chest deformation, from zero to one.

Returns:float—

public float Sandbox.ClothingContainer.ChinSize { get; set; }PUBLICGETSET

Normalized chin deformation, from zero to one.

Returns:float—

public string Sandbox.ClothingContainer.DisplayName { get; set; }PUBLICGETSET

A user set name for this setup

Returns:string—

public float Sandbox.ClothingContainer.EyeAlign { get; set; }PUBLICGETSET

Normalized horizontal iris alignment. The midpoint preserves the material's centre.

Returns:float—

public float Sandbox.ClothingContainer.EyeColor { get; set; }PUBLICGETSET

Position on Dresser's eye colour gradient, from zero to one.

Returns:float—

public float Sandbox.ClothingContainer.HeadShape { get; set; }PUBLICGETSET

Normalized head deformation, from zero to one.

Returns:float—

public float Sandbox.ClothingContainer.Height { get; set; }PUBLICGETSET

The avatar's height. Default is 0.5f.

Returns:float—

public float Sandbox.ClothingContainer.NeckSize { get; set; }PUBLICGETSET

Normalized neck deformation, from zero to one.

Returns:float—

public float Sandbox.ClothingContainer.NoseSize { get; set; }PUBLICGETSET

Normalized nose deformation, from zero to one.

Returns:float—

public bool Sandbox.ClothingContainer.PrefersHuman { get; set; }PUBLICGETSET

If true, this avatar prefers to use a human model when possible

Returns:bool—

public float Sandbox.ClothingContainer.Tint { get; set; }PUBLICGETSET

For the citizen the skin color is dynamic, based on a gradient. This is 0-1.

Returns:float—

public float Sandbox.ClothingContainer.WaistSize { get; set; }PUBLICGETSET

Normalized waist deformation, from zero to one.

Returns:float—

On this page

Constructorspublic ClothingContainer()Methodspublic Sandbox.ClothingContainer.ClothingEntry Add(Sandbox.Clothing clothing)public System.Void Add(Sandbox.ClothingContainer.ClothingEntry clothing)public System.Void AddRange(System.Collections.Generic.IEnumerable`1<Sandbox.ClothingContainer.ClothingEntry> clothing)public System.Void Apply(Sandbox.SkinnedModelRenderer body)public System.Threading.Tasks.Task ApplyAsync(Sandbox.SkinnedModelRenderer body, System.Threading.CancellationToken token)public Sandbox.GameObject ApplyDeforms(Sandbox.SkinnedModelRenderer body, System.Boolean enabled = True)public System.Void ApplyEyes(Sandbox.SkinnedModelRenderer body)public static Sandbox.ClothingContainer CreateFromConnection(Sandbox.Connection connection, System.Boolean removeUnowned = True)public static Sandbox.ClothingContainer CreateFromJson(System.String json)public static Sandbox.ClothingContainer CreateFromLocalUser()public System.Void Deserialize(System.String json)public Sandbox.ClothingContainer.ClothingEntry FindEntry(Sandbox.Clothing clothing)public System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<System.String,System.Int32>> GetBodyGroups()public System.Collections.Generic.IEnumerable`1<System.ValueTuple`2<System.String,System.Int32>> GetBodyGroups(System.Collections.Generic.IEnumerable`1<Sandbox.Clothing> items, Sandbox.Model model = null)public System.Boolean Has(Sandbox.Clothing clothing)public System.Void Normalize()public System.Void RemoveUnownedItems()public System.Void RemoveUnownedItems(Sandbox.Connection connection)public System.Void Reset(Sandbox.SkinnedModelRenderer body)public System.String Serialize()public System.Void Toggle(Sandbox.Clothing clothing)Propertiespublic System.Single Sandbox.ClothingContainer.Age { get; set; }public System.Single Sandbox.ClothingContainer.ChestSize { get; set; }public System.Single Sandbox.ClothingContainer.ChinSize { get; set; }public System.String Sandbox.ClothingContainer.DisplayName { get; set; }public System.Single Sandbox.ClothingContainer.EyeAlign { get; set; }public System.Single Sandbox.ClothingContainer.EyeColor { get; set; }public System.Single Sandbox.ClothingContainer.HeadShape { get; set; }public System.Single Sandbox.ClothingContainer.Height { get; set; }public System.Single Sandbox.ClothingContainer.NeckSize { get; set; }public System.Single Sandbox.ClothingContainer.NoseSize { get; set; }public System.Boolean Sandbox.ClothingContainer.PrefersHuman { get; set; }public System.Single Sandbox.ClothingContainer.Tint { get; set; }public System.Single Sandbox.ClothingContainer.WaistSize { get; set; }Metadata