forked from LeenkxTeam/LNXSDK
Revert PAR
This commit is contained in:
@ -2652,8 +2652,6 @@ class LeenkxExporter:
|
||||
c = proj[2][2]
|
||||
d = proj[2][3]
|
||||
o['fov'] = 2.0 * math.atan(1.0 / b)
|
||||
if abs(a) > 1e-6:
|
||||
o['aspect'] = b / a
|
||||
if with_planes:
|
||||
denom = c + 1.0
|
||||
k = (c - 1.0) / denom if abs(denom) >= 1e-6 else 0.0
|
||||
@ -2679,29 +2677,6 @@ class LeenkxExporter:
|
||||
o['far_plane'] = -(1 - proj[3][2]) / proj[2][2]
|
||||
o['near_plane'] *= 2
|
||||
o['far_plane'] *= 2
|
||||
if abs(a) > 1e-6:
|
||||
o['aspect'] = b / a
|
||||
|
||||
@staticmethod
|
||||
def compute_effective_par(rpdat, render):
|
||||
if rpdat is None:
|
||||
return render.pixel_aspect_x, render.pixel_aspect_y
|
||||
mode = rpdat.lnx_aspect_mode
|
||||
if mode == 'blender':
|
||||
return render.pixel_aspect_x, render.pixel_aspect_y
|
||||
elif mode == 'square':
|
||||
return 1.0, 1.0
|
||||
elif mode == 'ntsc_43':
|
||||
return 0.889, 1.0
|
||||
elif mode == 'pal_43':
|
||||
return 1.067, 1.0
|
||||
elif mode == 'ntsc_169':
|
||||
return 1.212, 1.0
|
||||
elif mode == 'pal_169':
|
||||
return 1.459, 1.0
|
||||
elif mode == 'custom':
|
||||
return rpdat.lnx_aspect_custom, 1.0
|
||||
return render.pixel_aspect_x, render.pixel_aspect_y
|
||||
|
||||
def export_camera(self, objectRef):
|
||||
o = {}
|
||||
@ -2710,22 +2685,16 @@ class LeenkxExporter:
|
||||
|
||||
camera = objectRef[1]["objectTable"][0]
|
||||
render = self.scene.render
|
||||
rpdat = lnx.utils.get_rp()
|
||||
|
||||
par_x, par_y = self.compute_effective_par(rpdat, render)
|
||||
|
||||
proj = camera.calc_matrix_camera(
|
||||
self.depsgraph,
|
||||
x=render.resolution_x,
|
||||
y=render.resolution_y,
|
||||
scale_x=par_x,
|
||||
scale_y=par_y)
|
||||
scale_x=render.pixel_aspect_x,
|
||||
scale_y=render.pixel_aspect_y)
|
||||
if objref.type == 'PERSP':
|
||||
self.extract_projection(o, proj)
|
||||
else:
|
||||
self.extract_ortho(o, proj)
|
||||
if par_x == par_y:
|
||||
o.pop('aspect', None)
|
||||
|
||||
o['frustum_culling'] = objref.lnx_frustum_culling
|
||||
o['clear_color'] = self.get_camera_clear_color()
|
||||
@ -3386,12 +3355,6 @@ class LeenkxExporter:
|
||||
'clear_color': self.get_camera_clear_color()
|
||||
}
|
||||
|
||||
render = self.scene.render
|
||||
rpdat = lnx.utils.get_rp()
|
||||
par_x, par_y = self.compute_effective_par(rpdat, render)
|
||||
res_aspect = render.resolution_x / render.resolution_y if render.resolution_y > 0 else 1.0
|
||||
effective_aspect = res_aspect * par_x / par_y
|
||||
|
||||
# Set viewport camera projection
|
||||
proj, is_persp = self.get_viewport_projection_matrix()
|
||||
if proj is not None:
|
||||
@ -3400,9 +3363,6 @@ class LeenkxExporter:
|
||||
else:
|
||||
self.extract_ortho(out_camera, proj)
|
||||
|
||||
if par_x != par_y:
|
||||
out_camera['aspect'] = effective_aspect
|
||||
|
||||
self.output['camera_datas'].append(out_camera)
|
||||
|
||||
out_object = {
|
||||
|
||||
Reference in New Issue
Block a user