all  /  test_assets  / schemaTests  / usdGeom  / transforms  / matrix_transform .usda

Transforms

These files showcase different transform operations.

Schema specification: https://github.com/PixarAnimationStudios/USD/blob/release/pxr/usd/usdGeom/schema.usda

Simple Transform

simple_transform.usda

This file shows an example of a mesh with a simple, common stack of transform operations.

uniform token[] xformOpOrder = [
    "xformOp:translate",
    "xformOp:rotateXYZ",
    "xformOp:scale"
]

screenshot simple_transform.usda, usdrecord 22.08

Complex Transform

complex_transform.usda

This file shows an example of a mesh with a complex stack of transform operations.

uniform token[] xformOpOrder = [
    "xformOp:translate",
    "xformOp:translate:rotatePivotOffset",
    "xformOp:translate:rotatePivot",
    "xformOp:rotateXYZ:rotateOffset",
    "xformOp:rotateXYZ",
    "!invert!xformOp:translate:rotatePivot",
    "xformOp:translate:scalePivotOffset",
    "xformOp:translate:scalePivot",
    "xformOp:transform:shear",
    "xformOp:scale:scaleOffset",
    "xformOp:scale",
    "!invert!xformOp:translate:scalePivot"
]

screenshot complex_transform.usda, usdrecord 22.08

Matrix Transform

matrix_transform.usda

This file shows an example of a mesh with a matrix transform.

uniform token[] xformOpOrder = ["xformOp:transform"]

screenshot matrix_transform.usda, usdrecord 22.08

Weird Matrix Transform

weird_matrix_transform.usda

This file shows an example of a mesh with a matrix transform with weird, nonsensible values.

custom Matrix4d xformOp:transform = ((1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12), (13, 14, 15, 1))
uniform token[] xformOpOrder = ["xformOp:transform"]

screenshot weird_matrix_transform.usda, usdrecord 22.08

Nested Xforms

xforms_nested.usda

This file uses nestes Xforms to verify that transform operations are correctly applied in order.

screenshot xforms_nested.usda, usdrecord 22.08

Nested Scopes and Xforms

scopes_and_xforms_nested.usda

This file uses nestes Scopes and Xforms to verify that transform operations are correctly applied in order and that a mix of Scopes and Xforms doesn’t cause issues.

screenshot scopes_and_xforms_nested.usda, usdrecord 22.08


Edit this page

matrix_transform.usda

#usda 1.0
(
    customLayerData = {
        string copyright = "Copyright 2022 Apple Inc. All rights reserved."
    }
    defaultPrim = "World"
    upAxis = "Y"
    metersPerUnit = 0.01
)

def Scope "World"
{
    over "axis" (
        references = @../../../_common/axis.usda@
    )
    {
    }

    def Mesh "mesh"
    {
        int[] faceVertexCounts = [4, 4, 4, 4, 4, 4]
        int[] faceVertexIndices = [0, 4, 6, 2, 0, 1, 5, 4, 4, 5, 7, 6, 3, 7, 5, 1, 6, 7, 3, 2, 2, 3,... (truncated)]
        point3f[] points = [(-0.5, -0.5, -0.5), (0.5, -0.5, -0.5), (-0.5, 0.5, -0.5), (0.5, 0.5, -0.... (truncated)]
        custom matrix4d xformOp:transform = ( (0, 0.5, -0.8660254037844386, 0), (-1.7320508075688772, 0.8660254037844388, 0.5, 0), (1.5, 2.25, 1.2990381056766584, 0), (4, 5, 6, 1) )
        uniform token[] xformOpOrder = ["xformOp:transform"]
    }
}