Transform class

Defines the position, scale and rotation of an item.

Every Transform can be assigned to a BaseItem.parent which allows hierarchical editing of their position, scale and rotation. Created hierarchies are displayed in the Item Hierarchy tab.

Methods

apply(self, other: ReadonlyTransform) -> Transform

Additively applies values of another Transform to this Transform.

compose(self, other: ReadonlyTransform) -> Transform

Returns a new Transform created by combining this and other.

copy(self) -> Transform

Inherited from ReadonlyTransform.

Returns a copy of this Transform.

invert(self) -> Transform

Inverts all values of this Transform.

local_to_world_point(self, position: Vector3) -> Vector3

Inherited from ReadonlyTransform.

Converts local position to world position of this Transform.

local_to_world_vector(self, direction: Vector3) -> Vector3

Inherited from ReadonlyTransform.

Converts local direction to world direction of this Transform.

look_at(self, world_position: Vector3, world_up: Vector3) -> Transform

Rotates this Transform so that the forward vector points to the worldPosition.

look_at(self, world_position: Vector3) -> Transform

Rotates this Transform so that the forward vector points to the worldPosition.

mult_scale(self, scale_factor: float) -> Transform

Multiplies this Transform current scale by scale

rotate(self, origin: Vector3, axis: Vector3, angle_in_radians: float) -> Transform

Rotates this Transform by angleInRadians around an origin point using axis as rotation direction.

rotate(self, axis: Vector3, angle_in_radians: float) -> Transform

Rotates this Transform by angleInRadians around world position (0,0,0) towards axis direction.

rotate_local(self, offset: Vector3, axis: Vector3, angle_in_radians: float) -> Transform

Rotates this Transform by angleInRadians around an offset towards axis direction.

rotate_local(self, axis: Vector3, angle_in_radians: float) -> Transform

Rotates this Transform by angleInRadians around its pivot towards axis direction.

set(self, transform: ReadonlyTransform) -> Transform

Sets values of this Transform to another Transform.

set_direction(self, direction: Vector3, world_up: Vector3) -> Transform

Rotates this Transform so that

set_direction(self, direction: Vector3) -> Transform

Rotates this Transform so that

swap_yz(self) -> Transform

Swaps Y and Z axes of this `Transform.

translate(self, translation: Vector3) -> Transform

Moves this Transform by translation.

translate_local(self, translation: Vector3) -> Transform

Moves this Transform by translation.

world_to_local_point(self, position: Vector3) -> Vector3

Inherited from ReadonlyTransform.

Converts world position to local position of this Transform.

world_to_local_vector(self, direction: Vector3) -> Vector3

Inherited from ReadonlyTransform.

Converts world direction to local direction of this Transform.

Properties

readonly axis_x Vector3

Inherited from ReadonlyTransform.

Red axis of this Transform.

readonly axis_y Vector3

Inherited from ReadonlyTransform.

Green axis of this Transform.

readonly axis_z Vector3

Inherited from ReadonlyTransform.

Blue axis of this Transform.

readonly forward Vector3

Inherited from ReadonlyTransform.

Shorthand for Y - axis.

position Vector3

Position of this Transform using X, Y, and Z coordinates.

readonly right Vector3

Inherited from ReadonlyTransform.

Shorthand for X - axis.

rotation Quat

Rotation of this Transform stored as Quat.

scale float

Scale of this Transform.

readonly up Vector3

Inherited from ReadonlyTransform.

Shorthand for Z - axis.