Roblox UtilitiesDevlHub Roblox Documentation

Class

WrapTarget

Inherits
BaseWrap › Instance › Object
Memory category
Instances

The WrapTarget object defines a target. A target is the 3D body with only an outer surface, or an Outer Cage.

The WrapTarget object defines a target. A target is the 3D body with only an outer surface, or an Outer Cage.

This target, often an Avatar, is what 3D accessories (using WrapLayer) will be applied to, allowing multiple accessories items to naturally layer over the source target.

Properties 3#

ColorColor3Sets color used for the debug rendering. See WrapTarget.DebugMode.ReadSafeNotReplicatedNotScriptable
DebugModeWrapTargetDebugModeAllows switching between different debugging visualization modes for cage meshes.ReadSafeNotReplicatedNotScriptable
StiffnessfloatDefines how much the body mesh can be compressed by clothing.Write: PluginSecurityReadSafe

Color: Color3#

NotReplicatedNotScriptableReadSafe

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

DebugMode: WrapTargetDebugMode#

NotReplicatedNotScriptableReadSafe

Allows switching between different debugging visualization modes for cage meshes.

Stiffness: float#

DeprecatedWrite: PluginSecurityReadSafe

Defines how much the body mesh can be compressed by clothing. Super tight clothing may lead to an intersection between the clothing mesh and body mesh. To solve this visual artifact, the deformer can compress the body mesh slightly to solve possible intersections.

Valid range is 0 to 1. A value of 0 will compress the body mesh as much as necessary to ensure that the intersections are eliminated (visible body parts might look a little bit deformed). A value of 1 will prevent the body mesh from being compressed (may lead to visible intersections or Z-fighting). A value of 0.9 (default) is a reasonable default that solves most of the intersections without introducing any significant body deformation.

Methods 2#

CreateTextureInCageSpaceAsyncCreates a new EditableImage in cage UV space from a texture in the parent MeshPart's UV space.Yields
CreateTextureInTargetSpaceAsyncCreates a new EditableImage in the parent MeshPart's UV space from a texture in cage UV space.Yields

CreateTextureInCageSpaceAsync(texture: EditableImage, options: Dictionary?): EditableImage#

Yields

Creates a new EditableImage by transferring texture from the UV space of this WrapTarget's parent MeshPart into the UV space of the WrapTarget's cage. This method yields until the transfer is complete and does not modify the input image.

For example, after a player paints makeup onto a head mesh in an in-experience creation tool, use this method to transfer the texture into cage UV space before uploading it for use with WrapTextureTransfer. This method also supports cage-space texture transfers unrelated to makeup. To transfer a texture in the opposite direction, use WrapTarget:CreateTextureInTargetSpaceAsync().

Use options to specify a region of cage UV space. Each supplied bound must be a finite Vector2. If both bounds are supplied, MaxUVBounds must be greater than MinUVBounds on both axes. Unrecognized option keys raise an error.

This method requires the WrapTarget to be parented to a MeshPart with valid mesh and cage data. It raises an error if the input or options are invalid, required mesh data cannot be loaded, or the transfer fails. If the device-specific editable memory budget is exhausted, it returns nil. See EditableImage for additional usage requirements.

NameTypeDefaultDescription
textureEditableImageThe EditableImage in the UV space of this WrapTarget's parent MeshPart.
optionsDictionary?Optional dictionary containing controls for the transfer:

  • MinUVBounds – A Vector2 specifying the minimum cage UV bound.
  • MaxUVBounds – A Vector2 specifying the maximum cage UV bound.

Each omitted bound is calculated from the cage mesh. If neither is specified, the bounds include the entire cage.

Returns

CreateTextureInTargetSpaceAsync(texture: EditableImage, wrapTextureTransfer: WrapTextureTransfer): EditableImage#

Yields

Creates a new EditableImage by transferring texture from cage UV space into the UV space of this WrapTarget's parent MeshPart. This method yields until the transfer is complete and does not modify the input image.

The wrapTextureTransfer supplies the optional reference cage through WrapTextureTransfer.ReferenceCageMeshContent and the cage UV bounds through WrapTextureTransfer.UVMinBound and WrapTextureTransfer.UVMaxBound. Use a WrapTextureTransfer under a Decal on the same MeshPart as the WrapTarget.

For example, use this method to transfer a makeup texture you own into a head mesh's UV space so players can edit it directly on the head in an in-experience creation tool. This method also supports target-space texture transfers unrelated to makeup. To transfer the edited texture back into cage UV space, use WrapTarget:CreateTextureInCageSpaceAsync().

This method requires the WrapTarget to be parented to a MeshPart with valid mesh and cage data. It raises an error if either input is invalid, required mesh data cannot be loaded, or the transfer fails. If the device-specific editable memory budget is exhausted, it returns nil. See EditableImage for additional usage requirements.

NameTypeDefaultDescription
textureEditableImageThe EditableImage in cage UV space.
wrapTextureTransferWrapTextureTransferThe WrapTextureTransfer associated with the same parent MeshPart as this WrapTarget.
Returns

Inherited members#

Inherited from BaseWrap 8
Inherited from Instance 58
Inherited from Object 6
Properties (2)

ClassName, className

Events (1)

Changed