Commit 782f1064 authored by Christopher Gearhart's avatar Christopher Gearhart

Added feedback when local machine not connected to internet

parent 025f5c57
......@@ -39,6 +39,13 @@ class refreshNumAvailableServers(Operator):
bl_label = "Refresh Available Servers" # display name in the interface.
bl_options = {"REGISTER", "UNDO"} # enable undo for the operator.
@classmethod
def poll(cls, context):
""" ensures operator can execute (if not, returns false) """
if not have_internet():
return False
return True
def checkNumAvailServers(self):
scn = bpy.context.scene
command = "ssh -T -oStrictHostKeyChecking=no -x {login} 'python {remotePath}blender_task -Hv --connection_timeout {timeout} --hosts_file {remotePath}servers.txt'".format(login=bpy.props.serverPrefs["login"], remotePath=bpy.props.serverPrefs["path"], timeout=scn.timeout)
......
......@@ -39,6 +39,13 @@ class sendAnimation(Operator):
bl_label = "Render Animation" # display name in the interface.
bl_options = {"REGISTER", "UNDO"} # enable undo for the operator.
@classmethod
def poll(cls, context):
""" ensures operator can execute (if not, returns false) """
if not have_internet():
return False
return True
def modal(self, context, event):
scn = context.scene
......
......@@ -39,6 +39,13 @@ class sendFrame(Operator):
bl_label = "Render Current Frame" # display name in the interface.
bl_options = {"REGISTER", "UNDO"} # enable undo for the operator.
@classmethod
def poll(cls, context):
""" ensures operator can execute (if not, returns false) """
if not have_internet():
return False
return True
def modal(self, context, event):
scn = context.scene
......
......@@ -28,6 +28,20 @@ import os
import subprocess
import sys
from .setupServers import *
try:
import httplib
except:
import http.client as httplib
def have_internet():
conn = httplib.HTTPConnection("www.google.com", timeout=5)
try:
conn.request("HEAD", "/")
conn.close()
return True
except:
conn.close()
return False
def getFrames(projectName, archiveFiles=False, frameRange=False):
""" rsync rendered frames from host server to local machine """
......
......@@ -24,7 +24,7 @@ import bpy
import math
from bpy.types import Panel
from bpy.props import *
from ..functions import getRenderStatus
from ..functions import getRenderStatus, have_internet
from ..functions.setupServers import *
class renderOnServersPanel(Panel):
......@@ -40,6 +40,10 @@ class renderOnServersPanel(Panel):
layout = self.layout
scn = context.scene
if not have_internet():
col = layout.column(align=True)
col.label("No internet connection")
imRenderStatus = getRenderStatus("image")
animRenderStatus = getRenderStatus("animation")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment