Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

entity.transform (procNode)

A live scene entity's pose, position, rotation and scale, as graph values: the whole pose as one record and the three parts split. What lets a graph stand something where an artist placed a marker.

Built from io.engine readEntities with the pose, read on the CPU when the graph cooks and again whenever the pose changes.

Inputs

  • entity (Entity). Default "". The scene entity whose pose is read: its Name or id.
  • space (one of world, local). Default "world". Which pose is read: "world" is the entity's place in the scene with its whole parent chain applied; "local" is its offset from its own parent.

Outputs

  • transform: the Record { position, rotation, scale }.
  • position: the position, { x, y, z }.
  • rotation: the rotation as a quaternion, { x, y, z, w }.
  • scale: the scale, { x, y, z }.

A call answers the four by name: g.entity.transform({ entity = "Marker" }).position.

Example

local pose = g.entity.transform({ entity = "Marker", space = "world" })

For an entity at local (1, 0, 0) under a parent at (5, 0, 0) with scale 2, pose.position is { x = 7, y = 0, z = 0 } and pose.scale is { x = 2, y = 2, z = 2 }; with space = "local" they are { x = 1, y = 0, z = 0 } and { x = 1, y = 1, z = 1 }.