BaseWrap

Show Deprecated
Not Creatable

The base class for WrapTarget and WrapLayer objects. Note that MeshPart is the only valid parent type for BaseWrap and that it behaves more like a component of MeshPart than an independent object.

Summary

Properties

Asset ID for cage mesh.

Cage mesh offset relative to parent MeshPart.

Cage mesh offset in world space.

READ ONLY
NOT REPLICATED
NOT SCRIPTABLE

Describes where a global zero was while authoring the cage mesh in an asset creation tool.

Describes where the origin (in world space) was while authoring the cage mesh in an asset creation tool.

READ ONLY
NOT REPLICATED

Events

Methods

GetFaces(cageType: CageType): Array  


GetVertices(cageType: CageType): Array  


ModifyVertices(cageType: CageType, vertices: Array): void  


Properties

CageMeshId

This property is set up automatically by the 3D Importer.

Asset ID for cage mesh.

CageOrigin

This property is set up automatically by the 3D Importer.

Cage mesh offset relative to parent MeshPart.

CageOriginWorld

Read Only
Not Replicated

Cage mesh offset in world space.

HSRAssetId

Not Scriptable

ImportOrigin

This property is set up automatically by the 3D Importer.

Describes where a global zero was while authoring the cage mesh in an asset creation tool such as Blender or Maya. This property is not used by the deformer but it is useful for tools/aligning scripts, for example aligning two parts by matching their pivots as follows:


1local function alignWraps()
2 local selectionService = game:GetService("Selection")
3 local selectedObjects = selectionService:Get()
4 local alignObjects = {}
5 for _, obj in pairs(selectedObjects) do
6 if obj:IsA("BaseWrap") then
7 --print("Wrap: " .. obj.Name)
8 table.insert(alignObjects, obj)
9 else
10 print("Ignore: " .. obj.Name)
11 end
12 end
13
14 if #alignObjects < 2 then
15 warn("You need to select at least two wraps")
16 return
17 end
18
19 local anchorWrap = alignObjects[1]
20 local worldA_from_Wrap = anchorWrap.ImportOriginWorld
21 print("Anchor: " .. anchorWrap.Name)
22 for i = 2, #alignObjects do
23 local wrapToAlign = alignObjects[i]
24 print("Align: " .. wrapToAlign.Name)
25 local wrap_from_WorldB = wrapToAlign.ImportOriginWorld:Inverse()
26 local worldA_from_WorldB = worldA_from_Wrap * wrap_from_WorldB
27 local worldB = wrapToAlign.Parent.CFrame
28 -- Note: adjust CFrame of the parent part
29 wrapToAlign.Parent.CFrame = (worldB_from_WorldB * worldB)
30 end
31end
32

ImportOriginWorld

Read Only
Not Replicated

Describes where the origin (in world space) was while authoring the cage mesh in an asset creation tool such as Blender or Maya.

Events

Methods

GetFaces

Roblox Script Security

Parameters

cageType: CageType

Returns

GetVertices

Roblox Script Security

Parameters

cageType: CageType

Returns

IsHSRReady

Roblox Script Security

Returns

ModifyVertices

void
Roblox Script Security

Parameters

cageType: CageType
vertices: Array

Returns

void