Class
WrapTarget
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#
ColorColor3 | Sets color used for the debug rendering. See WrapTarget.DebugMode.ReadSafeNotReplicatedNotScriptable |
DebugModeWrapTargetDebugMode | Allows switching between different debugging visualization modes for cage meshes.ReadSafeNotReplicatedNotScriptable |
Stiffnessfloat | Defines 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#
| CreateTextureInCageSpaceAsync | Creates a new EditableImage in cage UV space from a texture in the
parent MeshPart's UV space.Yields |
| CreateTextureInTargetSpaceAsync | Creates 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.
| Name | Type | Default | Description |
|---|---|---|---|
texture | EditableImage | The EditableImage in the UV space of this WrapTarget's
parent MeshPart. | |
options | Dictionary? | Optional dictionary containing controls for the transfer:
Each omitted bound is calculated from the cage mesh. If neither is specified, the bounds include the entire cage. |
Returns
EditableImage— A newEditableImagein cage UV space, ornilif the device-specific editable memory budget is exhausted.
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.
| Name | Type | Default | Description |
|---|---|---|---|
texture | EditableImage | The EditableImage in cage UV space. | |
wrapTextureTransfer | WrapTextureTransfer | The WrapTextureTransfer associated with the same parent
MeshPart as this WrapTarget. |
Returns
EditableImage— A newEditableImagein the parentMeshPart's UV space, ornilif the device-specific editable memory budget is exhausted.
Inherited members#
Inherited from BaseWrap 8
Properties (8)
CageMeshContent, CageMeshId, CageOrigin, CageOriginWorld, HSRAssetId, HSRContent, ImportOrigin, ImportOriginWorld
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild