Skip to main content

scene3d

The container's Scene3d, or null when none is configured. Assign a new object to update it, or null to clear it.

Instances inherit their main component's scene until overridden. Assigning null opts an instance out of the inherited scene.

Signature​

scene3d: Scene3d | null

Remarks​

note

3D transforms are available in beta. The API is subject to change.

Assigning { perspective: -1, preserve3d: false } reads back as null when visible is omitted or true. With visible: false, it reads back as an object.

const scene = figma.createFrame()
scene.resize(400, 300)
scene.scene3d = { perspective: 800, preserve3d: true }

const card = figma.createRectangle()
scene.appendChild(card)
card.resize(160, 100)
card.x = 120
card.y = 100
card.transform3d = {
type: 'FIXED_ORDER',
translateZ: 40,
rotateX: 0,
rotateY: 30,
rotateZ: 0,
}

// Disable perspective while keeping the other scene settings.
scene.scene3d = { ...scene.scene3d, perspective: -1 }