最近在公司碰到个问题,就是从Max里导出相机到Maya里,不论是导出fbx还是abc,在Maya焦距的大小和Max里怎么都对不不上,于是只能在Max里逐帧将相机的焦距的数值记录到一个文件里,然后再回到Maya里重新设置一遍焦距,总算暂时解决了生产中的任务,不知各位大佬还有更好的解决办法没,下面是我在Max里的实现方法。
fn getSelName=
(
for s in selection do return s
)
start = animationRange.start.frame
end = animationRange.end.frame
txt_file = "F:/3DMax/cam_lens.txt"
camera_lens = #()
for j=start to end do
(
slidertime = j
select_object = getSelName()
FOV = select_object.fov
lens = 0.5 * (GetRendApertureWidth()/tan(FOV/2.0))
print lens
append camera_lens lens
)
print camera_lens
if doesFileExist(txt_file) == false do
(
textFile = createFile txt_file
close textFile
)
fs = openFile txt_file mode:"r+"
for item in camera_lens do
(
item_string = item as string + "\n"
print item_string
format item_string to:fs
)
close fs
在Maya中重新设置焦距就简单了,自己这里就不啰嗦了。