WrapTarget
The WrapTarget object defines a target. A target is the 3D body with only an outer surface, or an Outer Cage.
| Memory category | Instances |
|---|
Member index 5
Description
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.
History 22
- 738 Add CreateTextureInTargetSpaceAsync
- 738 Add CreateTextureInCageSpaceAsync
- 731 Change Default of Stiffness from to 0
- 731 Change Default of DebugMode from to None
- 731 Change Default of Color from to Color3(1, 1, 1)
- 727 Change Tags of Stiffness from [] to [Deprecated]
- 726 Change Default of Stiffness from 0 to
- 726 Change Default of DebugMode from None to
- 726 Change Default of Color from Color3(1, 1, 1) to
- 553 Change Default of Stiffness from to 0
- 553 Change Default of DebugMode from to None
- 553 Change Default of Color from to Color3(1, 1, 1)
- 486 Change ThreadSafety of Stiffness from ReadOnly to ReadSafe
- 486 Change ThreadSafety of DebugMode from ReadOnly to ReadSafe
- 486 Change ThreadSafety of Color from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Stiffness from to ReadOnly
- 462 Change ThreadSafety of DebugMode from to ReadOnly
- 462 Change ThreadSafety of Color from to ReadOnly
- 458 Add Stiffness
- 458 Add DebugMode
- 458 Add Color
- 458 Add WrapTarget
Members 5
Color
| Type | Default | |
|---|---|---|
| Color3 | 1, 1, 1 | |
Sets color used for the debug rendering. See WrapTarget.DebugMode
| Thread safety | ReadSafe |
|---|---|
| Category | Debug |
| Loaded/Saved | false |
CreateTextureInCageSpaceAsync
| Parameters (2) | ||
|---|---|---|
| texture | EditableImage | |
| options | Dictionary? | |
| Returns (1) | ||
| EditableImage | ||
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.
| Thread safety | Unsafe |
|---|
History 1
CreateTextureInTargetSpaceAsync
| Parameters (2) | ||
|---|---|---|
| texture | EditableImage | |
| wrapTextureTransfer | WrapTextureTransfer | |
| Returns (1) | ||
| EditableImage | ||
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.
| Thread safety | Unsafe |
|---|
History 1
DebugMode
| Type | Default | |
|---|---|---|
| WrapTargetDebugMode | None | |
Allows switching between different debugging visualization modes for cage meshes.
| Thread safety | ReadSafe |
|---|---|
| Category | Debug |
| Loaded/Saved | false |
Stiffness
| Type | Default | |
|---|---|---|
| float | 0 | |
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.
| Write security | PluginSecurity |
|---|---|
| Thread safety | ReadSafe |
| Category | Appearance |
| Loaded/Saved | true |
History 7
- 731 Change Default of Stiffness from to 0
- 727 Change Tags of Stiffness from [] to [Deprecated]
- 726 Change Default of Stiffness from 0 to
- 553 Change Default of Stiffness from to 0
- 486 Change ThreadSafety of Stiffness from ReadOnly to ReadSafe
- 462 Change ThreadSafety of Stiffness from to ReadOnly
- 458 Add Stiffness