PDA

View Full Version : Capturing camera data and exporting to text file


DanJHale
01-30-2013, 05:45 AM
Hey there people,

I have 2 problems that I am trying to overcome with zero knowedge of scripting within Maya.

Problem 1:
I have a scene that has multiple cameras and I need to export just the camera data (XYZ, rotation, lense information, etc) to a seperate text file for sharing information between studios.
Problem 2:
I need a way to overlay the XYZ information of the camera that is in use in the output render.

If anyone can help me with this or point me in the right direction it would be greatly appreciated.

gmask
02-02-2013, 04:02 PM
Problem 1:
I have a scene that has multiple cameras and I need to export just the camera data (XYZ, rotation, lense information, etc) to a seperate text file for sharing information between studios.


Well you basically just need to bake all the channels on the camera into world space and then cycle through the channels getting the attributes and creating a spread sheet or sorts and then writing it to disc.

psuedo code..

in_frame=10
out_frame=90
current_frame=in_frame
while current_frame <= out_frame
spread_sheet_index=0;
for channel in channels
spread_sheet[current_frame,spread_sheet_index]= getAttr -t current_frame camera.channel
spread_sheet_index++

current_frame++


save_spread_to_disk(spread_sheet,'/myfile.txt')


Problem 2:
I need a way to overlay the XYZ information of the camera that is in use in the output render.


http://download.autodesk.com/us/maya/2010help/Commands/headsUpDisplay.html



http://forums.cgsociety.org/archive/index.php/t-136112.html

CGTalk Moderation
02-02-2013, 04:02 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.