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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2010-10-06 03:14:31 +0400
committerMartin Poirier <theeth@yahoo.com>2010-10-06 03:14:31 +0400
commit70def5c247583f0df6d190ebc1b7a2b9b69dfc3f (patch)
treee4798945f22df5ecacb6d10a2fcf16fb96a7f9d5
parenteef0ffe9be45fce28436f0be0abdbea6243675ed (diff)
[#24123] Network render gives black images
Error with buffer handling when reading response. Also fix bug with blendfile relative path (wasn't converting them properly).
-rw-r--r--release/scripts/io/netrender/client.py29
-rw-r--r--release/scripts/io/netrender/operators.py9
-rw-r--r--release/scripts/io/netrender/slave.py4
3 files changed, 23 insertions, 19 deletions
diff --git a/release/scripts/io/netrender/client.py b/release/scripts/io/netrender/client.py
index c17944725b0..128ae99ab1d 100644
--- a/release/scripts/io/netrender/client.py
+++ b/release/scripts/io/netrender/client.py
@@ -211,7 +211,7 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
address = "" if netsettings.server_address == "[default]" else netsettings.server_address
- master.runMaster((address, netsettings.server_port), netsettings.use_master_broadcast, netsettings.use_master_clear, netsettings.path, self.update_stats, self.test_break)
+ master.runMaster((address, netsettings.server_port), netsettings.use_master_broadcast, netsettings.use_master_clear, bpy.path.abspath(netsettings.path), self.update_stats, self.test_break)
def render_slave(self, scene):
@@ -236,10 +236,11 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
# reading back result
self.update_stats("", "Network render waiting for results")
-
+
+
requestResult(conn, job_id, scene.frame_current)
response = conn.getresponse()
- response.read()
+ buf = response.read()
if response.status == http.client.NO_CONTENT:
new_job = True
@@ -248,13 +249,13 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
requestResult(conn, job_id, scene.frame_current)
response = conn.getresponse()
- response.read()
-
+ buf = response.read()
+
while response.status == http.client.ACCEPTED and not self.test_break():
time.sleep(1)
requestResult(conn, job_id, scene.frame_current)
response = conn.getresponse()
- response.read()
+ buf = response.read()
# cancel new jobs (animate on network) on break
if self.test_break() and new_job:
@@ -271,18 +272,22 @@ class NetworkRenderEngine(bpy.types.RenderEngine):
r = scene.render
x= int(r.resolution_x*r.resolution_percentage*0.01)
y= int(r.resolution_y*r.resolution_percentage*0.01)
+
+ result_path = os.path.join(bpy.path.abspath(netsettings.path), "output.exr")
+
+ folder = os.path.split(result_path)[0]
+
+ if not os.path.exists(folder):
+ os.mkdir(folder)
- f = open(os.path.join(netsettings.path, "output.exr"), "wb")
- buf = response.read(1024)
+ f = open(result_path, "wb")
- while buf:
- f.write(buf)
- buf = response.read(1024)
+ f.write(buf)
f.close()
result = self.begin_result(0, 0, x, y)
- result.load_from_file(os.path.join(netsettings.path, "output.exr"))
+ result.load_from_file(result_path)
self.end_result(result)
conn.close()
diff --git a/release/scripts/io/netrender/operators.py b/release/scripts/io/netrender/operators.py
index 2b40cd77125..96601dcf653 100644
--- a/release/scripts/io/netrender/operators.py
+++ b/release/scripts/io/netrender/operators.py
@@ -417,7 +417,7 @@ class netclientdownload(bpy.types.Operator):
for frame in job.frames:
client.requestResult(conn, job.id, frame.number)
response = conn.getresponse()
- response.read()
+ buf = response.read()
if response.status != http.client.OK:
print("missing", frame.number)
@@ -425,12 +425,9 @@ class netclientdownload(bpy.types.Operator):
print("got back", frame.number)
- f = open(os.path.join(netsettings.path, "%06d.exr" % frame.number), "wb")
- buf = response.read(1024)
+ f = open(os.path.join(bpy.path.abspath(netsettings.path), "%06d.exr" % frame.number), "wb")
- while buf:
- f.write(buf)
- buf = response.read(1024)
+ f.write(buf)
f.close()
diff --git a/release/scripts/io/netrender/slave.py b/release/scripts/io/netrender/slave.py
index f017fefa4e3..526bd0b254f 100644
--- a/release/scripts/io/netrender/slave.py
+++ b/release/scripts/io/netrender/slave.py
@@ -21,6 +21,8 @@ import http, http.client, http.server, urllib
import subprocess, time
import json
+import bpy
+
from netrender.utils import *
import netrender.model
import netrender.repath
@@ -118,7 +120,7 @@ def render_slave(engine, netsettings, threads):
slave_id = response.getheader("slave-id")
- NODE_PREFIX = os.path.join(netsettings.path, "slave_" + slave_id)
+ NODE_PREFIX = os.path.join(bpy.path.abspath(netsettings.path), "slave_" + slave_id)
if not os.path.exists(NODE_PREFIX):
os.mkdir(NODE_PREFIX)