Reference API Roblox

Engine API

Website

Related

Reference API Roblox

WrapLayer

The WrapLayer object defines a 3D accessory's inner and outer surfaces and other properties related to layering accessories. These surfaces, or the Inner Cage and Outer Cage, are similar to collision boxes, and describe the surfaces of which other 3D accessories can be placed without clipping or breaking.

Member index 16

HistoryMember
731AutoSkin: WrapLayerAutoSkin
731BindOffset: CFrame
731Color: Color3
731DebugMode: WrapLayerDebugMode
731Enabled: bool
731Order: int
731Puffiness: float
731ReferenceMeshContent: Content
645ReferenceMeshId: ContentId
731ReferenceOrigin: CFrame
731ReferenceOriginWorld: CFrame
731ShrinkFactor: float
inherited from BaseWrap
731CageMeshContent: Content
731CageMeshId: ContentId
731CageOrigin: CFrame
731CageOriginWorld: CFrame
731HSRAssetId: ContentId
731HSRContent: Content
731ImportOrigin: CFrame
731ImportOriginWorld: CFrame
603GetCageOffset(): Vector3
475GetFaces(cageType: CageType): Array
629GetUVs(cageType: CageType): Array
475GetVertices(cageType: CageType): Array
499IsHSRReady(): bool
573ModifyVertices(cageType: CageType, vertices: Array): null
639VerticesModified(vertices: Array)
inherited from Instance
731Archivable: bool
731Capabilities: SecurityCapabilities
731IsInSandbox: bool
731Name: string
731Parent: Instance
731PredictionMode: PredictionMode
731Sandboxed: bool
731UniqueId: UniqueId
576AddTag(tag: string): null
573ClearAllChildren(): null
462Clone(): Instance
573Destroy(): null
486FindFirstAncestor(name: string): Instance
486FindFirstAncestorOfClass(className: string): Instance
486FindFirstAncestorWhichIsA(className: string): Instance
486FindFirstChild(name: string, recursive: bool = false): Instance
486FindFirstChildOfClass(className: string): Instance
486FindFirstChildWhichIsA(className: string, recursive: bool = false): Instance
486FindFirstDescendant(name: string): Instance
563GetActor(): Actor
486GetAttribute(attribute: string): Variant
462GetAttributeChangedSignal(attribute: string): RBXScriptSignal
631GetAttributes(): Dictionary
648GetChildren(): Instances
462GetDebugId(scopeLength: int = 4): string
707GetDescendants(): Instances
486GetFullName(): string
706GetStyled(name: string, selector: string?): Variant
657GetStyledPropertyChangedSignal(property: string): RBXScriptSignal
576GetTags(): Array
576HasTag(tag: string): bool
486IsAncestorOf(descendant: Instance): bool
486IsDescendantOf(ancestor: Instance): bool
664IsPropertyModified(property: string): bool
698QueryDescendants(selector: string): Instances
573Remove(): null
576RemoveTag(tag: string): null
664ResetPropertyToDefault(property: string): null
573SetAttribute(attribute: string, value: Variant): null
462WaitForChild(childName: string, timeOut: double): Instance
731children(): Instances
731clone(): Instance
731destroy(): null
731findFirstChild(name: string, recursive: bool = false): Instance
731getChildren(): Instances
731isDescendantOf(ancestor: Instance): bool
731remove(): null
462AncestryChanged(child: Instance, parent: Instance)
462AttributeChanged(attribute: string)
462ChildAdded(child: Instance)
462ChildRemoved(child: Instance)
462DescendantAdded(descendant: Instance)
462DescendantRemoving(descendant: Instance)
500Destroying()
657StyledPropertiesChanged()
731childAdded(child: Instance)
inherited from Object
731ClassName: string
731className: string
647GetPropertyChangedSignal(property: string): RBXScriptSignal
647IsA(className: string): bool
731isA(className: string): bool
647Changed(property: string)

Description

The WrapLayer object defines a 3D accessory's inner and outer surfaces and other properties related to layering accessories. These surfaces, or the Inner Cage and Outer Cage, are similar to collision boxes, and describe the surfaces of which other 3D accessories can be placed without clipping or breaking.

Internally, WrapLayer also uses the UV layout of the Inner and Outer cages to match coordinates to another 3D object's cage. This powers the deformation of objects around differently shaped avatars and underlying accessories.

History 97

Members 16

AutoSkin

TypeDefault
WrapLayerAutoSkinDisabled

Determines whether this WrapLayer automatically transfers skinning data from the underlying body mesh to the clothing mesh. When set to EnabledOverride, skinning is applied regardless of whether the clothing mesh already has skinning data. When set to EnabledPreserve, skinning is only applied if the mesh does not already have skinning data.

This property requires StarterPlayer.LoadCharacterLayeredClothing to be set to Enabled (or Default) in order to function. When layered clothing is disabled, the auto-skinning pipeline does not run and this property has no effect.

For more information, see Automatic Skinning Transfer.

History 4

BindOffset

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1

This property is intended for fine-tuning purposes and is highly optional.

CFrame to adjust a binding point for a clothing item mesh. Allows for fine-tuning of clothing items (slight adjustment of position/rotation to get a unique look) in contexts such as community-made avatar editors.

History 9

Color

TypeDefault
Color31, 1, 1

Sets color used for the debug rendering. See WrapTarget.DebugMode

This property is not scriptable. It cannot be accessed by script code.
This property is not replicated. Its interface does not cross the network boundary.

History 6

Tags: [NotReplicated, NotScriptable]

DebugMode

TypeDefault
WrapLayerDebugModeNone

Allows switching between different debugging visualization modes for cage meshes.

This property is not scriptable. It cannot be accessed by script code.
This property is not replicated. Its interface does not cross the network boundary.

History 6

Tags: [NotReplicated, NotScriptable]

Enabled

TypeDefault
booltrue

Allows for disabling of the WrapLayer object as if it does not exist.

History 6

Order

TypeDefault
int1

Controls the composition order for layered clothing. Clothing items with higher order will appear on top of clothing items with lower order. If two items have the same order, the deformer composition order is ambiguous and depends on serialization order. Default value is 1.

History 7

  • 731 Change Default of Order from to 1
  • 726 Change Default of Order from 1 to
  • 553 Change Default of Order from to 1
  • 529 Change WriteSecurity of Order from PluginSecurity to None
  • 486 Change ThreadSafety of Order from ReadOnly to ReadSafe
  • 462 Change ThreadSafety of Order from to ReadOnly
  • 458 Add Order

Puffiness

TypeDefault
float1

Controls how much underlying clothing items inflate the current clothing item.

Valid range is -1 to 1. A value of -1 compresses the clothing, body, and all underlying layers such that the clothing itself takes the shape of the body. A value of 0 makes the clothing item fit as if it was the only piece of clothing being worn, compressing all underlying layers. A value of 1 (default) never compresses anything and infinitely inflates over underlying clothing items.

This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 8

Tags: [Deprecated]

ReferenceMeshContent

TypeDefault
Content

The reference mesh that defines the inner cage of a WrapLayer, stored as a Content value. Together with the outer cage from CageMeshContent, the inner cage describes the surfaces used to fit and deform the accessory around an avatar and underlying accessories without clipping. A WrapLayer is only considered valid once both its cage mesh and its reference mesh are set.

The reference mesh establishes the standard topology and UV coordinates used for index matching. It is expected that for all catalog avatars this points to one of the 15 standard reference meshes provided by Roblox, but for some NPCs or a custom avatar system it might point to a different mesh. This property is normally set up automatically by the Importer.

This Content-typed property is the successor to WrapLayer.ReferenceMeshId and reads and writes the same underlying storage. Defaults to an empty Content.

History 6

ReferenceMeshId

TypeDefault
ContentId

AssetID for reference mesh used to define Inner Cage of a 3D object

Reference mesh is used to define standard topology and UV coordinates for index matching. It is expected that for all catalog avatars, this will point to one of 15 standard reference meshes provided by Roblox. But for some NPCs or a custom avatar system, this might point to other meshes.

Note: this property is set up automatically by the FBX importer

History 4

ReferenceOrigin

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1

Reference mesh offset relative to parent MeshPart (in the parent MeshPart space)

Note: this property is set up automatically by the FBX importer

History 9

ReferenceOriginWorld

TypeDefault
CFrame0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1

Reference mesh offset relative to parent MeshPart (in the world space)

Note: this property is set up automatically by the FBX importer

This property is not replicated. Its interface does not cross the network boundary.
This property is read-only. Its value can be read, but it cannot be modified.

History 9

Tags: [ReadOnly, NotReplicated]

ShrinkFactor

TypeDefault
float0

This property is intended for fine-tuning purposes and is highly optional.

Allows slight shrinking/expanding of the resulting render mesh, without affecting any other layers. This is useful in rare cases when the clothing mesh does not precisely fit the underlying clothing layers (the cage is usually slightly overestimated atop the real shape to avoid layer interpenetration). Even slight overestimation has the tendency to accumulate, especially when there are a lot of layers. While this is usually not critical, some items like backpacks may be problematic.

Valid range is -1 to 1. A value of -1 will maximally expand while a value of 1 will maximally shrink. A value of 0 (default) has no effect.

This property is deprecated. It exists only for backward compatibility, and should not be used for new work.

History 7

Tags: [Deprecated]

Settings