# MEL command for aligning local rotation axes

**URL:** https://forum.highend3d.com/t/mel-command-for-aligning-local-rotation-axes/6787
**Category:** Maya
**Tags:** mel
**Created:** [October 19, 2001, 2:37pm UTC](https://forum.highend3d.com/t/mel-command-for-aligning-local-rotation-axes/6787 "2001-10-19T14:37:34Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tom-lippitsch](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/t/7ab992/32.png) [@tom-lippitsch](https://forum.highend3d.com/u/tom-lippitsch)
#### Post date: [October 19, 2001, 2:37pm UTC](https://forum.highend3d.com/t/mel-command-for-aligning-local-rotation-axes/6787/1 "2001-10-19T14:37:34Z")

</div>

Hi,

is there a MEL command that is aligning the local rotation axes (i.e. of joints) to the default world space coordinates? To speak rx=0, ry=0, rz=0 in world space.

Thanks in advance  
tom 8)

---

<div class="post-metadata">

### Author: ![\-mike--1](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/-/8e8cbc/32.png) [@\-mike--1](https://forum.highend3d.com/u/-mike--1)
#### Post date: [October 23, 2001, 2:36pm UTC](https://forum.highend3d.com/t/mel-command-for-aligning-local-rotation-axes/6787/2 "2001-10-23T14:36:08Z")

</div>

> [@](#):
>
> In reply to:   
> Hi,
> 
> is there a MEL command that is aligning the local rotation axes (i.e. of joints) to the default world space coordinates? To speak rx=0, ry=0, rz=0 in world space.
> 
> Thanks in advance  
> tom 8)

Hi Tom,

for joints try this:  
string $joint[] = `ls -sl`;  
float $rot[] = `xform -ws -q -ro $joint[0]`;  
xform -ra $rot[0] $rot[1] $rot[2] $joint[0];

Hope it works for you.

[mike]
