Object Distance From Camera Hudobjdetdistfromcam, How to catch the actual number displayed in the UI

Object Distance From Camera Hudobjdetdistfromcam, How to catch the actual number displayed in the UI

Anonymous
Not applicable
1,572 Views
3 Replies
Message 1 of 4

Object Distance From Camera Hudobjdetdistfromcam, How to catch the actual number displayed in the UI

Anonymous
Not applicable
Hi All,
Anyone knows how to get that number? If I run the following command I get the number to be displayed in the UI, but I can't find the way to catch it:
headsUpDisplay -e -vis 1 HUDObjDetDistFromCam;
I got the command from the initHUDScripts.mel
The distance could be calculated as long as the history data hasn't been deleted. I have a scene where the history was deleted and the xyz numbers are zero for most of the elements. However, the UI is still calculating the distance. I searched for the method inside maya but I could not find anything beyond HUDObjDetDistFromCam being called in the headsUpDisplay in ...Maya2008\scripts\startup\initAfter.mel.
Thanks for in advance for any help,
Igloo
0 Likes
1,573 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
yes, just query it (the script result flag).......is that what you mean?

$result = `headsUpDisplay -q -sr HUDObjDetDistFromCam`;
0 Likes
Message 3 of 4

Anonymous
Not applicable
Does anybody know i how does the HUD for the distance from camera calculates that number? Its a different number then if you use a distance between node. If you create a camera and locator and connect them with a distance between and move the locator 5 units away from the camera...the distance between will read 5 and the HUD will read 5. But if you move locator 2 units in X the distance between will read 5.385 but the HUD will read 5 (which is the number I want). I want to find out how the HUD is doing is calculation. I dont want to have to be looking through the camera and have the obj selected and query the HUD...I just want to calculate that number. Any ideas?

-k
0 Likes
Message 4 of 4

berserk04
Community Visitor
Community Visitor

Hi, 7 years later.. could you solve this issue??

 

Thanks.