2.5: Render/Game Engine
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 23 Jul 2009 21:50:40 +0000 (21:50 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 23 Jul 2009 21:50:40 +0000 (21:50 +0000)
An engine to use for output can now be selected an influences what
shows in the buttons window, only showing relevant data. The idea
behind this is to make it more clear what is supported where, make
the system more pluggable for external render/game engines, and save
space hiding stuff that is not relevant anyway.

* Top header now has an engine menu, to choose between the blender
  render engine, game engine, and other future external engines.
* If the game engine is enabled, the buttons window should show
  only properties that work in the game engine, and similarly for
  the render engine.
* Moved panels from the logic space and game tabs to the physics,
  scene and world tabs instead, and removed the game tab.
* Materials and textures tabs should eventually become game
  specific too, to better show what is supported.

24 files changed:
release/ui/buttons_game.py
release/ui/buttons_physics_cloth.py
release/ui/buttons_physics_field.py
release/ui/buttons_physics_fluid.py
release/ui/buttons_physics_softbody.py
release/ui/buttons_scene.py
release/ui/buttons_world.py
release/ui/space_info.py
release/ui/space_logic.py
source/blender/editors/screen/screen_ops.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/buttons_header.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/SConscript
source/blender/makesrna/intern/SConscript
source/blender/makesrna/intern/rna_render.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_world.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_init_exit.c
source/creator/creator.c

index 5f953b1c8ebb2192250f0461d65c280b0c3af7ad..1a0f6666a479f45ca3f0e25bd0e5b7278dcf8e63 100644 (file)
@@ -1,40 +1,19 @@
 
 import bpy
  
-class GameButtonsPanel(bpy.types.Panel):
+class PhysicsButtonsPanel(bpy.types.Panel):
        __space_type__ = "BUTTONS_WINDOW"
        __region_type__ = "WINDOW"
-       __context__ = "game"
-
-class GAME_PT_context_game(GameButtonsPanel):
-       __idname__ = "GAME_PT_context_game"
-       __no_header__ = True
-
-       def draw(self, context):
-               layout = self.layout
-               ob = context.object
-               game = context.game
-
-               split = layout.split(percentage=0.06)
-               split.itemL(text="", icon="ICON_GAME")
-               split.itemR(game, "name", text="")
-
-class GAME_PT_data(GameButtonsPanel):
-       __idname__ = "GAME_PT_data"
-       __label__ = "Data"
-
-       def draw(self, context):
-               layout = self.layout
-               ob = context.object
-               game = context.game
-
-class GAME_PT_physics(GameButtonsPanel):
-       __idname__ = "GAME_PT_physics"
-       __label__ = "Physics"
+       __context__ = "physics"
 
        def poll(self, context):
                ob = context.active_object
-               return ob and ob.game
+               rd = context.scene.render_data
+               return ob and ob.game and (rd.engine == 'BLENDER_GAME')
+
+class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
+       __idname__ = "PHYSICS_PT_game_physics"
+       __label__ = "Physics"
 
        def draw(self, context):
                layout = self.layout
@@ -97,15 +76,10 @@ class GAME_PT_physics(GameButtonsPanel):
                sub.itemR(game, "lock_y_rot_axis", text="Y")
                sub.itemR(game, "lock_z_rot_axis", text="Z")
 
-
-class GAME_PT_collision_bounds(GameButtonsPanel):
-       __idname__ = "GAME_PT_collision_bounds"
+class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
+       __idname__ = "PHYSICS_PT_game_collision_bounds"
        __label__ = "Collision Bounds"
 
-       def poll(self, context):
-               ob = context.active_object
-               return ob and ob.game
-       
        def draw_header(self, context):
                layout = self.layout
                ob = context.active_object
@@ -130,8 +104,208 @@ class GAME_PT_collision_bounds(GameButtonsPanel):
                sub = split.column()
                sub.itemR(game, "collision_margin", text="Margin", slider=True)
 
+bpy.types.register(PHYSICS_PT_game_physics)
+bpy.types.register(PHYSICS_PT_game_collision_bounds)
+
+class SceneButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "scene"
+
+       def poll(self, context):
+               rd = context.scene.render_data
+               return (rd.engine == 'BLENDER_GAME')
+
+class SCENE_PT_game(SceneButtonsPanel):
+       __label__ = "Game"
+
+       def draw(self, context):
+               layout = self.layout
+               rd = context.scene.render_data
+
+               row = layout.row()
+               row.itemO("view3d.game_start", text="Start")
+               row.itemL()
+
+class SCENE_PT_game_player(SceneButtonsPanel):
+       __label__ = "Player"
+
+       def draw(self, context):
+               layout = self.layout
+               gs = context.scene.game_data
+               row = layout.row()
+               row.itemR(gs, "fullscreen")
+
+               split = layout.split()
+               col = split.column()
+               col.itemL(text="Resolution:")
+               colsub = col.column(align=True)
+               colsub.itemR(gs, "resolution_x", slider=False, text="X")
+               colsub.itemR(gs, "resolution_y", slider=False, text="Y")
+
+               col = split.column()
+               col.itemL(text="Quality:")
+               colsub = col.column(align=True)
+               colsub.itemR(gs, "depth", text="Bit Depth", slider=False)
+               colsub.itemR(gs, "frequency", text="FPS", slider=False)
+
+               # framing:
+               col = layout.column()
+               col.itemL(text="Framing:")
+               col.row().itemR(gs, "framing_type", expand=True)
+
+               colsub = col.column()
+               colsub.itemR(gs, "framing_color", text="")
+
+class SCENE_PT_game_stereo(SceneButtonsPanel):
+       __label__ = "Stereo"
+
+       def draw(self, context):
+               layout = self.layout
+               gs = context.scene.game_data
+
+               # stereo options:
+               col= layout.column()
+               row = col.row()
+               row.itemR(gs, "stereo", expand=True)
+               stereo_mode = gs.stereo
+
+               # stereo:
+               if stereo_mode == 'STEREO':
+                       row = layout.row()
+                       row.itemR(gs, "stereo_mode")
+
+               # dome:
+               if stereo_mode == 'DOME':
+                       row = layout.row()
+                       row.itemR(gs, "dome_mode", text="Dome Type")
+
+                       split=layout.split()
+                       col=split.column()
+                       col.itemR(gs, "dome_angle", slider=True)
+                       col.itemR(gs, "dome_tesselation", text="Tesselation")
+                       col=split.column()
+                       col.itemR(gs, "dome_tilt")
+                       col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+                       col=layout.column()
+                       col.itemR(gs, "dome_text")
+
+bpy.types.register(SCENE_PT_game)
+bpy.types.register(SCENE_PT_game_player)
+bpy.types.register(SCENE_PT_game_stereo)
+
+class WorldButtonsPanel(bpy.types.Panel):
+       __space_type__ = "BUTTONS_WINDOW"
+       __region_type__ = "WINDOW"
+       __context__ = "world"
+
+       def poll(self, context):
+               rd = context.scene.render_data
+               return (rd.engine == 'BLENDER_GAME')
+
+class WORLD_PT_game_context_world(WorldButtonsPanel):
+       __no_header__ = True
+
+       def poll(self, context):
+               rd = context.scene.render_data
+               return (context.scene != None) and (rd.use_game_engine)
+
+       def draw(self, context):
+               layout = self.layout
+               
+               scene = context.scene
+               world = context.world
+               space = context.space_data
+
+               split = layout.split(percentage=0.65)
+
+               if scene:
+                       split.template_ID(scene, "world", new="world.new")
+               elif world:
+                       split.template_ID(space, "pin_id")
+
+class WORLD_PT_game_world(WorldButtonsPanel):
+       __label__ = "World"
+
+       def draw(self, context):
+               layout = self.layout
+               world = context.world
+
+               row = layout.row()
+               row.column().itemR(world, "horizon_color")
+               row.column().itemR(world, "ambient_color")
+
+               layout.itemR(world.mist, "enabled", text="Mist")
+
+               row = layout.column_flow()
+               row.active = world.mist.enabled
+               row.itemR(world.mist, "start")
+               row.itemR(world.mist, "depth")
+
+
+"""
+class WORLD_PT_game(WorldButtonsPanel):
+       __space_type__ = "LOGIC_EDITOR"
+       __region_type__ = "UI"
+       __label__ = "Game Settings"
+
+       def draw(self, context):
+               layout = self.layout
+               world = context.world
+               
+               flow = layout.column_flow()
+               flow.itemR(world, "physics_engine")
+               flow.itemR(world, "physics_gravity")
+               
+               flow.itemR(world, "game_fps")
+               flow.itemR(world, "game_logic_step_max")
+               flow.itemR(world, "game_physics_substep")
+               flow.itemR(world, "game_physics_step_max")
+               
+               flow.itemR(world, "game_use_occlusion_culling", text="Enable Occlusion Culling")
+               flow.itemR(world, "game_occlusion_culling_resolution")
+"""
+
+class WORLD_PT_game_physics(WorldButtonsPanel):
+       __label__ = "Physics"
+       def draw(self, context):
+               layout = self.layout
+               gs = context.scene.game_data
+               flow = layout.column_flow()
+               flow.itemR(gs, "physics_engine")
+               if gs.physics_engine != "NONE":
+                       flow.itemR(gs, "physics_gravity", text="Gravity")
+                       split = layout.split()
+                       col = split.column()
+                       col.itemL(text="Physics Steps:")
+                       colsub = col.column(align=True)
+                       colsub.itemR(gs, "physics_step_max", text="Max")
+                       colsub.itemR(gs, "physics_step_sub", text="Substeps")
+                       col.itemR(gs, "fps", text="FPS")
+                       
+                       col = split.column()
+                       col.itemL(text="Logic Steps:")
+                       col.itemR(gs, "logic_step_max", text="Max")
+                       col.itemS()
+                       col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
+                       colsub = col.column()
+                       colsub.active = gs.use_occlusion_culling
+                       colsub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
+                       
+
+               else:
+                       split = layout.split()
+                       col = split.column()
+                       col.itemL(text="Physics Steps:")
+                       col.itemR(gs, "fps", text="FPS")
+                       col = split.column()
+                       col.itemL(text="Logic Steps:")
+                       col.itemR(gs, "logic_step_max", text="Max")
+
+bpy.types.register(WORLD_PT_game_context_world)
+bpy.types.register(WORLD_PT_game_world)
+bpy.types.register(WORLD_PT_game_physics)
 
-bpy.types.register(GAME_PT_context_game)
-bpy.types.register(GAME_PT_data)
-bpy.types.register(GAME_PT_physics)
-bpy.types.register(GAME_PT_collision_bounds)
\ No newline at end of file
index 08911b0195c3544dc4843d4b0fc4cb3288f1a650..dcfa1a331e5f3e8cdc87986d49b09bcad6acb874 100644 (file)
@@ -8,7 +8,8 @@ class PhysicButtonsPanel(bpy.types.Panel):
 
        def poll(self, context):
                ob = context.object
-               return (ob and ob.type == 'MESH')
+               rd = context.scene.render_data
+               return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
                
 class PHYSICS_PT_cloth(PhysicButtonsPanel):
        __idname__ = "PHYSICS_PT_cloth"
index cdb90c95228f7701e80aa138560518cf364d31ca..7df14b3eef95c02c3582bc7127b7982105558972 100644 (file)
@@ -7,7 +7,8 @@ class PhysicButtonsPanel(bpy.types.Panel):
        __context__ = "physics"
 
        def poll(self, context):
-               return (context.object != None)
+               rd = context.scene.render_data
+               return (context.object != None) and (not rd.use_game_engine)
                
 class PHYSICS_PT_field(PhysicButtonsPanel):
        __idname__ = "PHYSICS_PT_field"
@@ -171,7 +172,8 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
        
        def poll(self, context):
                ob = context.object
-               return (ob and ob.type == 'MESH')
+               rd = context.scene.render_data
+               return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
 
        def draw_header(self, context):
                settings = context.object.collision
@@ -213,4 +215,4 @@ class PHYSICS_PT_collision(PhysicButtonsPanel):
                col.itemR(settings, "damping", text="Factor", slider=True)
                
 bpy.types.register(PHYSICS_PT_field)
-bpy.types.register(PHYSICS_PT_collision)
\ No newline at end of file
+bpy.types.register(PHYSICS_PT_collision)
index 8cec90f41ba00a4dbe8863aa1465ccd111a3a861..f25aa117c74eaaa82954f48f5f1b54424fe4c4b1 100644 (file)
@@ -8,7 +8,8 @@ class PhysicButtonsPanel(bpy.types.Panel):
 
        def poll(self, context):
                ob = context.object
-               return (ob and ob.type == 'MESH')
+               rd = context.scene.render_data
+               return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
                
 class PHYSICS_PT_fluid(PhysicButtonsPanel):
        __idname__ = "PHYSICS_PT_fluid"
@@ -266,4 +267,4 @@ class PHYSICS_PT_domain_particles(PhysicButtonsPanel):
 bpy.types.register(PHYSICS_PT_fluid)
 bpy.types.register(PHYSICS_PT_domain_gravity)
 bpy.types.register(PHYSICS_PT_domain_boundary)
-bpy.types.register(PHYSICS_PT_domain_particles)
\ No newline at end of file
+bpy.types.register(PHYSICS_PT_domain_particles)
index 836c557257e35bd13294544b2288dbb8dd1a5614..fbcc1be3f012fa4c007e0df1c67947538a268f2a 100644 (file)
@@ -8,7 +8,8 @@ class PhysicButtonsPanel(bpy.types.Panel):
 
        def poll(self, context):
                ob = context.object
-               return (ob and ob.type == 'MESH')
+               rd = context.scene.render_data
+               return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
                
 class PHYSICS_PT_softbody(PhysicButtonsPanel):
        __idname__ = "PHYSICS_PT_softbody"
index db38a74d80b54923afa677a59104b4c6300ffedb..8b6bcb98e06ce77c5ff3ffd35ba9734dbc91eb15 100644 (file)
@@ -6,7 +6,11 @@ class RenderButtonsPanel(bpy.types.Panel):
        __region_type__ = "WINDOW"
        __context__ = "scene"
 
-class RENDER_PT_render(RenderButtonsPanel):
+       def poll(self, context):
+               rd = context.scene.render_data
+               return (not rd.use_game_engine)
+
+class SCENE_PT_render(RenderButtonsPanel):
        __label__ = "Render"
 
        def draw(self, context):
@@ -15,13 +19,11 @@ class RENDER_PT_render(RenderButtonsPanel):
 
                row = layout.row()
                row.itemO("screen.render", text="Image", icon='ICON_IMAGE_COL')
-               row.item_booleanO("screen.render", "anim", True, text="Animation", icon='ICON_SEQUENCE')
+               row.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_SEQUENCE')
 
                layout.itemR(rd, "display_mode", text="Display")
-               if rd.multiple_engines:
-                       layout.itemR(rd, "engine")
 
-class RENDER_PT_layers(RenderButtonsPanel):
+class SCENE_PT_layers(RenderButtonsPanel):
        __label__ = "Layers"
        __default_closed__ = True
 
@@ -107,7 +109,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
                row.itemR(rl, "pass_refraction")
                row.itemR(rl, "pass_refraction_exclude", text="", icon="ICON_X")
 
-class RENDER_PT_shading(RenderButtonsPanel):
+class SCENE_PT_shading(RenderButtonsPanel):
        __label__ = "Shading"
 
        def draw(self, context):
@@ -127,7 +129,7 @@ class RENDER_PT_shading(RenderButtonsPanel):
                col.itemR(rd, "color_management")
                col.itemR(rd, "alpha_mode", text="Alpha")
 
-class RENDER_PT_performance(RenderButtonsPanel):
+class SCENE_PT_performance(RenderButtonsPanel):
        __label__ = "Performance"
        __default_closed__ = True
 
@@ -169,7 +171,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
                row.itemR(rd, "octree_resolution", text="Ray Tracing Octree")
 
 
-class RENDER_PT_post_processing(RenderButtonsPanel):
+class SCENE_PT_post_processing(RenderButtonsPanel):
        __label__ = "Post Processing"
        __default_closed__ = True
 
@@ -197,7 +199,7 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
                split.itemL()
                split.itemR(rd, "dither_intensity", text="Dither", slider=True)
                
-class RENDER_PT_output(RenderButtonsPanel):
+class SCENE_PT_output(RenderButtonsPanel):
        __label__ = "Output"
 
        def draw(self, context):
@@ -258,7 +260,7 @@ class RENDER_PT_output(RenderButtonsPanel):
                        split = layout.split()
                        split.itemR(rd, "tiff_bit")
 
-class RENDER_PT_encoding(RenderButtonsPanel):
+class SCENE_PT_encoding(RenderButtonsPanel):
        __label__ = "Encoding"
        __default_closed__ = True
        
@@ -305,7 +307,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
                col = split.column()
                col.itemR(rd, "ffmpeg_multiplex_audio")
 
-class RENDER_PT_antialiasing(RenderButtonsPanel):
+class SCENE_PT_antialiasing(RenderButtonsPanel):
        __label__ = "Anti-Aliasing"
 
        def draw_header(self, context):
@@ -330,7 +332,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
                col.itemR(rd, "pixel_filter", text="")
                col.itemR(rd, "filter_size", text="Size", slider=True)
        
-class RENDER_PT_dimensions(RenderButtonsPanel):
+class SCENE_PT_dimensions(RenderButtonsPanel):
        __label__ = "Dimensions"
 
        def draw(self, context):
@@ -368,7 +370,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
                col.itemR(rd, "fps")
                col.itemR(rd, "fps_base",text="/")
 
-class RENDER_PT_stamp(RenderButtonsPanel):
+class SCENE_PT_stamp(RenderButtonsPanel):
        __label__ = "Stamp"
        __default_closed__ = True
 
@@ -408,14 +410,14 @@ class RENDER_PT_stamp(RenderButtonsPanel):
                rowsub.active = rd.stamp_note
                rowsub.itemR(rd, "stamp_note_text", text="")
 
-bpy.types.register(RENDER_PT_render)
-bpy.types.register(RENDER_PT_layers)
-bpy.types.register(RENDER_PT_dimensions)
-bpy.types.register(RENDER_PT_antialiasing)
-bpy.types.register(RENDER_PT_shading)
-bpy.types.register(RENDER_PT_output)
-bpy.types.register(RENDER_PT_encoding)
-bpy.types.register(RENDER_PT_performance)
-bpy.types.register(RENDER_PT_post_processing)
-bpy.types.register(RENDER_PT_stamp)
+bpy.types.register(SCENE_PT_render)
+bpy.types.register(SCENE_PT_layers)
+bpy.types.register(SCENE_PT_dimensions)
+bpy.types.register(SCENE_PT_antialiasing)
+bpy.types.register(SCENE_PT_shading)
+bpy.types.register(SCENE_PT_output)
+bpy.types.register(SCENE_PT_encoding)
+bpy.types.register(SCENE_PT_performance)
+bpy.types.register(SCENE_PT_post_processing)
+bpy.types.register(SCENE_PT_stamp)
 
index 6e233f86765214890627f0293f453d4216e711a9..e0305bbaf0424829235d68ebbc7790f7294f1a96 100644 (file)
@@ -7,7 +7,8 @@ class WorldButtonsPanel(bpy.types.Panel):
        __context__ = "world"
 
        def poll(self, context):
-               return (context.world != None)
+               rd = context.scene.render_data
+               return (context.world != None) and (not rd.use_game_engine)
 
 class WORLD_PT_preview(WorldButtonsPanel):
        __label__ = "Preview"
@@ -22,7 +23,8 @@ class WORLD_PT_context_world(WorldButtonsPanel):
        __no_header__ = True
 
        def poll(self, context):
-               return (context.scene != None)
+               rd = context.scene.render_data
+               return (context.scene != None) and (not rd.use_game_engine)
 
        def draw(self, context):
                layout = self.layout
@@ -60,17 +62,6 @@ class WORLD_PT_world(WorldButtonsPanel):
                        col.active = world.blend_sky
                        row.column().itemR(world, "ambient_color")
                
-class WORLD_PT_color_correction(WorldButtonsPanel):
-       __label__ = "Color Correction"
-
-       def draw(self, context):
-               layout = self.layout
-               world = context.world
-
-               row = layout.row()
-               row.itemR(world, "exposure")
-               row.itemR(world, "range")
-       
 class WORLD_PT_mist(WorldButtonsPanel):
        __label__ = "Mist"
 
@@ -91,9 +82,8 @@ class WORLD_PT_mist(WorldButtonsPanel):
                flow.itemR(world.mist, "depth")
                flow.itemR(world.mist, "height")
                flow.itemR(world.mist, "intensity")
-               col = layout.column()
-               col.itemL(text="Fallof:")
-               col.row().itemR(world.mist, "falloff", expand=True)
+
+               layout.itemR(world.mist, "falloff")
                
 class WORLD_PT_stars(WorldButtonsPanel):
        __label__ = "Stars"
@@ -112,9 +102,9 @@ class WORLD_PT_stars(WorldButtonsPanel):
 
                flow = layout.column_flow()
                flow.itemR(world.stars, "size")
+               flow.itemR(world.stars, "color_randomization", text="Colors")
                flow.itemR(world.stars, "min_distance", text="Min. Dist")
                flow.itemR(world.stars, "average_separation", text="Separation")
-               flow.itemR(world.stars, "color_randomization", text="Random")
                
 class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
        __label__ = "Ambient Occlusion"
@@ -132,49 +122,46 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
                layout.active = ao.enabled
                
                layout.itemR(ao, "gather_method", expand=True)
+
+               split = layout.split()
                
+               col = split.column()
+               col.itemL(text="Attenuation:")
+               col.itemR(ao, "distance")
+               col.itemR(ao, "falloff")
+               sub = col.row()
+               sub.active = ao.falloff
+               sub.itemR(ao, "falloff_strength", text="Strength")
+       
                if ao.gather_method == 'RAYTRACE':
-                       split = layout.split()
-                       
                        col = split.column()
-                       col.itemR(ao, "samples")
-                       col.itemR(ao, "distance")
                        
-                       col = split.column()
-                       col.itemR(ao, "falloff")
-                       colsub = col.column()
-                       colsub.active = ao.falloff
-                       colsub.itemR(ao, "strength")
-                       
-                       layout.itemR(ao, "sample_method")
+                       col.itemL(text="Sampling:")
+                       col.itemR(ao, "sample_method", text="")
+
+                       sub = col.column(align=True)
+                       sub.itemR(ao, "samples")
+
                        if ao.sample_method == 'ADAPTIVE_QMC':
-                               row = layout.row()
-                               row.itemR(ao, "threshold")
-                               row.itemR(ao, "adapt_to_speed")
-                               
-                       if ao.sample_method == 'CONSTANT_JITTERED':
-                               row = layout.row()
-                               row.itemR(ao, "bias")
+                               sub.itemR(ao, "threshold")
+                               sub.itemR(ao, "adapt_to_speed")
+                       elif ao.sample_method == 'CONSTANT_JITTERED':
+                               sub.itemR(ao, "bias")
                                                
                if ao.gather_method == 'APPROXIMATE':
-                       split = layout.split()
-                       
                        col = split.column()
-                       col.itemR(ao, "passes")
+                       
+                       col.itemL(text="Sampling:")
                        col.itemR(ao, "error_tolerance", text="Error")
+                       col.itemR(ao, "pixel_cache")
                        col.itemR(ao, "correction")
                        
-                       col = split.column() 
-                       col.itemR(ao, "falloff")
-                       colsub = col.column()
-                       colsub.active = ao.falloff
-                       colsub.itemR(ao, "strength")
-                       col.itemR(ao, "pixel_cache")
-
-               col = layout.column()
-               col.row().itemR(ao, "blend_mode", expand=True)
-               col.row().itemR(ao, "color", expand=True)
-               col.itemR(ao, "energy")
+               col = layout.column(align=True)
+               col.itemL(text="Influence:")
+               row = col.row()
+               row.itemR(ao, "blend_mode", text="")
+               row.itemR(ao, "color", text="")
+               row.itemR(ao, "energy", text="")
 
 bpy.types.register(WORLD_PT_context_world)     
 bpy.types.register(WORLD_PT_preview)
@@ -182,4 +169,4 @@ bpy.types.register(WORLD_PT_world)
 bpy.types.register(WORLD_PT_ambient_occlusion)
 bpy.types.register(WORLD_PT_mist)
 bpy.types.register(WORLD_PT_stars)
-bpy.types.register(WORLD_PT_color_correction)
+
index 96494ccdb143f5cf98a446c17443c5ee55003985..5f6d87c9a29afc072c212f10f61438b00c145519 100644 (file)
@@ -16,13 +16,18 @@ class INFO_HT_header(bpy.types.Header):
                        row = layout.row()
                        row.itemM("INFO_MT_file")
                        row.itemM("INFO_MT_add")
-                       row.itemM("INFO_MT_game")
-                       row.itemM("INFO_MT_render")
+                       if rd.use_game_engine:
+                               row.itemM("INFO_MT_game")
+                       else:
+                               row.itemM("INFO_MT_render")
                        row.itemM("INFO_MT_help")
 
                layout.template_ID(context.window, "screen") #, new="screen.new", open="scene.unlink")
                layout.template_ID(context.screen, "scene") #, new="screen.new", unlink="scene.unlink")
 
+               if rd.multiple_engines:
+                       layout.itemR(rd, "engine", text="")
+
                layout.itemS()
 
                layout.template_operator_search()
index b19351bf7792f4b128f13fe621130b2cb5dd677d..728e5e6307b4bb1b1fe5d6a2fd09c637ad72033c 100644 (file)
@@ -21,142 +21,5 @@ class LOGIC_PT_properties(bpy.types.Panel):
                        flow.itemR(prop, "value", text="") # we dont care about the type. rna will display correctly
                        flow.itemR(prop, "debug")
 
-"""
-class WORLD_PT_game(WorldButtonsPanel):
-       __space_type__ = "LOGIC_EDITOR"
-       __region_type__ = "UI"
-       __label__ = "Game Settings"
-
-       def draw(self, context):
-               layout = self.layout
-               world = context.world
-               
-               flow = layout.column_flow()
-               flow.itemR(world, "physics_engine")
-               flow.itemR(world, "physics_gravity")
-               
-               flow.itemR(world, "game_fps")
-               flow.itemR(world, "game_logic_step_max")
-               flow.itemR(world, "game_physics_substep")
-               flow.itemR(world, "game_physics_step_max")
-               
-               flow.itemR(world, "game_use_occlusion_culling", text="Enable Occlusion Culling")
-               flow.itemR(world, "game_occlusion_culling_resolution")
-"""
-class LOGIC_PT_player(bpy.types.Panel):
-       __space_type__ = "LOGIC_EDITOR"
-       __region_type__ = "UI"
-       __label__ = "Player"
-
-       def draw(self, context):
-               layout = self.layout
-               gs = context.scene.game_data
-               row = layout.row()
-               row.itemR(gs, "fullscreen")
-
-               split = layout.split()
-               col = split.column()
-               col.itemL(text="Resolution:")
-               colsub = col.column(align=True)
-               colsub.itemR(gs, "resolution_x", slider=False, text="X")
-               colsub.itemR(gs, "resolution_y", slider=False, text="Y")
-
-               col = split.column()
-               col.itemL(text="Quality:")
-               colsub = col.column(align=True)
-               colsub.itemR(gs, "depth", text="Bit Depth", slider=False)
-               colsub.itemR(gs, "frequency", text="FPS", slider=False)
-               
-
-               # framing:
-               col = layout.column()
-               col.itemL(text="Framing:")
-               col.row().itemR(gs, "framing_type", expand=True)
-
-               colsub = col.column()
-               colsub.itemR(gs, "framing_color", text="")
-
-class LOGIC_PT_stereo(bpy.types.Panel):
-       __space_type__ = "LOGIC_EDITOR"
-       __region_type__ = "UI"
-       __label__ = "Stereo"
-
-       def draw(self, context):
-               layout = self.layout
-               gs = context.scene.game_data
-
-
-               # stereo options:
-               col= layout.column()
-               row = col.row()
-               row.itemR(gs, "stereo", expand=True)
-               stereo_mode = gs.stereo
-
-               # stereo:
-               if stereo_mode == 'STEREO':
-
-                       row = layout.row()
-                       row.itemR(gs, "stereo_mode")
-
-               # dome:
-               if stereo_mode == 'DOME':
-                       row = layout.row()
-                       row.itemR(gs, "dome_mode", text="Dome Type")
-
-                       split=layout.split()
-                       col=split.column()
-                       col.itemR(gs, "dome_angle", slider=True)
-                       col.itemR(gs, "dome_tesselation", text="Tesselation")
-                       col=split.column()
-                       col.itemR(gs, "dome_tilt")
-                       col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
-                       col=layout.column()
-                       col.itemR(gs, "dome_text")
-
-
-class LOGIC_PT_physics(bpy.types.Panel):
-       __space_type__ = "LOGIC_EDITOR"
-       __region_type__ = "UI"
-       __label__ = "World Physics"
-       def draw(self, context):
-               layout = self.layout
-               gs = context.scene.game_data
-               flow = layout.column_flow()
-               flow.itemR(gs, "physics_engine")
-               if gs.physics_engine != "NONE":
-                       flow.itemR(gs, "physics_gravity", text="Gravity")
-                       split = layout.split()
-                       col = split.column()
-                       col.itemL(text="Physics Steps:")
-                       colsub = col.column(align=True)
-                       colsub.itemR(gs, "physics_step_max", text="Max")
-                       colsub.itemR(gs, "physics_step_sub", text="Substeps")
-                       col.itemR(gs, "fps", text="FPS")
-                       
-                       col = split.column()
-                       col.itemL(text="Logic Steps:")
-                       col.itemR(gs, "logic_step_max", text="Max")
-                       col.itemS()
-                       col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
-                       colsub = col.column()
-                       colsub.active = gs.use_occlusion_culling
-                       colsub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
-                       
-
-               else:
-                       split = layout.split()
-                       col = split.column()
-                       col.itemL(text="Physics Steps:")
-                       col.itemR(gs, "fps", text="FPS")
-                       col = split.column()
-                       col.itemL(text="Logic Steps:")
-                       col.itemR(gs, "logic_step_max", text="Max")
-
 bpy.types.register(LOGIC_PT_properties)
-bpy.types.register(LOGIC_PT_player)
-bpy.types.register(LOGIC_PT_stereo)
-bpy.types.register(LOGIC_PT_physics)
\ No newline at end of file
+
index 3032bff18df07f8d2bd9286906a4cebc85d372cc..dc46940a7335b4f0ea733e8ae7ea242a3db6f4e3 100644 (file)
@@ -2437,7 +2437,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
        }
        RE_test_break_cb(re, NULL, (int (*)(void *)) blender_test_break);
        
-       if(RNA_boolean_get(op->ptr, "anim"))
+       if(RNA_boolean_get(op->ptr, "animation"))
                RE_BlenderAnim(re, scene, scene->r.sfra, scene->r.efra, scene->frame_step);
        else
                RE_BlenderFrame(re, scene, scene->r.cfra);
@@ -2716,7 +2716,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
        rj= MEM_callocN(sizeof(RenderJob), "render job");
        rj->scene= scene;
        rj->win= CTX_wm_window(C);
-       rj->anim= RNA_boolean_get(op->ptr, "anim");
+       rj->anim= RNA_boolean_get(op->ptr, "animation");
        rj->iuser.scene= scene;
        rj->iuser.ok= 1;
        
@@ -2772,7 +2772,7 @@ void SCREEN_OT_render(wmOperatorType *ot)
        ot->poll= ED_operator_screenactive;
        
        RNA_def_int(ot->srna, "layers", 0, 0, INT_MAX, "Layers", "", 0, INT_MAX);
-       RNA_def_boolean(ot->srna, "anim", 0, "Animation", "");
+       RNA_def_boolean(ot->srna, "animation", 0, "Animation", "");
 }
 
 /* *********************** cancel render viewer *************** */
@@ -2977,6 +2977,7 @@ void ED_keymap_screen(wmWindowManager *wm)
                                                  
        /* render */
        WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0);
+       RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, KM_CTRL, 0)->ptr, "animation", 1);
        WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0);
        WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0);
        
index 9048565b01f9bac874f4bd8c4c5774fc83c89354..1ebab105086d04dc6e7a8a057e3da8608ef1e460 100644 (file)
@@ -360,32 +360,7 @@ static int buttons_context_path_texture(ButsContextPath *path)
        return 0;
 }
 
-static int buttons_context_path_game(ButsContextPath *path)
-{
-       /* XXX temporary context. Using material slot instead of ob->game_data */
-       Object *ob;
-       PointerRNA *ptr= &path->ptr[path->len-1];
-       Material *ma;
-
-       /* if we already have a (pinned) material, we're done */
-       if(RNA_struct_is_a(ptr->type, &RNA_Material)) {
-               return 1;
-       }
-       /* if we have an object, use the object material slot */
-       else if(buttons_context_path_object(path)) {
-               ob= path->ptr[path->len-1].data;
 
-               if(ob && ob->type && (ob->type<OB_LAMP)) {
-                       ma= give_current_material(ob, ob->actcol);
-                       RNA_id_pointer_create(&ma->id, &path->ptr[path->len]);
-                       path->len++;
-                       return 1;
-               }
-       }
-
-       /* no path to a material possible */
-       return 0;
-}
 static int buttons_context_path(const bContext *C, ButsContextPath *path, int mainb, int worldtex)
 {
        SpaceButs *sbuts= (SpaceButs*)CTX_wm_space_data(C);
@@ -430,9 +405,6 @@ static int buttons_context_path(const bContext *C, ButsContextPath *path, int ma
                case BCONTEXT_DATA:
                        found= buttons_context_path_data(path, -1);
                        break;
-               case BCONTEXT_GAME:
-                       found= buttons_context_path_game(path);
-                       break;
                case BCONTEXT_PARTICLE:
                        found= buttons_context_path_particle(path);
                        break;
@@ -526,7 +498,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
        if(CTX_data_dir(member)) {
                static const char *dir[] = {
                        "world", "object", "mesh", "armature", "lattice", "curve",
-                       "meta_ball", "lamp", "camera", "material", "material_slot", "game",
+                       "meta_ball", "lamp", "camera", "material", "material_slot",
                        "texture", "texture_slot", "bone", "edit_bone", "particle_system",
                        "cloth", "soft_body", "fluid", "collision", NULL};
 
index 0fb00b2780b4ebfdc38c51bce0eb23c20892818e..0f6ef6fe5701fc3d4038b7b041945eb76334ba8e 100644 (file)
@@ -124,8 +124,6 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
                uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_PARTICLES, xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_PARTICLE, 0, 0, "Particles");
        if(sbuts->pathflag & (1<<BCONTEXT_PHYSICS))
                uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_PHYSICS,   xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_PHYSICS, 0, 0, "Physics");
-       if(sbuts->pathflag & (1<<BCONTEXT_GAME))
-               uiDefIconButS(block, ROW, B_CONTEXT_SWITCH,     ICON_GAME,      xco+=BUTS_UI_UNIT, yco, BUTS_UI_UNIT, BUTS_UI_UNIT, &(sbuts->mainb), 0.0, (float)BCONTEXT_GAME, 0, 0, "Game");
        xco+= BUTS_UI_UNIT;
        
        uiBlockEndAlign(block);
index 05d181ba33008794e234f8b70092d74c148e603d..8284744d5196035facf7177166051500f5cb8425 100644 (file)
@@ -177,8 +177,6 @@ static void buttons_main_area_draw(const bContext *C, ARegion *ar)
                ED_region_panels(C, ar, vertical, "modifier");
        else if (sbuts->mainb == BCONTEXT_CONSTRAINT)
                ED_region_panels(C, ar, vertical, "constraint");
-       else if (sbuts->mainb == BCONTEXT_GAME)
-               ED_region_panels(C, ar, vertical, "game");
 
     sbuts->re_align= 0;
        sbuts->mainbo= sbuts->mainb;
index 6193108570737fe56f2e7b5ce0f460b6833ab499..34a5efbdf5f88be12ecd542d01d821ea7cb23f54 100644 (file)
@@ -580,7 +580,6 @@ typedef struct SpaceConsole {
 #define BCONTEXT_TEXTURE       5
 #define BCONTEXT_PARTICLE      6
 #define BCONTEXT_PHYSICS       7
-#define BCONTEXT_GAME          8
 #define BCONTEXT_BONE          9
 #define BCONTEXT_MODIFIER      10
 #define BCONTEXT_CONSTRAINT 12
index 3b47eeca59d47647d518be239acef8c1159a4ce2..80abd4fda61476e491550aef5a71bf45b1c5a6f8 100644 (file)
@@ -34,4 +34,7 @@ if env['WITH_BF_QUICKTIME']:
 if env['WITH_BF_LCMS']:
        defs.append('WITH_LCMS')
 
+if env['WITH_BF_GAMEENGINE']:
+       defs.append('GAMEBLENDER=1')
+
 env.BlenderLib ( 'bf_rna', objs, Split(incs), defines=defs, libtype=['core'], priority = [195] )
index a4f184a3f67bc0ea7ec55999ea8786e8c088fc22..6c8038bd509da53684a9b5b90af92c60182f8a54 100644 (file)
@@ -56,6 +56,9 @@ if env['WITH_BF_QUICKTIME']:
 if env['WITH_BF_LCMS']:
        defs.append('WITH_LCMS')
 
+if env['WITH_BF_GAMEENGINE']:
+       defs.append('GAMEBLENDER=1')
+
 makesrna_tool.Append(CPPDEFINES=defs)
 
 makesrna_tool.Append (CPPPATH = Split(incs))
index 774eecba0f1ed3bcdd0e4bbd7f6a6113008a82ea..89c4823035737829c5f7b9838b30ae7dce642274 100644 (file)
 
 /* RenderEngine */
 
+static RenderEngineType internal_render_type = {
+       NULL, NULL, "BLENDER_RENDER", "Blender Render", RE_INTERNAL, NULL, {NULL, NULL, NULL, NULL}};
+#if GAMEBLENDER == 1
+static RenderEngineType internal_game_type = {
+       NULL, NULL, "BLENDER_GAME", "Blender Game", RE_INTERNAL|RE_GAME, NULL, {NULL, NULL, NULL, NULL}};
+#endif
+
+ListBase R_engines = {NULL, NULL};
+
+void RE_engines_init()
+{
+       BLI_addtail(&R_engines, &internal_render_type);
+#if GAMEBLENDER == 1
+       BLI_addtail(&R_engines, &internal_game_type);
+#endif
+}
+
+void RE_engines_exit()
+{
+       RenderEngineType *type, *next;
+
+       for(type=R_engines.first; type; type=next) {
+               next= type->next;
+
+               BLI_remlink(&R_engines, type);
+
+               if(!(type->flag & RE_INTERNAL)) {
+                       if(type->ext.free)
+                               type->ext.free(type->ext.data);
+
+                       MEM_freeN(type);
+               }
+       }
+}
+
 static void engine_render(RenderEngine *engine, struct Scene *scene)
 {
        PointerRNA ptr;
index bd23fc9e1f6ac2bf0f478757a2912fa34b1f9c38..aa4c410bc73c5dac5d94bad272cef63cd063a6fb 100644 (file)
@@ -232,6 +232,18 @@ static int rna_SceneRenderData_multiple_engines_get(PointerRNA *ptr)
        return (BLI_countlist(&R_engines) > 1);
 }
 
+static int rna_SceneRenderData_use_game_engine_get(PointerRNA *ptr)
+{
+       RenderData *rd= (RenderData*)ptr->data;
+       RenderEngineType *type;
+
+       for(type=R_engines.first; type; type=type->next)
+               if(strcmp(type->idname, rd->engine) == 0)
+                       return (type->flag & RE_GAME);
+       
+       return 0;
+}
+
 static void rna_SceneRenderLayer_layer_set(PointerRNA *ptr, const int *values)
 {
        SceneRenderLayer *rl= (SceneRenderLayer*)ptr->data;
@@ -1579,11 +1591,17 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
        RNA_def_property_enum_items(prop, engine_items);
        RNA_def_property_enum_funcs(prop, "rna_SceneRenderData_engine_get", "rna_SceneRenderData_engine_set", "rna_SceneRenderData_engine_itemf");
        RNA_def_property_ui_text(prop, "Engine", "Engine to use for rendering.");
+       RNA_def_property_update(prop, NC_WINDOW, NULL);
 
        prop= RNA_def_property(srna, "multiple_engines", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_multiple_engines_get", NULL);
        RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-       RNA_def_property_ui_text(prop, "Multiple Engine", "More than one rendering engine is available.");
+       RNA_def_property_ui_text(prop, "Multiple Engines", "More than one rendering engine is available.");
+
+       prop= RNA_def_property(srna, "use_game_engine", PROP_BOOLEAN, PROP_NONE);
+       RNA_def_property_boolean_funcs(prop, "rna_SceneRenderData_use_game_engine_get", NULL);
+       RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+       RNA_def_property_ui_text(prop, "Use Game Engine", "Current rendering engine is a game engine.");
 }
 
 void RNA_def_scene(BlenderRNA *brna)
index 461c46e09bfda4928c3edab1ca400f1f3fb2369a..2231a59e7702f152a1f6434648c4d8f30f2fb2db 100644 (file)
@@ -239,6 +239,20 @@ StructRNA *rna_SpaceButtonsWindow_pin_id_typef(PointerRNA *ptr)
        return &RNA_ID;
 }
 
+void rna_SpaceButtonsWindow_align_set(PointerRNA *ptr, int value)
+{
+       SpaceButs *sbuts= (SpaceButs*)(ptr->data);
+       bScreen *sc= (bScreen*)(ptr->id.data);
+       ScrArea *sa;
+
+       sbuts->align= value;
+       sbuts->re_align= 1;
+
+       for(sa=sc->areabase.first; sa; sa=sa->next)
+               if(BLI_findindex(&sa->spacedata, sbuts) != -1)
+                       ED_area_tag_redraw(sa);
+}
+
 /* Space Console */
 static void rna_ConsoleLine_line_get(PointerRNA *ptr, char *value)
 {
@@ -658,12 +672,11 @@ static void rna_def_space_buttons(BlenderRNA *brna)
                {BCONTEXT_TEXTURE, "TEXTURE", ICON_TEXTURE, "Texture", "Texture"},
                {BCONTEXT_PARTICLE, "PARTICLE", ICON_PARTICLES, "Particle", "Particle"},
                {BCONTEXT_PHYSICS, "PHYSICS", ICON_PHYSICS, "Physics", "Physics"},
-               {BCONTEXT_GAME, "GAME", ICON_GAME, "Game", "Game"},
                {0, NULL, 0, NULL, NULL}};
                
-       static EnumPropertyItem panel_alignment_items[] = {
-               {1, "HORIZONTAL", 0, "Horizontal", ""},
-               {2, "VERTICAL", 0, "Vertical", ""},
+       static EnumPropertyItem align_items[] = {
+               {BUT_HORIZONTAL, "HORIZONTAL", 0, "Horizontal", ""},
+               {BUT_VERTICAL, "VERTICAL", 0, "Vertical", ""},
                {0, NULL, 0, NULL, NULL}};
                
        srna= RNA_def_struct(brna, "SpaceButtonsWindow", "Space");
@@ -676,10 +689,11 @@ static void rna_def_space_buttons(BlenderRNA *brna)
        RNA_def_property_ui_text(prop, "Buttons Context", "The type of active data to display and edit in the buttons window");
        RNA_def_property_update(prop, NC_WINDOW, NULL);
        
-       prop= RNA_def_property(srna, "panel_alignment", PROP_ENUM, PROP_NONE);
+       prop= RNA_def_property(srna, "align", PROP_ENUM, PROP_NONE);
        RNA_def_property_enum_sdna(prop, NULL, "align");
-       RNA_def_property_enum_items(prop, panel_alignment_items);
-       RNA_def_property_ui_text(prop, "Panel Alignment", "Arrangement of the panels within the buttons window");
+       RNA_def_property_enum_items(prop, align_items);
+       RNA_def_property_enum_funcs(prop, NULL, "rna_SpaceButtonsWindow_align_set", NULL);
+       RNA_def_property_ui_text(prop, "Align", "Arrangement of the panels within the buttons window");
        RNA_def_property_update(prop, NC_WINDOW, NULL);
 
        /* pinned data */
index c41c0a0fcef8d65ef39f42660a0414418dd3ea82..8beaa855201121d98f7ed678c8ee3188d4cba60f 100644 (file)
@@ -218,7 +218,7 @@ static void rna_def_ambient_occlusion(BlenderRNA *brna)
        RNA_def_property_float_sdna(prop, NULL, "aodist");
        RNA_def_property_ui_text(prop, "Distance", "Length of rays, defines how far away other faces give occlusion effect.");
 
-       prop= RNA_def_property(srna, "strength", PROP_FLOAT, PROP_NONE);
+       prop= RNA_def_property(srna, "falloff_strength", PROP_FLOAT, PROP_NONE);
        RNA_def_property_float_sdna(prop, NULL, "aodistfac");
        RNA_def_property_ui_text(prop, "Strength", "Distance attenuation factor, the higher, the 'shorter' the shadows.");
 
index 643a381c54f4b20094da6bf02a35133f98a54a1c..d96054f5a766b35c4a5096eb3a1463144f08191d 100644 (file)
@@ -240,6 +240,8 @@ struct Scene *RE_GetScene(struct Render *re);
 
 /* External Engine */
 
+#define RE_INTERNAL            1
+#define RE_GAME                        2
 
 extern ListBase R_engines;
 
@@ -249,6 +251,7 @@ typedef struct RenderEngineType {
        /* type info */
        char idname[32];
        char name[32];
+       int flag;
 
        void (*render)(struct RenderEngine *engine, struct Scene *scene);
 
@@ -269,7 +272,8 @@ void RE_engine_end_result(RenderEngine *engine, struct RenderResult *result);
 int RE_engine_test_break(RenderEngine *engine);
 void RE_engine_update_stats(RenderEngine *engine, char *stats, char *info);
 
-void RE_engines_free(void);
+void RE_engines_init(void);
+void RE_engines_exit(void);
 
 #endif /* RE_PIPELINE_H */
 
index 801a9729277d91364465f22aeb64c32595a17034..3e50ea92846e25cb68a370e6de1df6fa9cf81533 100644 (file)
@@ -2783,12 +2783,6 @@ void RE_init_threadcount(Render *re)
 
 /************************** External Engines ***************************/
 
-static RenderEngineType internal_engine_type = {
-       NULL, NULL, "BlenderRenderEngine", "Blender", NULL,
-       NULL, NULL, NULL, NULL};
-
-ListBase R_engines = {&internal_engine_type, &internal_engine_type};
-
 RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w, int h)
 {
        Render *re= engine->re;
@@ -2924,19 +2918,3 @@ static void external_render_3d(Render *re, RenderEngineType *type)
        }
 }
 
-void RE_engines_free()
-{
-       RenderEngineType *type, *next;
-
-       for(type=R_engines.first; type; type=next) {
-               next= type->next;
-
-               if(type != &internal_engine_type) {
-                       if(type->ext.free)
-                               type->ext.free(type->ext.data);
-
-                       MEM_freeN(type);
-               }
-       }
-}
-
index 3d8efc018c42a3a3b8827d44e0489ab341ba50fb..fd102b663d0a1ddfb41b0b09a3bd029f1a9ccceb 100644 (file)
@@ -239,7 +239,7 @@ void WM_exit(bContext *C)
        BLF_exit();
 
        RE_FreeAllRender();
-       RE_engines_free();
+       RE_engines_exit();
        
 //     free_txt_data();
        
index a3e5ca16a1398372f4d3b3fb99f6cdb455ea750b..9034833563b131197cb998e6c9e984b1b99f504a 100644 (file)
@@ -313,6 +313,7 @@ int main(int argc, char **argv)
        BLI_where_am_i(bprogname, argv[0]);
        
        RNA_init();
+       RE_engines_init();
 
                /* Hack - force inclusion of the plugin api functions,
                 * see blenpluginapi:pluginapi.c