[Bf-extensions-cvs] [a6a0a94c] master: POV: Add camera types orthographic and cylindrical modes. best match for ortho.

Maurice Raybaud noreply at git.blender.org
Sat Apr 4 15:02:19 CEST 2020


Commit: a6a0a94c368adef9cdb7bf3d3a36da8f36b73bbb
Author: Maurice Raybaud
Date:   Sat Apr 4 15:01:30 2020 +0200
Branches: master
https://developer.blender.org/rBAa6a0a94c368adef9cdb7bf3d3a36da8f36b73bbb

POV: Add camera types
orthographic and cylindrical modes. best match for ortho.

===================================================================

M	render_povray/render.py

===================================================================

diff --git a/render_povray/render.py b/render_povray/render.py
index afae0981..6efe7291 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -660,15 +660,38 @@ def write_pov(filename, scene=None, info_callback=None):
             tabWrite("}\n")
             tabWrite("location <0,0,.01>")
             tabWrite("direction <0,0,-1>")
-        # Using standard camera otherwise
+
         else:
-            tabWrite("location  <0, 0, 0>\n")
-            tabWrite("look_at  <0, 0, -1>\n")
-            tabWrite("right <%s, 0, 0>\n" % -Qsize)
-            tabWrite("up <0, 1, 0>\n")
-            tabWrite(
-                "angle  %f\n" % (360.0 * atan(16.0 / camera.data.lens) / pi)
-            )
+            if camera.data.type == 'ORTHO':
+                SensorHeightRatio = render.resolution_x * camera.data.ortho_scale / render.resolution_y
+                tabWrite("orthographic\n")
+                # Blender angle is radian so should be converted to degrees:
+                # % (camera.data.angle * (180.0 / pi) )
+                # but actually argument is not compulsory after angle in pov ortho mode
+                tabWrite("angle\n")
+                tabWrite("right <%6f, 0, 0>\n" % -camera.data.ortho_scale)
+                tabWrite("location  <0, 0, 0>\n")
+                tabWrite("look_at  <0, 0, -1>\n")
+                tabWrite("up <0, %6f, 0>\n" % (camera.data.ortho_scale / Qsize))
+
+            elif camera.data.type == 'PANO':
+                tabWrite("panoramic\n")
+                tabWrite("location  <0, 0, 0>\n")
+                tabWrite("look_at  <0, 0, -1>\n")
+                tabWrite("right <%s, 0, 0>\n" % -Qsize)
+                tabWrite("up <0, 1, 0>\n")
+                tabWrite(
+                    "angle  %f\n" % (360.0 * atan(16.0 / camera.data.lens) / pi)
+                )
+            elif camera.data.type == 'PERSP':
+                # Standard camera otherwise would be default in pov
+                tabWrite("location  <0, 0, 0>\n")
+                tabWrite("look_at  <0, 0, -1>\n")
+                tabWrite("right <%s, 0, 0>\n" % -Qsize)
+                tabWrite("up <0, 1, 0>\n")
+                tabWrite(
+                    "angle  %f\n" % (360.0 * atan(16.0 / camera.data.lens) / pi)
+                )
 
             tabWrite(
                 "rotate  <%.6f, %.6f, %.6f>\n"



More information about the Bf-extensions-cvs mailing list