MEL

Create HUD which shows the selected object's translation and rotation values at the current frame during playback

// Create HUD for rotation

headsUpDisplay

-section 1

-block 1

-label "Rotation"

-lfs "large"

-blockSize "small"

-command "xform -q -ro -ws"

-decimalPrecision 2

-dataFontSize "large"

-dataAlignment "right"

-attachToRefresh

-vis 1

HUDrot;

//Create HUD for translation

headsUpDisplay

-section 3

-block 1

-label "Translation"

-lfs "large"

-blockSize "small"

-command "xform -q -t -ws"

-decimalPrecision 2

-dataFontSize "large"

-dataAlignment "right"

-attachToRefresh

-vis 1

HUDtrans;

//  to remove the HUDs

// headsUpDisplay -rem HUDrot;

// headsUpDisplay -rem HUDtrans;

Extract positions as locators :

(Thanks Prashanth)

float $getPvPos[];

float $rot[];

string $selection[] = `ls -sl`;

int $i = 0;

for ($i =0; `size ($selection)` > $i; $i++)

{

$getPvPos= `xform -q -ws -piv $selection[$i] `;

$rot= `xform -ws -q -rotation $selection[$i]`;

spaceLocator -p 0 0 0;

xform -ws -t $getPvPos[0] $getPvPos[1] $getPvPos[2];

xform -ws -rotation $rot[0] $rot[1] $rot[2];

}

Create headsup display of current frame number

headsUpDisplay

-section 1

-block 1

-blockSize "small"

-command "currentTime -q"

-decimalPrecision 2

-dataFontSize "large"

-dataAlignment "right"

-attachToRefresh

-vis 1

HUDFrameNum;

to remove the same

headsUpDisplay -rem HUDFrameNum;