2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-12-29 00:04:57 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-12-29 00:04:57 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
|
|
|
|
2009-08-29 17:25:22 +00:00
|
|
|
import bpy
|
|
|
|
import sys, os
|
|
|
|
import http, http.client, http.server, urllib
|
|
|
|
import subprocess, shutil, time, hashlib
|
|
|
|
|
2009-11-18 18:00:46 +00:00
|
|
|
import netrender
|
2009-08-29 17:25:22 +00:00
|
|
|
import netrender.slave as slave
|
|
|
|
import netrender.master as master
|
|
|
|
|
2009-09-08 01:18:06 +00:00
|
|
|
from netrender.utils import *
|
|
|
|
|
2009-08-29 17:25:22 +00:00
|
|
|
VERSION = b"0.3"
|
|
|
|
|
|
|
|
PATH_PREFIX = "/tmp/"
|
|
|
|
|
|
|
|
QUEUED = 0
|
|
|
|
DISPATCHED = 1
|
|
|
|
DONE = 2
|
|
|
|
ERROR = 3
|
|
|
|
|
2010-11-09 03:37:51 +00:00
|
|
|
LAST_ADDRESS_TEST = 0
|
|
|
|
|
2010-08-06 22:24:33 +00:00
|
|
|
def base_poll(cls, context):
|
|
|
|
rd = context.scene.render
|
|
|
|
return (rd.use_game_engine==False) and (rd.engine in cls.COMPAT_ENGINES)
|
|
|
|
|
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
def init_file():
|
2010-06-02 17:58:28 +00:00
|
|
|
if netrender.init_file != bpy.data.filepath:
|
|
|
|
netrender.init_file = bpy.data.filepath
|
2010-01-04 21:05:52 +00:00
|
|
|
netrender.init_data = True
|
2010-11-09 03:37:51 +00:00
|
|
|
netrender.valid_address = False
|
2010-01-04 21:05:52 +00:00
|
|
|
|
|
|
|
def init_data(netsettings):
|
|
|
|
init_file()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
if netrender.init_data:
|
|
|
|
netrender.init_data = False
|
|
|
|
|
|
|
|
netsettings.active_slave_index = 0
|
|
|
|
while(len(netsettings.slaves) > 0):
|
|
|
|
netsettings.slaves.remove(0)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
netsettings.active_blacklisted_slave_index = 0
|
|
|
|
while(len(netsettings.slaves_blacklist) > 0):
|
|
|
|
netsettings.slaves_blacklist.remove(0)
|
|
|
|
|
|
|
|
netsettings.active_job_index = 0
|
|
|
|
while(len(netsettings.jobs) > 0):
|
|
|
|
netsettings.jobs.remove(0)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
def verify_address(netsettings):
|
2010-11-09 03:37:51 +00:00
|
|
|
global LAST_ADDRESS_TEST
|
2010-01-04 21:05:52 +00:00
|
|
|
init_file()
|
|
|
|
|
2010-11-09 03:37:51 +00:00
|
|
|
if LAST_ADDRESS_TEST + 5 < time.time():
|
|
|
|
LAST_ADDRESS_TEST = time.time()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
try:
|
|
|
|
conn = clientConnection(netsettings.server_address, netsettings.server_port, scan = False)
|
|
|
|
except:
|
|
|
|
conn = None
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
if conn:
|
2010-11-09 03:37:51 +00:00
|
|
|
netrender.valid_address = True
|
2010-01-04 21:05:52 +00:00
|
|
|
conn.close()
|
|
|
|
else:
|
2010-11-09 03:37:51 +00:00
|
|
|
netrender.valid_address = False
|
2010-11-25 01:25:47 +00:00
|
|
|
|
|
|
|
return netrender.valid_address
|
2010-11-09 03:37:51 +00:00
|
|
|
|
|
|
|
class NeedValidAddress():
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-25 01:25:47 +00:00
|
|
|
return super().poll(context) and verify_address(context.scene.network_render)
|
2010-01-04 21:05:52 +00:00
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class NetRenderButtonsPanel():
|
2009-12-29 00:04:57 +00:00
|
|
|
bl_space_type = "PROPERTIES"
|
|
|
|
bl_region_type = "WINDOW"
|
|
|
|
bl_context = "render"
|
|
|
|
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
2010-08-10 02:58:32 +00:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
rd = context.scene.render
|
2010-11-25 01:25:47 +00:00
|
|
|
return rd.engine == 'NET_RENDER' and rd.use_game_engine == False
|
2009-08-29 17:25:22 +00:00
|
|
|
|
|
|
|
# Setting panel, use in the scene for now.
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_settings(NetRenderButtonsPanel, bpy.types.Panel):
|
2009-12-29 00:04:57 +00:00
|
|
|
bl_label = "Network Settings"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-09 03:37:51 +00:00
|
|
|
return super().poll(context)
|
2010-08-05 16:05:30 +00:00
|
|
|
|
2009-12-29 00:04:57 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
2010-01-04 21:05:52 +00:00
|
|
|
netsettings = scene.network_render
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
verify_address(netsettings)
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
layout.prop(netsettings, "mode", expand=True)
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
if netsettings.mode in ("RENDER_MASTER", "RENDER_SLAVE"):
|
|
|
|
layout.operator("render.netclientstart", icon='PLAY')
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
layout.prop(netsettings, "path")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
split = layout.split(percentage=0.7)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-12-29 00:04:57 +00:00
|
|
|
col = split.column()
|
2010-09-13 22:57:35 +00:00
|
|
|
col.label(text="Server Address:")
|
2010-01-05 20:47:23 +00:00
|
|
|
col.prop(netsettings, "server_address", text="")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
col = split.column()
|
|
|
|
col.label(text="Port:")
|
|
|
|
col.prop(netsettings, "server_port", text="")
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2010-01-06 18:56:24 +00:00
|
|
|
if netsettings.mode != "RENDER_MASTER":
|
2010-01-05 20:47:23 +00:00
|
|
|
layout.operator("render.netclientscan", icon='FILE_REFRESH', text="")
|
2010-11-09 03:37:51 +00:00
|
|
|
|
|
|
|
if not netrender.valid_address:
|
|
|
|
layout.label(text="No master at specified address")
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
layout.operator("render.netclientweb", icon='QUESTION')
|
2009-12-28 22:49:22 +00:00
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_slave_settings(NetRenderButtonsPanel, bpy.types.Panel):
|
2010-01-06 18:56:24 +00:00
|
|
|
bl_label = "Slave Settings"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-01-06 18:56:24 +00:00
|
|
|
scene = context.scene
|
2010-11-09 03:37:51 +00:00
|
|
|
return super().poll(context) and scene.network_render.mode == "RENDER_SLAVE"
|
2010-01-06 18:56:24 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
2010-02-23 12:48:35 +00:00
|
|
|
rd = scene.render
|
2010-01-06 18:56:24 +00:00
|
|
|
netsettings = scene.network_render
|
|
|
|
|
2010-08-20 06:09:58 +00:00
|
|
|
layout.prop(netsettings, "use_slave_clear")
|
|
|
|
layout.prop(netsettings, "use_slave_thumb")
|
|
|
|
layout.prop(netsettings, "use_slave_output_log")
|
2010-01-08 17:52:21 +00:00
|
|
|
layout.label(text="Threads:")
|
|
|
|
layout.prop(rd, "threads_mode", expand=True)
|
|
|
|
sub = layout.column()
|
2010-03-16 18:22:55 +00:00
|
|
|
sub.enabled = rd.threads_mode == 'FIXED'
|
2010-01-31 14:46:28 +00:00
|
|
|
sub.prop(rd, "threads")
|
2010-08-02 02:55:12 +00:00
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_master_settings(NetRenderButtonsPanel, bpy.types.Panel):
|
2010-01-06 18:56:24 +00:00
|
|
|
bl_label = "Master Settings"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-01-06 18:56:24 +00:00
|
|
|
scene = context.scene
|
2010-11-09 03:37:51 +00:00
|
|
|
return super().poll(context) and scene.network_render.mode == "RENDER_MASTER"
|
2010-01-06 18:56:24 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
netsettings = scene.network_render
|
|
|
|
|
2010-08-20 06:09:58 +00:00
|
|
|
layout.prop(netsettings, "use_master_broadcast")
|
|
|
|
layout.prop(netsettings, "use_master_clear")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_job(NetRenderButtonsPanel, bpy.types.Panel):
|
2009-12-29 00:04:57 +00:00
|
|
|
bl_label = "Job Settings"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2009-12-29 00:04:57 +00:00
|
|
|
scene = context.scene
|
2010-11-09 03:37:51 +00:00
|
|
|
return super().poll(context) and scene.network_render.mode == "RENDER_CLIENT"
|
2009-12-29 00:04:57 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
2010-01-04 21:05:52 +00:00
|
|
|
netsettings = scene.network_render
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
verify_address(netsettings)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-04 21:05:52 +00:00
|
|
|
if netsettings.server_address != "[default]":
|
2010-01-05 20:47:23 +00:00
|
|
|
layout.operator("render.netclientanim", icon='RENDER_ANIMATION')
|
|
|
|
layout.operator("render.netclientsend", icon='FILE_BLEND')
|
2010-05-01 20:39:04 +00:00
|
|
|
layout.operator("render.netclientsendframe", icon='RENDER_STILL')
|
2010-01-04 21:05:52 +00:00
|
|
|
if netsettings.job_id:
|
2010-01-05 20:47:23 +00:00
|
|
|
row = layout.row()
|
2010-03-08 16:36:53 +00:00
|
|
|
row.operator("render.render", text="Get Image", icon='RENDER_STILL')
|
|
|
|
row.operator("render.render", text="Get Animation", icon='RENDER_ANIMATION').animation = True
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
split = layout.split(percentage=0.3)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
col = split.column()
|
netrender
New Feature:
VCS job type
Render a file (with dependencies) from a version control system (currently only supports subversion, but system is already generic).
On client, working path, server path and current revision can be guessed from data on disk or entered manually.
On slave, a working copy is created (if needed) where specified by the job and updated to the proper revision.
On master web page, job types now appear in the job lists. The job page shows the list of dependencies for "normal" jobs or versioning information for VCS jobs.
Limitations: Need to have command line tools "svn" and "svnversion". Working copy path must be the same on client and slaves (the client gets the job path relative to the working copy). When guessing, working copy path is set to the folder where the current file is (this can be changed manually after). On the slave, it will update the working copy AS SPECIFIED to the revision, so if that path is too deep, some dependencies will not be updated properly. Doesn't support mixed revisions (and will not give any warnings for that), it will always use the first revision specified by "svnversion"
Bugfix:
Thumbnail generation doesn't chew down memory anymore and always gives correct result (thumbnail on master especially could mess up between jobs with the name result filename)
2010-10-27 18:24:58 +00:00
|
|
|
col.label(text="Type:")
|
2010-01-05 20:47:23 +00:00
|
|
|
col.label(text="Name:")
|
|
|
|
col.label(text="Category:")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
col = split.column()
|
netrender
New Feature:
VCS job type
Render a file (with dependencies) from a version control system (currently only supports subversion, but system is already generic).
On client, working path, server path and current revision can be guessed from data on disk or entered manually.
On slave, a working copy is created (if needed) where specified by the job and updated to the proper revision.
On master web page, job types now appear in the job lists. The job page shows the list of dependencies for "normal" jobs or versioning information for VCS jobs.
Limitations: Need to have command line tools "svn" and "svnversion". Working copy path must be the same on client and slaves (the client gets the job path relative to the working copy). When guessing, working copy path is set to the folder where the current file is (this can be changed manually after). On the slave, it will update the working copy AS SPECIFIED to the revision, so if that path is too deep, some dependencies will not be updated properly. Doesn't support mixed revisions (and will not give any warnings for that), it will always use the first revision specified by "svnversion"
Bugfix:
Thumbnail generation doesn't chew down memory anymore and always gives correct result (thumbnail on master especially could mess up between jobs with the name result filename)
2010-10-27 18:24:58 +00:00
|
|
|
col.prop(netsettings, "job_type", text="")
|
2010-01-05 20:47:23 +00:00
|
|
|
col.prop(netsettings, "job_name", text="")
|
|
|
|
col.prop(netsettings, "job_category", text="")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-05 20:47:23 +00:00
|
|
|
row = layout.row()
|
2010-01-04 21:05:52 +00:00
|
|
|
row.prop(netsettings, "priority")
|
|
|
|
row.prop(netsettings, "chunks")
|
2009-08-29 17:25:22 +00:00
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_job_vcs(NetRenderButtonsPanel, bpy.types.Panel):
|
netrender
New Feature:
VCS job type
Render a file (with dependencies) from a version control system (currently only supports subversion, but system is already generic).
On client, working path, server path and current revision can be guessed from data on disk or entered manually.
On slave, a working copy is created (if needed) where specified by the job and updated to the proper revision.
On master web page, job types now appear in the job lists. The job page shows the list of dependencies for "normal" jobs or versioning information for VCS jobs.
Limitations: Need to have command line tools "svn" and "svnversion". Working copy path must be the same on client and slaves (the client gets the job path relative to the working copy). When guessing, working copy path is set to the folder where the current file is (this can be changed manually after). On the slave, it will update the working copy AS SPECIFIED to the revision, so if that path is too deep, some dependencies will not be updated properly. Doesn't support mixed revisions (and will not give any warnings for that), it will always use the first revision specified by "svnversion"
Bugfix:
Thumbnail generation doesn't chew down memory anymore and always gives correct result (thumbnail on master especially could mess up between jobs with the name result filename)
2010-10-27 18:24:58 +00:00
|
|
|
bl_label = "VCS Job Settings"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
scene = context.scene
|
2010-11-09 03:37:51 +00:00
|
|
|
return (super().poll(context)
|
netrender
New Feature:
VCS job type
Render a file (with dependencies) from a version control system (currently only supports subversion, but system is already generic).
On client, working path, server path and current revision can be guessed from data on disk or entered manually.
On slave, a working copy is created (if needed) where specified by the job and updated to the proper revision.
On master web page, job types now appear in the job lists. The job page shows the list of dependencies for "normal" jobs or versioning information for VCS jobs.
Limitations: Need to have command line tools "svn" and "svnversion". Working copy path must be the same on client and slaves (the client gets the job path relative to the working copy). When guessing, working copy path is set to the folder where the current file is (this can be changed manually after). On the slave, it will update the working copy AS SPECIFIED to the revision, so if that path is too deep, some dependencies will not be updated properly. Doesn't support mixed revisions (and will not give any warnings for that), it will always use the first revision specified by "svnversion"
Bugfix:
Thumbnail generation doesn't chew down memory anymore and always gives correct result (thumbnail on master especially could mess up between jobs with the name result filename)
2010-10-27 18:24:58 +00:00
|
|
|
and scene.network_render.mode == "RENDER_CLIENT"
|
|
|
|
and scene.network_render.job_type == "JOB_VCS")
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
netsettings = scene.network_render
|
|
|
|
|
|
|
|
layout.operator("render.netclientvcsguess", icon='FILE_REFRESH', text="")
|
|
|
|
|
|
|
|
layout.prop(netsettings, "vcs_system")
|
|
|
|
layout.prop(netsettings, "vcs_revision")
|
|
|
|
layout.prop(netsettings, "vcs_rpath")
|
|
|
|
layout.prop(netsettings, "vcs_wpath")
|
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_slaves(NeedValidAddress, NetRenderButtonsPanel, bpy.types.Panel):
|
2009-12-29 00:04:57 +00:00
|
|
|
bl_label = "Slaves Status"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-25 01:25:47 +00:00
|
|
|
netsettings = context.scene.network_render
|
|
|
|
return super().poll(context) and netsettings.mode == "RENDER_CLIENT"
|
2009-12-29 00:04:57 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
netsettings = scene.network_render
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(netsettings, "slaves", netsettings, "active_slave_index", rows=2)
|
|
|
|
|
|
|
|
sub = row.column(align=True)
|
|
|
|
sub.operator("render.netclientslaves", icon='FILE_REFRESH', text="")
|
|
|
|
sub.operator("render.netclientblacklistslave", icon='ZOOMOUT', text="")
|
|
|
|
|
|
|
|
if netsettings.active_slave_index >= 0 and len(netsettings.slaves) > 0:
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
slave = netrender.slaves[netsettings.active_slave_index]
|
|
|
|
|
|
|
|
layout.label(text="Name: " + slave.name)
|
|
|
|
layout.label(text="Address: " + slave.address[0])
|
|
|
|
layout.label(text="Seen: " + time.ctime(slave.last_seen))
|
|
|
|
layout.label(text="Stats: " + slave.stats)
|
2009-08-29 17:25:22 +00:00
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_slaves_blacklist(NeedValidAddress, NetRenderButtonsPanel, bpy.types.Panel):
|
2009-12-29 00:04:57 +00:00
|
|
|
bl_label = "Slaves Blacklist"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-25 01:25:47 +00:00
|
|
|
netsettings = context.scene.network_render
|
|
|
|
return super().poll(context) and netsettings.mode == "RENDER_CLIENT"
|
2009-12-29 00:04:57 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
netsettings = scene.network_render
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(netsettings, "slaves_blacklist", netsettings, "active_blacklisted_slave_index", rows=2)
|
|
|
|
|
|
|
|
sub = row.column(align=True)
|
|
|
|
sub.operator("render.netclientwhitelistslave", icon='ZOOMOUT', text="")
|
|
|
|
|
|
|
|
if netsettings.active_blacklisted_slave_index >= 0 and len(netsettings.slaves_blacklist) > 0:
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
slave = netrender.blacklist[netsettings.active_blacklisted_slave_index]
|
|
|
|
|
|
|
|
layout.label(text="Name: " + slave.name)
|
|
|
|
layout.label(text="Address: " + slave.address[0])
|
|
|
|
layout.label(text="Seen: " + time.ctime(slave.last_seen))
|
|
|
|
layout.label(text="Stats: " + slave.stats)
|
2009-08-29 17:25:22 +00:00
|
|
|
|
2010-11-25 01:25:47 +00:00
|
|
|
class RENDER_PT_network_jobs(NeedValidAddress, NetRenderButtonsPanel, bpy.types.Panel):
|
2009-12-29 00:04:57 +00:00
|
|
|
bl_label = "Jobs"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
2010-08-09 01:37:09 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
2010-11-25 01:25:47 +00:00
|
|
|
netsettings = context.scene.network_render
|
|
|
|
return super().poll(context) and netsettings.mode == "RENDER_CLIENT"
|
2009-12-29 00:04:57 +00:00
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
netsettings = scene.network_render
|
|
|
|
|
|
|
|
row = layout.row()
|
|
|
|
row.template_list(netsettings, "jobs", netsettings, "active_job_index", rows=2)
|
|
|
|
|
|
|
|
sub = row.column(align=True)
|
|
|
|
sub.operator("render.netclientstatus", icon='FILE_REFRESH', text="")
|
|
|
|
sub.operator("render.netclientcancel", icon='ZOOMOUT', text="")
|
|
|
|
sub.operator("render.netclientcancelall", icon='PANEL_CLOSE', text="")
|
|
|
|
sub.operator("render.netclientdownload", icon='RENDER_ANIMATION', text="")
|
|
|
|
|
|
|
|
if netsettings.active_job_index >= 0 and len(netsettings.jobs) > 0:
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
job = netrender.jobs[netsettings.active_job_index]
|
|
|
|
|
|
|
|
layout.label(text="Name: %s" % job.name)
|
|
|
|
layout.label(text="Length: %04i" % len(job))
|
|
|
|
layout.label(text="Done: %04i" % job.results[DONE])
|
|
|
|
layout.label(text="Error: %04i" % job.results[ERROR])
|
2009-08-29 17:25:22 +00:00
|
|
|
|
2011-01-08 19:42:26 +00:00
|
|
|
import properties_render
|
|
|
|
class RENDER_PT_network_output(NeedValidAddress, NetRenderButtonsPanel, bpy.types.Panel):
|
|
|
|
bl_label = "Output"
|
|
|
|
COMPAT_ENGINES = {'NET_RENDER'}
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
netsettings = context.scene.network_render
|
|
|
|
return super().poll(context) and netsettings.mode == "RENDER_CLIENT"
|
|
|
|
|
|
|
|
draw = properties_render.RENDER_PT_output.draw
|
|
|
|
|
2009-08-29 17:25:22 +00:00
|
|
|
class NetRenderSettings(bpy.types.IDPropertyGroup):
|
2009-12-29 00:04:57 +00:00
|
|
|
pass
|
2009-08-29 17:25:22 +00:00
|
|
|
|
|
|
|
class NetRenderSlave(bpy.types.IDPropertyGroup):
|
2009-12-29 00:04:57 +00:00
|
|
|
pass
|
2009-08-29 17:25:22 +00:00
|
|
|
|
|
|
|
class NetRenderJob(bpy.types.IDPropertyGroup):
|
2009-12-29 00:04:57 +00:00
|
|
|
pass
|
2009-08-29 17:25:22 +00:00
|
|
|
|
2010-07-31 19:23:22 +00:00
|
|
|
def addProperties():
|
2010-09-09 06:29:44 +00:00
|
|
|
from bpy.props import PointerProperty, StringProperty, BoolProperty, EnumProperty, IntProperty, CollectionProperty
|
|
|
|
bpy.types.Scene.network_render = PointerProperty(type=NetRenderSettings, name="Network Render", description="Network Render Settings")
|
2010-07-31 19:23:22 +00:00
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.server_address = StringProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Server address",
|
|
|
|
description="IP or name of the master render server",
|
|
|
|
maxlen = 128,
|
|
|
|
default = "[default]")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.server_port = IntProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Server port",
|
|
|
|
description="port of the master render server",
|
|
|
|
default = 8000,
|
|
|
|
min=1,
|
|
|
|
max=65535)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.use_master_broadcast = BoolProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Broadcast",
|
|
|
|
description="broadcast master server address on local network",
|
|
|
|
default = True)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.use_slave_clear = BoolProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Clear on exit",
|
|
|
|
description="delete downloaded files on exit",
|
|
|
|
default = True)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.use_slave_thumb = BoolProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Generate thumbnails",
|
|
|
|
description="Generate thumbnails on slaves instead of master",
|
|
|
|
default = False)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.use_slave_output_log = BoolProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Output render log on console",
|
|
|
|
description="Output render text log to console as well as sending it to the master",
|
|
|
|
default = True)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.use_master_clear = BoolProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Clear on exit",
|
|
|
|
description="delete saved files on exit",
|
|
|
|
default = False)
|
|
|
|
|
|
|
|
default_path = os.environ.get("TEMP")
|
|
|
|
|
|
|
|
if not default_path:
|
|
|
|
if os.name == 'nt':
|
|
|
|
default_path = "c:/tmp/"
|
|
|
|
else:
|
|
|
|
default_path = "/tmp/"
|
|
|
|
elif not default_path.endswith(os.sep):
|
|
|
|
default_path += os.sep
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.path = StringProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Path",
|
|
|
|
description="Path for temporary files",
|
|
|
|
maxlen = 128,
|
|
|
|
default = default_path,
|
|
|
|
subtype='FILE_PATH')
|
|
|
|
|
netrender
New Feature:
VCS job type
Render a file (with dependencies) from a version control system (currently only supports subversion, but system is already generic).
On client, working path, server path and current revision can be guessed from data on disk or entered manually.
On slave, a working copy is created (if needed) where specified by the job and updated to the proper revision.
On master web page, job types now appear in the job lists. The job page shows the list of dependencies for "normal" jobs or versioning information for VCS jobs.
Limitations: Need to have command line tools "svn" and "svnversion". Working copy path must be the same on client and slaves (the client gets the job path relative to the working copy). When guessing, working copy path is set to the folder where the current file is (this can be changed manually after). On the slave, it will update the working copy AS SPECIFIED to the revision, so if that path is too deep, some dependencies will not be updated properly. Doesn't support mixed revisions (and will not give any warnings for that), it will always use the first revision specified by "svnversion"
Bugfix:
Thumbnail generation doesn't chew down memory anymore and always gives correct result (thumbnail on master especially could mess up between jobs with the name result filename)
2010-10-27 18:24:58 +00:00
|
|
|
NetRenderSettings.job_type = EnumProperty(
|
|
|
|
items=(
|
|
|
|
("JOB_BLENDER", "Blender", "Standard Blender Job"),
|
|
|
|
("JOB_PROCESS", "Process", "Custom Process Job"),
|
|
|
|
("JOB_VCS", "VCS", "Version Control System Managed Job"),
|
|
|
|
),
|
|
|
|
name="Job Type",
|
|
|
|
description="Type of render job",
|
|
|
|
default="JOB_BLENDER")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.job_name = StringProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Job name",
|
|
|
|
description="Name of the job",
|
|
|
|
maxlen = 128,
|
|
|
|
default = "[default]")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.job_category = StringProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Job category",
|
|
|
|
description="Category of the job",
|
|
|
|
maxlen = 128,
|
|
|
|
default = "")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.chunks = IntProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Chunks",
|
|
|
|
description="Number of frame to dispatch to each slave in one chunk",
|
|
|
|
default = 5,
|
|
|
|
min=1,
|
|
|
|
max=65535)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.priority = IntProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Priority",
|
|
|
|
description="Priority of the job",
|
|
|
|
default = 1,
|
|
|
|
min=1,
|
|
|
|
max=10)
|
|
|
|
|
netrender
New Feature:
VCS job type
Render a file (with dependencies) from a version control system (currently only supports subversion, but system is already generic).
On client, working path, server path and current revision can be guessed from data on disk or entered manually.
On slave, a working copy is created (if needed) where specified by the job and updated to the proper revision.
On master web page, job types now appear in the job lists. The job page shows the list of dependencies for "normal" jobs or versioning information for VCS jobs.
Limitations: Need to have command line tools "svn" and "svnversion". Working copy path must be the same on client and slaves (the client gets the job path relative to the working copy). When guessing, working copy path is set to the folder where the current file is (this can be changed manually after). On the slave, it will update the working copy AS SPECIFIED to the revision, so if that path is too deep, some dependencies will not be updated properly. Doesn't support mixed revisions (and will not give any warnings for that), it will always use the first revision specified by "svnversion"
Bugfix:
Thumbnail generation doesn't chew down memory anymore and always gives correct result (thumbnail on master especially could mess up between jobs with the name result filename)
2010-10-27 18:24:58 +00:00
|
|
|
NetRenderSettings.vcs_wpath = StringProperty(
|
|
|
|
name="Working Copy",
|
|
|
|
description="Path of the local working copy",
|
|
|
|
maxlen = 1024,
|
|
|
|
default = "")
|
|
|
|
|
|
|
|
NetRenderSettings.vcs_rpath = StringProperty(
|
|
|
|
name="Remote Path",
|
|
|
|
description="Path of the server copy (protocol specific)",
|
|
|
|
maxlen = 1024,
|
|
|
|
default = "")
|
|
|
|
|
|
|
|
NetRenderSettings.vcs_revision = StringProperty(
|
|
|
|
name="Revision",
|
|
|
|
description="Revision for this job",
|
|
|
|
maxlen = 256,
|
|
|
|
default = "")
|
|
|
|
|
|
|
|
NetRenderSettings.vcs_system = StringProperty(
|
|
|
|
name="VCS",
|
|
|
|
description="Version Control System",
|
|
|
|
maxlen = 64,
|
|
|
|
default = "Subversion")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.job_id = StringProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Network job id",
|
|
|
|
description="id of the last sent render job",
|
|
|
|
maxlen = 64,
|
|
|
|
default = "")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.active_slave_index = IntProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Index of the active slave",
|
|
|
|
description="",
|
|
|
|
default = -1,
|
|
|
|
min= -1,
|
|
|
|
max=65535)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.active_blacklisted_slave_index = IntProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Index of the active slave",
|
|
|
|
description="",
|
|
|
|
default = -1,
|
|
|
|
min= -1,
|
|
|
|
max=65535)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.active_job_index = IntProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Index of the active job",
|
|
|
|
description="",
|
|
|
|
default = -1,
|
|
|
|
min= -1,
|
|
|
|
max=65535)
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.mode = EnumProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
items=(
|
|
|
|
("RENDER_CLIENT", "Client", "Act as render client"),
|
|
|
|
("RENDER_MASTER", "Master", "Act as render master"),
|
|
|
|
("RENDER_SLAVE", "Slave", "Act as render slave"),
|
|
|
|
),
|
|
|
|
name="Network mode",
|
|
|
|
description="Mode of operation of this instance",
|
|
|
|
default="RENDER_CLIENT")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSettings.slaves = CollectionProperty(type=NetRenderSlave, name="Slaves", description="")
|
|
|
|
NetRenderSettings.slaves_blacklist = CollectionProperty(type=NetRenderSlave, name="Slaves Blacklist", description="")
|
|
|
|
NetRenderSettings.jobs = CollectionProperty(type=NetRenderJob, name="Job List", description="")
|
2010-07-31 19:23:22 +00:00
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderSlave.name = StringProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Name of the slave",
|
|
|
|
description="",
|
|
|
|
maxlen = 64,
|
|
|
|
default = "")
|
|
|
|
|
2010-09-09 06:29:44 +00:00
|
|
|
NetRenderJob.name = StringProperty(
|
2010-07-31 19:23:22 +00:00
|
|
|
name="Name of the job",
|
|
|
|
description="",
|
|
|
|
maxlen = 128,
|
|
|
|
default = "")
|