Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-08 13:52:32 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-08 13:52:32 +0300
commit1046b16ae4ba90b9aa12937eb1cd48939f43403b (patch)
tree3cf2326c728a9485c6c95affcfc23f38f006d56a /render_povray
parent17696ce3b8b7ea77bed96ec78cc08d37536f4ccd (diff)
create output dir if it doesnt exist and use native path separator.
Diffstat (limited to 'render_povray')
-rw-r--r--render_povray/render.py27
1 files changed, 20 insertions, 7 deletions
diff --git a/render_povray/render.py b/render_povray/render.py
index fe5b9c6f..ac163b03 100644
--- a/render_povray/render.py
+++ b/render_povray/render.py
@@ -1721,13 +1721,19 @@ class PovrayRender(bpy.types.RenderEngine):
povPath = bpy.path.abspath("//")
else:
povPath = bpy.path.abspath(scene.pov_scene_path)
+
if not os.path.exists(povPath):
- print("POV-Ray 3.7: Cannot find scenes directory")
- self.update_stats("", "POV-Ray 3.7: Cannot find scenes directory")
- print("Path: " + povPath)
- time.sleep(2.0)
- return
-
+ try:
+ os.makedirs(povPath)
+ except:
+ import traceback
+ traceback.print_exc()
+
+ print("POV-Ray 3.7: Cannot create scenes directory: %r" % povPath)
+ self.update_stats("", "POV-Ray 3.7: Cannot create scenes directory %r" % povPath)
+ time.sleep(2.0)
+ return
+
'''
# Bug in POV-Ray RC3
renderImagePath = bpy.path.abspath(scene.pov_renderimage_path).replace('\\','/')
@@ -1769,7 +1775,7 @@ class PovrayRender(bpy.types.RenderEngine):
print("Scene name: " + povSceneName)
print("Export path: " + povPath)
- povPath = povPath + "\\" + povSceneName
+ povPath = os.path.join(povPath, povSceneName)
povPath = os.path.realpath(povPath)
# renderImagePath = renderImagePath + "\\" + povSceneName # for now this has to be the same like the pov output. Bug in POV-Ray RC3.
@@ -1819,12 +1825,19 @@ class PovrayRender(bpy.types.RenderEngine):
prev_size = -1
def update_image():
+ xmin = int(r.border_min_x * x)
+ ymin = int(r.border_min_y * y)
+ xmax = int(r.border_max_x * x)
+ ymax = int(r.border_max_y * y)
+
# print("***POV UPDATING IMAGE***")
result = self.begin_result(0, 0, x, y)
+ #result = self.begin_result(xmin, ymin, xmax - xmin, ymax - ymin) # XXX, test for border render.
lay = result.layers[0]
# possible the image wont load early on.
try:
lay.load_from_file(self._temp_file_out)
+ #lay.load_from_file(self._temp_file_out, xmin, ymin) # XXX, test for border render.
except SystemError:
pass
self.end_result(result)