[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21732] branches/blender2.5/blender: BGE panels: wip
Dalai Felinto
dfelinto at gmail.com
Mon Jul 20 22:28:29 CEST 2009
Revision: 21732
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21732
Author: dfelinto
Date: 2009-07-20 22:28:29 +0200 (Mon, 20 Jul 2009)
Log Message:
-----------
BGE panels: wip
Logic Panel:
- world settings (moved from world)
... that includes physic engine selection + gravity
- game player (from gamesettings, it wasn't wrapped)
- stereo/dome (from gamesettings, it wasn't wrapped)
... separated stereom into stereoflag and stereomode
- properties
... (didn't touch it)
Buttons Game Panel:
(wip panel)
- Physics (moved from Logic Panel)
... it will be a datablock in the future (right Campbell ?)
- Material Physics (not currently implemented)
... a datablock link to the materials of an object + the dynamic physic variables
* NOTE:
in readfile.c::do_version I couldn't do if(scene->world). There is something wrong with scenes with an unlinked world. So so far we are ignoring the old values....
Modified Paths:
--------------
branches/blender2.5/blender/release/ui/buttons_world.py
branches/blender2.5/blender/release/ui/space_logic.py
branches/blender2.5/blender/source/blender/blenkernel/intern/scene.c
branches/blender2.5/blender/source/blender/blenkernel/intern/world.c
branches/blender2.5/blender/source/blender/blenloader/intern/readfile.c
branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c
branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_header.c
branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c
branches/blender2.5/blender/source/blender/makesdna/DNA_scene_types.h
branches/blender2.5/blender/source/blender/makesdna/DNA_world_types.h
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_space.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_world.c
branches/blender2.5/blender/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
branches/blender2.5/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
branches/blender2.5/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
branches/blender2.5/blender/source/gameengine/Rasterizer/RAS_OpenGLRasterizer/RAS_OpenGLRasterizer.cpp
Added Paths:
-----------
branches/blender2.5/blender/release/ui/buttons_game.py
Added: branches/blender2.5/blender/release/ui/buttons_game.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_game.py (rev 0)
+++ branches/blender2.5/blender/release/ui/buttons_game.py 2009-07-20 20:28:29 UTC (rev 21732)
@@ -0,0 +1,118 @@
+
+import bpy
+
+class GameButtonsPanel(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"
+
+ def poll(self, context):
+ ob = context.active_object
+ return ob and ob.game
+
+ def draw(self, context):
+ layout = self.layout
+ ob = context.active_object
+
+ game = ob.game
+
+ flow = layout.column_flow()
+ flow.active = True
+ flow.itemR(game, "physics_type")
+ flow.itemR(game, "actor")
+
+ row = layout.row()
+ row.itemR(game, "ghost")
+ row.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+
+ flow = layout.column_flow()
+ flow.itemR(game, "mass")
+ flow.itemR(game, "radius")
+ flow.itemR(game, "no_sleeping")
+ flow.itemR(game, "damping")
+ flow.itemR(game, "rotation_damping")
+ flow.itemR(game, "minimum_velocity")
+ flow.itemR(game, "maximum_velocity")
+
+ row = layout.row()
+ row.itemR(game, "do_fh")
+ row.itemR(game, "rotation_fh")
+
+ flow = layout.column_flow()
+ flow.itemR(game, "form_factor")
+ flow.itemR(game, "anisotropic_friction")
+
+ flow = layout.column_flow()
+ flow.active = game.anisotropic_friction
+ flow.itemR(game, "friction_coefficients")
+
+ split = layout.split()
+ sub = split.column()
+ sub.itemR(game, "lock_x_axis")
+ sub.itemR(game, "lock_y_axis")
+ sub.itemR(game, "lock_z_axis")
+ sub = split.column()
+ sub.itemR(game, "lock_x_rot_axis")
+ sub.itemR(game, "lock_y_rot_axis")
+ sub.itemR(game, "lock_z_rot_axis")
+
+
+class GAME_PT_collision_bounds(GameButtonsPanel):
+ __idname__ = "GAME_PT_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
+ game = ob.game
+
+ layout.itemR(game, "use_collision_bounds", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ ob = context.scene.objects[0]
+ game = ob.game
+
+ flow = layout.column_flow()
+ flow.active = game.use_collision_bounds
+ flow.itemR(game, "collision_bounds")
+ flow.itemR(game, "collision_compound")
+ flow.itemR(game, "collision_margin")
+
+
+
+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
Modified: branches/blender2.5/blender/release/ui/buttons_world.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_world.py 2009-07-20 20:00:59 UTC (rev 21731)
+++ branches/blender2.5/blender/release/ui/buttons_world.py 2009-07-20 20:28:29 UTC (rev 21732)
@@ -175,27 +175,7 @@
col.row().itemR(ao, "blend_mode", expand=True)
col.row().itemR(ao, "color", expand=True)
col.itemR(ao, "energy")
-
-class WORLD_PT_game(WorldButtonsPanel):
- __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")
-
-
bpy.types.register(WORLD_PT_context_world)
bpy.types.register(WORLD_PT_preview)
bpy.types.register(WORLD_PT_world)
@@ -203,4 +183,3 @@
bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars)
bpy.types.register(WORLD_PT_color_correction)
-bpy.types.register(WORLD_PT_game)
Modified: branches/blender2.5/blender/release/ui/space_logic.py
===================================================================
--- branches/blender2.5/blender/release/ui/space_logic.py 2009-07-20 20:00:59 UTC (rev 21731)
+++ branches/blender2.5/blender/release/ui/space_logic.py 2009-07-20 20:28:29 UTC (rev 21732)
@@ -1,9 +1,9 @@
import bpy
-class LOGIC_PT_physics(bpy.types.Panel):
+class LOGIC_PT_properties(bpy.types.Panel):
__space_type__ = "LOGIC_EDITOR"
__region_type__ = "UI"
- __label__ = "Physics"
+ __label__ = "Properties"
def poll(self, context):
ob = context.active_object
@@ -12,100 +12,168 @@
def draw(self, context):
layout = self.layout
ob = context.active_object
+ game = ob.game
- game = ob.game
+ for prop in game.properties:
+ flow = layout.row()
+ flow.itemR(prop, "name", text="")
+ flow.itemR(prop, "type", text="")
+ 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.active = True
- flow.itemR(game, "physics_type")
- flow.itemR(game, "actor")
+ flow.itemR(world, "physics_engine")
+ flow.itemR(world, "physics_gravity")
- row = layout.row()
- row.itemR(game, "ghost")
- row.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+ 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 = layout.column_flow()
- flow.itemR(game, "mass")
- flow.itemR(game, "radius")
- flow.itemR(game, "no_sleeping")
- flow.itemR(game, "damping")
- flow.itemR(game, "rotation_damping")
- flow.itemR(game, "minimum_velocity")
- flow.itemR(game, "maximum_velocity")
-
+ 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__ = "Game Player"
+
+ def draw(self, context):
+ layout = self.layout
+ gs = context.scene.game_data
row = layout.row()
- row.itemR(game, "do_fh")
- row.itemR(game, "rotation_fh")
-
- flow = layout.column_flow()
- flow.itemR(game, "form_factor")
- flow.itemR(game, "anisotropic_friction")
-
- flow = layout.column_flow()
- flow.active = game.anisotropic_friction
- flow.itemR(game, "friction_coefficients")
-
+ row.itemR(gs, "fullscreen")
+
split = layout.split()
- sub = split.column()
- sub.itemR(game, "lock_x_axis")
- sub.itemR(game, "lock_y_axis")
- sub.itemR(game, "lock_z_axis")
- sub = split.column()
- sub.itemR(game, "lock_x_rot_axis")
- sub.itemR(game, "lock_y_rot_axis")
- sub.itemR(game, "lock_z_rot_axis")
+ col = split.column(align=True)
+ col.itemR(gs, "resolution_x", slider=False, text="Res. X")
+ col.itemR(gs, "resolution_y", slider=False, text="Res. Y")
+ col = split.column(align=True)
+ col.itemR(gs, "depth", slider=False)
+ col.itemR(gs, "frequency", slider=False)
+
-class LOGIC_PT_collision_bounds(bpy.types.Panel):
+ # framing:
+ col = layout.column()
+ col.itemL(text="Framing Options:")
+ 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__ = "Collision Bounds"
+ __label__ = "Stereo and Dome"
- 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
- game = ob.game
-
- layout.itemR(game, "use_collision_bounds", text="")
-
def draw(self, context):
layout = self.layout
-
- ob = context.active_object
- game = ob.game
-
- flow = layout.column_flow()
- flow.active = game.use_collision_bounds
- flow.itemR(game, "collision_bounds")
- flow.itemR(game, "collision_compound")
- flow.itemR(game, "collision_margin")
+ gs = context.scene.game_data
-class LOGIC_PT_properties(bpy.types.Panel):
+
+ # stereo options:
+ col= layout.column()
+ col.itemL(text="Stereo Options:")
+ row = col.row()
+ row.itemR(gs, "stereo", expand=True)
+
+ stereo_mode = gs.stereo
+
+
+ # stereo:
+ if stereo_mode == 'STEREO':
+ col = layout.column(align=True)
+ row = col.row()
+ row.item_enumR(gs, "stereo_mode", "QUADBUFFERED")
+ row.item_enumR(gs, "stereo_mode", "ABOVEBELOW")
+
+ row = col.row()
+ row.item_enumR(gs, "stereo_mode", "INTERLACED")
+ row.item_enumR(gs, "stereo_mode", "ANAGLYPH")
+
+ row = col.row()
+ row.item_enumR(gs, "stereo_mode", "SIDEBYSIDE")
+ row.item_enumR(gs, "stereo_mode", "VINTERLACE")
+
+# row = layout.column_flow()
+# row.itemR(gs, "stereo_mode")
+
+ # dome:
+ if stereo_mode == 'DOME':
+ row = layout.row()
+ row.itemR(gs, "dome_mode")
+
+ split=layout.split()
+ col=split.column(align=True)
+ col.itemR(gs, "dome_angle", slider=True)
+ col.itemR(gs, "dome_tesselation", text="Tessel.")
+ col=split.column(align=True)
+ col.itemR(gs, "dome_tilt")
+ col.itemR(gs, "dome_buffer_resolution", text="Res.", 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__ = "Properties"
-
- def poll(self, context):
- ob = context.active_object
- return ob and ob.game
-
+ __label__ = "World Physics"
+
def draw(self, context):
layout = self.layout
-
- ob = context.active_object
- game = ob.game
-
- for prop in game.properties:
- flow = layout.row()
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list