How is maya camera film offset translated into nuke camera equivalent?

2,031 views
Skip to first unread message

unread,
Jul 19, 2011, 9:34:05 AM7/19/11
to python_in...@googlegroups.com
I would like to write a maya camera exporter to nuke, but I don't know
how to translate maya camera's "film offset" attributes into nuke
camera's "translate u & v" in the Projection tab.
I did know it is possible to match the film offset attribute with the
nuke equivalent, because I had done it a couple of days before. But I
did it by adjusting the attribute, looking at the output image, and
compared the one rendered with maya.
nukeCam.translateU = mayaCam.horizontalFilmOffset/mayaCam.hfa did not
do the trick.


Sorry if there is any improper expression, for English is not my native tongue.
--
2.6.32.26-175.fc12.x86_64

Frank.Hill

unread,
Jul 20, 2011, 2:55:26 AM7/20/11
to python_inside_maya
I would like to write a maya camera exporter to nuke, but I don't know
how to translate maya camera's "film offset" attributes into nuke
camera's "translate u & v" in the Projection tab.
I did know it is possible to match the film offset attribute with the
nuke equivalent, because I have done it days ago. But I had to do it
by adjusting the attribute, watching the output image, and
comparing it with the one rendered in maya.
nukeCam.translateU = mayaCam.horizontalFilmOffset/mayaCam.hfa did not
do the trick.


ps: It seems mail sent to python_in...@googlegroups.com did not
get posted to the list.

Deke Kincaid

unread,
Jul 20, 2011, 4:13:20 AM7/20/11
to python_in...@googlegroups.com
BTW, nuke can read film offsets with fbx 2010 files.  If you want to write your converter though, Nuke uses NDC coordinates.  Here is the formula I use inside Nuke to read in maya film back offsets which you should be able to reverse engineer to export from inside Maya:

window translate u:  
(2/haperture)*(mayaFilmOffset.x*25.4)

window translate v:
(((root.format.h/root.format.w)*2)/vaperture)*(mayaFilmOffset.y*25.4)

set cut_paste_input [stack 0]
version 6.1 v3
push $cut_paste_input
Camera2 {
 vaperture 10.08453016
 win_translate {{(2/haperture)*(mayaFilmOffset.x*25.4)}
{(((root.format.h/root.format.w)*2)/vaperture)*(mayaFilmOffset.y*25.4)}}
 name Camera2
 selected true
 xpos 2082
 ypos -481
 addUserKnob {20 MayaCameraSettings}
 addUserKnob {12 mayaFilmOffset l "Maya Film Offset"}
 mayaFilmOffset {-0.5 -0.1}
}

-deke

unread,
Jul 20, 2011, 9:12:05 AM7/20/11
to python_in...@googlegroups.com
Thank you deke. It's really helpful.
--
2.6.32.26-175.fc12.x86_64

rafal.k...@primefocusworld.com

unread,
Jul 19, 2014, 11:21:09 AM7/19/14
to python_in...@googlegroups.com
On Wednesday, July 20, 2011 9:13:20 AM UTC+1, dekekincaid.at.gmail dot com wrote:

> BTW, nuke can read film offsets with fbx 2010 files.

I have tried this with both binary and asci files in nuke 7 & 8 and the film projections offsets don't import into nuke....

can you remember how you did this?

vladislav....@framestore.com

unread,
Sep 9, 2015, 3:35:10 PM9/9/15
to Python Programming for Autodesk Maya
Hi guys, sorry to bring this topic back.

How to export
window translate from Nuke to Maya?

Thanks a lot.

Vladislav Akhtyrskiy

unread,
Sep 9, 2015, 3:36:15 PM9/9/15
to python_in...@googlegroups.com

Actually already did it)

--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/UuQZoft2XQ4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/20bbc067-f678-46cd-ac2d-909abd64e29a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

adrian...@googlemail.com

unread,
Nov 9, 2015, 1:41:13 PM11/9/15
to Python Programming for Autodesk Maya, vladislav....@framestore.com
Vladislav - How did you do it?

adrian...@googlemail.com

unread,
Nov 9, 2015, 2:00:30 PM11/9/15
to Python Programming for Autodesk Maya, vladislav....@framestore.com, adrian...@googlemail.com
Think I figured this out but haven't rigorously tested yet (Looked fine in viewport :D) - Just in case anyone else finds this thread with the same question of going from Nuke to Maya rather than the other way.

(Nuke window translate U * (Nuke horizontal aperture / 25.4)) / 2 = Maya Horizontal film offset

For V it's the same just substitute Nuke window translate U value for V value.

Jeremy Beauchamp

unread,
Aug 31, 2019, 8:43:50 PM8/31/19
to Python Programming for Autodesk Maya
Anyone know the math for Maya Pre/post scale to Nuke window scale u/v? 
> > To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages