mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-29 06:27:35 +02:00
[nodes] Blender: Rescale rendered images based on their pixel aspect ratio
This commit is contained in:
parent
35b69f10f7
commit
964ca1a0e6
1 changed files with 7 additions and 0 deletions
|
@ -396,6 +396,13 @@ def main():
|
|||
setupRender(view, intrinsic, pose, args.output)
|
||||
bpy.ops.render.render(write_still=True)
|
||||
|
||||
# if the pixel aspect ratio is not 1, reload and rescale the rendered image
|
||||
if bpy.context.scene.render.pixel_aspect_x != 1.0:
|
||||
finalImg = bpy.data.images.load(bpy.context.scene.render.filepath)
|
||||
finalImg.scale(int(bpy.context.scene.render.resolution_x * bpy.context.scene.render.pixel_aspect_x), bpy.context.scene.render.resolution_y)
|
||||
finalImg.save()
|
||||
bpy.data.images.remove(finalImg)
|
||||
|
||||
# clear memory
|
||||
if img:
|
||||
bpy.data.images.remove(img)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue