If you would like to use the HUD and enable Object information.
You would get the object distance from the camera.
In order to get the MEL command that does that, one should first consider that the Documentations states
“This setting is used to select certain pre-defined HUDs, some of which retrieve specific data, that is unobtainable through normal MEL commands or scripts.”
The workaround would be doing something like so
vector $p1=`getAttr persp.translate`;
vector $p2=`getAttr pSphere2.translate`;
vector $result=$p1-$p2;
print (mag($result))
Thanks to Lap Ho for his tip.





Subscribe
Good tip, but how do I turn this into a menu item that can be called under the HUD menu? This would be really useful for DOF calculations.
Posted by: Mark Bradshaw | 18/06/2010 at 10:49 PM