Blender V2.61 - r43446
|
00001 # 00002 # Copyright 2011, Blender Foundation. 00003 # 00004 # This program is free software; you can redistribute it and/or 00005 # modify it under the terms of the GNU General Public License 00006 # as published by the Free Software Foundation; either version 2 00007 # of the License, or (at your option) any later version. 00008 # 00009 # This program is distributed in the hope that it will be useful, 00010 # but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 # GNU General Public License for more details. 00013 # 00014 # You should have received a copy of the GNU General Public License 00015 # along with this program; if not, write to the Free Software Foundation, 00016 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 # 00018 00019 # <pep8 compliant> 00020 00021 bl_info = { 00022 "name": "Cycles Render Engine", 00023 "author": "", 00024 "version": (0, 0), 00025 "blender": (2, 6, 0), 00026 "location": "Info header, render engine menu", 00027 "description": "Cycles Render Engine integration.", 00028 "warning": "", 00029 "wiki_url": "http://wiki.blender.org/index.php/Dev:2.6/Source/Render/Cycles", 00030 "tracker_url": "", 00031 "support": 'OFFICIAL', 00032 "category": "Render"} 00033 00034 import bpy 00035 from . import ui, properties, engine, presets 00036 00037 00038 class CyclesRender(bpy.types.RenderEngine): 00039 bl_idname = 'CYCLES' 00040 bl_label = "Cycles Render" 00041 bl_use_shading_nodes = True 00042 00043 def __init__(self): 00044 engine.init() 00045 self.session = None 00046 00047 def __del__(self): 00048 engine.free(self) 00049 00050 # final render 00051 def update(self, data, scene): 00052 engine.create(self, data, scene) 00053 engine.update(self, data, scene) 00054 00055 def render(self, scene): 00056 engine.render(self) 00057 00058 # preview render 00059 # def preview_update(self, context, id): 00060 # pass 00061 # 00062 # def preview_render(self): 00063 # pass 00064 00065 # viewport render 00066 def view_update(self, context): 00067 if not self.session: 00068 engine.create(self, context.blend_data, context.scene, 00069 context.region, context.space_data, context.region_data) 00070 engine.update(self, context.blend_data, context.scene) 00071 00072 def view_draw(self, context): 00073 engine.draw(self, context.region, context.space_data, context.region_data) 00074 00075 00076 def register(): 00077 properties.register() 00078 ui.register() 00079 presets.register() 00080 bpy.utils.register_module(__name__) 00081 00082 00083 def unregister(): 00084 ui.unregister() 00085 properties.unregister() 00086 presets.unregister() 00087 bpy.utils.unregister_module(__name__)