Skip to content

Latest commit

 

History

History
172 lines (109 loc) · 4.81 KB

transform-node-attributes.md

File metadata and controls

172 lines (109 loc) · 4.81 KB
description
Level: Beginner | Version 1.0 | Date: 30-March-2022 | By - Siddarth Mehra

🏢 Transform Node Attributes

Attribute Index

#1.-translate-t-double3

#2.-rotate-r-double3

#3.-scale-s-double3

#4.-shear-sh-double3

1. translate(t) - double3

  • translateX (tx) - distance(double)
  • translateY (ty) - distance(double)
  • translateZ (tz) - distance(double)
Specifies the object’s translation (Translate X, Y, and Z) attribute values in world space
  • Is Keyable

Translation can be seen in channelBox and can be queried by -

import pymel.core as pm
obj = pm.PyNode('objName')
print(obj.getTranslation())

2. rotate(r) - double3

  • rotateX(rx) - angle(double)
  • rotateY (ry) - angle(double)
  • rotateZ (rz) - angle(double)
Specifies the object's scale ( Scale X, Y, and Z) attribute values in local space
  • Unlike translation and rotation attributes, scale uses only the Local coordinate system.
  • Is Keyable

Rotation can be seen in channelBox and can be queried by -

import pymel.core as pm
obj = pm.PyNode('objName')
print(obj.getRotation())

3. scale(s) - double3

  • scaleX(sx) - double
  • scaleY (sy) - double
  • scaleZ (sz) - double
Scale is used to scale a dag node in a 3D space
  • Is Keyable

Scale can be seen in channelBox and can be queried by -

import pymel.core as pm
obj = pm.PyNode('objName')
print(obj.getScale())

4. shear(sh)- double3

  • shearXY(shxy) - double
  • shearXZ(shxz) - double
  • shearYZ(shyz) - double
When the Shear XYZ values are changed from 0,0,0, shears or non-proportionately scales the selected geometry.
  • Is Keyable

Shear can be seen in AttributeEditor and can be queried by -

import pymel.core as pm
obj = pm.PyNode('objName')
print(obj.getShear())

5. rotateOrder(sh)- enum

Rotate order explanation for Rigging-

{% embed url="https://youtu.be/urC_TBQQA7o?t=470" %} Kinda starts at 10:00 but to understand it properly watch from 8:23 {% endembed %}

Rotate order explanation for animation -

{% embed url="https://vimeo.com/54541692" %}

This attribute controls the order in which rx, ry, rz are applied in the transformation matrix. Valid values for this attribute are 0=xyz, 1=yzx, 2=zxy, 3=xzy, 4=yxz, 5=zyx.
  • Is not Keyable

RotateOrder can be seen in AttributeEditor and can be queried by -

import pymel.core as pm
obj = pm.PyNode('objName')
order = obj.rotateOrder.get()
orderDict = {0:'xyz', 1:'yzx', 2:'zxy', 3:'xzy', 4:'yxz', 5:'zyx'}
print (orderDict[order])

6. rotateAxis(ra)- double3

  • rotateAxisX(rax) - angle(double)
  • rotateAxisY(ray) - angle(double)
  • rotateAxisZ(raz) - angle(double)
Extra rotation to adjust the local axis prior to applying the rotate attribute
  • Is not Keyable

rotateAxis can be seen in AttributeEditor and can be queried by -

import pymel.core as pm
obj = pm.PyNode('objName')
roAxis = obj.rotateAxis.get()
print (roAxis)