Changeset View
Changeset View
Standalone View
Standalone View
netrender/ui.py
| Show All 29 Lines | |||||
| PATH_PREFIX = "/tmp/" | PATH_PREFIX = "/tmp/" | ||||
| LAST_ADDRESS_TEST = 0 | LAST_ADDRESS_TEST = 0 | ||||
| ADDRESS_TEST_TIMEOUT = 30 | ADDRESS_TEST_TIMEOUT = 30 | ||||
| def base_poll(cls, context): | def base_poll(cls, context): | ||||
| rd = context.scene.render | rd = context.scene.render | ||||
| return (rd.use_game_engine==False) and (rd.engine in cls.COMPAT_ENGINES) | return (rd.engine in cls.COMPAT_ENGINES) | ||||
| def init_file(): | def init_file(): | ||||
| if netrender.init_file != bpy.data.filepath: | if netrender.init_file != bpy.data.filepath: | ||||
| netrender.init_file = bpy.data.filepath | netrender.init_file = bpy.data.filepath | ||||
| netrender.init_data = True | netrender.init_data = True | ||||
| netrender.valid_address = False | netrender.valid_address = False | ||||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | class NetRenderButtonsPanel(): | ||||
| bl_space_type = "PROPERTIES" | bl_space_type = "PROPERTIES" | ||||
| bl_region_type = "WINDOW" | bl_region_type = "WINDOW" | ||||
| bl_context = "render" | bl_context = "render" | ||||
| # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here | # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| rd = context.scene.render | rd = context.scene.render | ||||
| return rd.engine == 'NET_RENDER' and rd.use_game_engine == False | return rd.engine == 'NET_RENDER' | ||||
| # Setting panel, use in the scene for now. | # Setting panel, use in the scene for now. | ||||
| class RENDER_PT_network_settings(NetRenderButtonsPanel, bpy.types.Panel): | class RENDER_PT_network_settings(NetRenderButtonsPanel, bpy.types.Panel): | ||||
| bl_label = "Network Settings" | bl_label = "Network Settings" | ||||
| COMPAT_ENGINES = {'NET_RENDER'} | COMPAT_ENGINES = {'NET_RENDER'} | ||||
| @classmethod | @classmethod | ||||
| def poll(cls, context): | def poll(cls, context): | ||||
| ▲ Show 20 Lines • Show All 519 Lines • Show Last 20 Lines | |||||