Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'release/scripts/ui/properties_game.py')
-rw-r--r--release/scripts/ui/properties_game.py250
1 files changed, 125 insertions, 125 deletions
diff --git a/release/scripts/ui/properties_game.py b/release/scripts/ui/properties_game.py
index 150296af070..6f62d35f8db 100644
--- a/release/scripts/ui/properties_game.py
+++ b/release/scripts/ui/properties_game.py
@@ -45,120 +45,120 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
wide_ui = context.region.width > narrowui
if wide_ui:
- layout.itemR(game, "physics_type")
+ layout.prop(game, "physics_type")
else:
- layout.itemR(game, "physics_type", text="")
- layout.itemS()
+ layout.prop(game, "physics_type", text="")
+ layout.separator()
#if game.physics_type == 'DYNAMIC':
if game.physics_type in ('DYNAMIC', 'RIGID_BODY'):
split = layout.split()
col = split.column()
- col.itemR(game, "actor")
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible") # out of place but useful
+ col.prop(game, "actor")
+ col.prop(game, "ghost")
+ col.prop(ob, "restrict_render", text="Invisible") # out of place but useful
if wide_ui:
col = split.column()
- col.itemR(game, "material_physics")
- col.itemR(game, "rotate_from_normal")
- col.itemR(game, "no_sleeping")
+ col.prop(game, "material_physics")
+ col.prop(game, "rotate_from_normal")
+ col.prop(game, "no_sleeping")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Attributes:")
- col.itemR(game, "mass")
- col.itemR(game, "radius")
- col.itemR(game, "form_factor")
+ col.label(text="Attributes:")
+ col.prop(game, "mass")
+ col.prop(game, "radius")
+ col.prop(game, "form_factor")
if wide_ui:
col = split.column()
sub = col.column()
sub.active = (game.physics_type == 'RIGID_BODY')
- sub.itemR(game, "anisotropic_friction")
+ sub.prop(game, "anisotropic_friction")
subsub = sub.column()
subsub.active = game.anisotropic_friction
- subsub.itemR(game, "friction_coefficients", text="", slider=True)
+ subsub.prop(game, "friction_coefficients", text="", slider=True)
split = layout.split()
col = split.column()
- col.itemL(text="Velocity:")
+ col.label(text="Velocity:")
sub = col.column(align=True)
- sub.itemR(game, "minimum_velocity", text="Minimum")
- sub.itemR(game, "maximum_velocity", text="Maximum")
+ sub.prop(game, "minimum_velocity", text="Minimum")
+ sub.prop(game, "maximum_velocity", text="Maximum")
if wide_ui:
col = split.column()
- col.itemL(text="Damping:")
+ col.label(text="Damping:")
sub = col.column(align=True)
- sub.itemR(game, "damping", text="Translation", slider=True)
- sub.itemR(game, "rotation_damping", text="Rotation", slider=True)
+ sub.prop(game, "damping", text="Translation", slider=True)
+ sub.prop(game, "rotation_damping", text="Rotation", slider=True)
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Lock Translation:")
- col.itemR(game, "lock_x_axis", text="X")
- col.itemR(game, "lock_y_axis", text="Y")
- col.itemR(game, "lock_z_axis", text="Z")
+ col.label(text="Lock Translation:")
+ col.prop(game, "lock_x_axis", text="X")
+ col.prop(game, "lock_y_axis", text="Y")
+ col.prop(game, "lock_z_axis", text="Z")
col = split.column()
- col.itemL(text="Lock Rotation:")
- col.itemR(game, "lock_x_rot_axis", text="X")
- col.itemR(game, "lock_y_rot_axis", text="Y")
- col.itemR(game, "lock_z_rot_axis", text="Z")
+ col.label(text="Lock Rotation:")
+ col.prop(game, "lock_x_rot_axis", text="X")
+ col.prop(game, "lock_y_rot_axis", text="Y")
+ col.prop(game, "lock_z_rot_axis", text="Z")
elif game.physics_type == 'SOFT_BODY':
col = layout.column()
- col.itemR(game, "actor")
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible")
+ col.prop(game, "actor")
+ col.prop(game, "ghost")
+ col.prop(ob, "restrict_render", text="Invisible")
- layout.itemS()
+ layout.separator()
split = layout.split()
col = split.column()
- col.itemL(text="Attributes:")
- col.itemR(game, "mass")
- col.itemR(soft, "welding")
- col.itemR(soft, "position_iterations")
- col.itemR(soft, "linstiff", slider=True)
- col.itemR(soft, "dynamic_friction", slider=True)
- col.itemR(soft, "margin", slider=True)
- col.itemR(soft, "bending_const", text="Bending Constraints")
+ col.label(text="Attributes:")
+ col.prop(game, "mass")
+ col.prop(soft, "welding")
+ col.prop(soft, "position_iterations")
+ col.prop(soft, "linstiff", slider=True)
+ col.prop(soft, "dynamic_friction", slider=True)
+ col.prop(soft, "margin", slider=True)
+ col.prop(soft, "bending_const", text="Bending Constraints")
if wide_ui:
col = split.column()
- col.itemR(soft, "shape_match")
+ col.prop(soft, "shape_match")
sub = col.column()
sub.active = soft.shape_match
- sub.itemR(soft, "threshold", slider=True)
+ sub.prop(soft, "threshold", slider=True)
- col.itemS()
+ col.separator()
- col.itemL(text="Cluster Collision:")
- col.itemR(soft, "cluster_rigid_to_softbody")
- col.itemR(soft, "cluster_soft_to_softbody")
+ col.label(text="Cluster Collision:")
+ col.prop(soft, "cluster_rigid_to_softbody")
+ col.prop(soft, "cluster_soft_to_softbody")
sub = col.column()
sub.active = (soft.cluster_rigid_to_softbody or soft.cluster_soft_to_softbody)
- sub.itemR(soft, "cluster_iterations", text="Iterations")
+ sub.prop(soft, "cluster_iterations", text="Iterations")
elif game.physics_type == 'STATIC':
col = layout.column()
- col.itemR(game, "actor")
- col.itemR(game, "ghost")
- col.itemR(ob, "restrict_render", text="Invisible")
+ col.prop(game, "actor")
+ col.prop(game, "ghost")
+ col.prop(ob, "restrict_render", text="Invisible")
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
- layout.itemR(ob, "restrict_render", text="Invisible")
+ layout.prop(ob, "restrict_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
@@ -172,7 +172,7 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
def draw_header(self, context):
game = context.active_object.game
- self.layout.itemR(game, "use_collision_bounds", text="")
+ self.layout.prop(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
@@ -182,18 +182,18 @@ class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
layout.active = game.use_collision_bounds
if wide_ui:
- layout.itemR(game, "collision_bounds", text="Bounds")
+ layout.prop(game, "collision_bounds", text="Bounds")
else:
- layout.itemR(game, "collision_bounds", text="")
+ layout.prop(game, "collision_bounds", text="")
split = layout.split()
col = split.column()
- col.itemR(game, "collision_margin", text="Margin", slider=True)
+ col.prop(game, "collision_margin", text="Margin", slider=True)
if wide_ui:
col = split.column()
- col.itemR(game, "collision_compound", text="Compound")
+ col.prop(game, "collision_compound", text="Compound")
bpy.types.register(PHYSICS_PT_game_physics)
@@ -217,8 +217,8 @@ class RENDER_PT_game(RenderButtonsPanel):
layout = self.layout
row = layout.row()
- row.itemO("view3d.game_start", text="Start")
- row.itemL()
+ row.operator("view3d.game_start", text="Start")
+ row.label()
class RENDER_PT_game_player(RenderButtonsPanel):
@@ -230,32 +230,32 @@ class RENDER_PT_game_player(RenderButtonsPanel):
gs = context.scene.game_data
wide_ui = context.region.width > narrowui
- layout.itemR(gs, "fullscreen")
+ layout.prop(gs, "fullscreen")
split = layout.split()
col = split.column()
- col.itemL(text="Resolution:")
+ col.label(text="Resolution:")
sub = col.column(align=True)
- sub.itemR(gs, "resolution_x", slider=False, text="X")
- sub.itemR(gs, "resolution_y", slider=False, text="Y")
+ sub.prop(gs, "resolution_x", slider=False, text="X")
+ sub.prop(gs, "resolution_y", slider=False, text="Y")
if wide_ui:
col = split.column()
- col.itemL(text="Quality:")
+ col.label(text="Quality:")
sub = col.column(align=True)
- sub.itemR(gs, "depth", text="Bit Depth", slider=False)
- sub.itemR(gs, "frequency", text="FPS", slider=False)
+ sub.prop(gs, "depth", text="Bit Depth", slider=False)
+ sub.prop(gs, "frequency", text="FPS", slider=False)
# framing:
col = layout.column()
- col.itemL(text="Framing:")
+ col.label(text="Framing:")
if wide_ui:
- col.row().itemR(gs, "framing_type", expand=True)
+ col.row().prop(gs, "framing_type", expand=True)
else:
- col.itemR(gs, "framing_type", text="")
+ col.prop(gs, "framing_type", text="")
if gs.framing_type == 'LETTERBOX':
- col.itemR(gs, "framing_color", text="")
+ col.prop(gs, "framing_color", text="")
class RENDER_PT_game_stereo(RenderButtonsPanel):
@@ -269,20 +269,20 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
wide_ui = context.region.width > narrowui
# stereo options:
- layout.itemR(gs, "stereo", expand=True)
+ layout.prop(gs, "stereo", expand=True)
# stereo:
if stereo_mode == 'STEREO':
- layout.itemR(gs, "stereo_mode")
- layout.itemL(text="To do: Focal Length")
- layout.itemL(text="To do: Eye Separation")
+ layout.prop(gs, "stereo_mode")
+ layout.label(text="To do: Focal Length")
+ layout.label(text="To do: Eye Separation")
# dome:
elif stereo_mode == 'DOME':
if wide_ui:
- layout.itemR(gs, "dome_mode", text="Dome Type")
+ layout.prop(gs, "dome_mode", text="Dome Type")
else:
- layout.itemR(gs, "dome_mode", text="")
+ layout.prop(gs, "dome_mode", text="")
dome_type = gs.dome_mode
@@ -293,29 +293,29 @@ class RENDER_PT_game_stereo(RenderButtonsPanel):
dome_type == 'TRUNCATED_FRONT':
col = split.column()
- col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
- col.itemR(gs, "dome_angle", slider=True)
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ col.prop(gs, "dome_angle", slider=True)
if wide_ui:
col = split.column()
- col.itemR(gs, "dome_tesselation", text="Tesselation")
- col.itemR(gs, "dome_tilt")
+ col.prop(gs, "dome_tesselation", text="Tesselation")
+ col.prop(gs, "dome_tilt")
elif dome_type == 'PANORAM_SPH':
col = split.column()
- col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
if wide_ui:
col = split.column()
- col.itemR(gs, "dome_tesselation", text="Tesselation")
+ col.prop(gs, "dome_tesselation", text="Tesselation")
else: # cube map
col = split.column()
- col.itemR(gs, "dome_buffer_resolution", text="Resolution", slider=True)
+ col.prop(gs, "dome_buffer_resolution", text="Resolution", slider=True)
if wide_ui:
col = split.column()
- layout.itemR(gs, "dome_text")
+ layout.prop(gs, "dome_text")
class RENDER_PT_game_shading(RenderButtonsPanel):
@@ -328,22 +328,22 @@ class RENDER_PT_game_shading(RenderButtonsPanel):
wide_ui = context.region.width > narrowui
if wide_ui:
- layout.itemR(gs, "material_mode", expand=True)
+ layout.prop(gs, "material_mode", expand=True)
else:
- layout.itemR(gs, "material_mode", text="")
+ layout.prop(gs, "material_mode", text="")
if gs.material_mode == 'GLSL':
split = layout.split()
col = split.column()
- col.itemR(gs, "glsl_lights", text="Lights")
- col.itemR(gs, "glsl_shaders", text="Shaders")
- col.itemR(gs, "glsl_shadows", text="Shadows")
+ col.prop(gs, "glsl_lights", text="Lights")
+ col.prop(gs, "glsl_shaders", text="Shaders")
+ col.prop(gs, "glsl_shadows", text="Shadows")
col = split.column()
- col.itemR(gs, "glsl_ramps", text="Ramps")
- col.itemR(gs, "glsl_nodes", text="Nodes")
- col.itemR(gs, "glsl_extra_textures", text="Extra Textures")
+ col.prop(gs, "glsl_ramps", text="Ramps")
+ col.prop(gs, "glsl_nodes", text="Nodes")
+ col.prop(gs, "glsl_extra_textures", text="Extra Textures")
class RENDER_PT_game_performance(RenderButtonsPanel):
@@ -358,17 +358,17 @@ class RENDER_PT_game_performance(RenderButtonsPanel):
split = layout.split()
col = split.column()
- col.itemL(text="Show:")
- col.itemR(gs, "show_debug_properties", text="Debug Properties")
- col.itemR(gs, "show_framerate_profile", text="Framerate and Profile")
- col.itemR(gs, "show_physics_visualization", text="Physics Visualization")
- col.itemR(gs, "deprecation_warnings")
+ col.label(text="Show:")
+ col.prop(gs, "show_debug_properties", text="Debug Properties")
+ col.prop(gs, "show_framerate_profile", text="Framerate and Profile")
+ col.prop(gs, "show_physics_visualization", text="Physics Visualization")
+ col.prop(gs, "deprecation_warnings")
if wide_ui:
col = split.column()
- col.itemL(text="Render:")
- col.itemR(gs, "all_frames")
- col.itemR(gs, "display_lists")
+ col.label(text="Render:")
+ col.prop(gs, "all_frames")
+ col.prop(gs, "display_lists")
class RENDER_PT_game_sound(RenderButtonsPanel):
@@ -381,11 +381,11 @@ class RENDER_PT_game_sound(RenderButtonsPanel):
wide_ui = context.region.width > narrowui
if wide_ui:
- layout.itemR(scene, "distance_model")
+ layout.prop(scene, "distance_model")
else:
- layout.itemR(scene, "distance_model", text="")
- layout.itemR(scene, "speed_of_sound", text="Speed")
- layout.itemR(scene, "doppler_factor")
+ layout.prop(scene, "distance_model", text="")
+ layout.prop(scene, "speed_of_sound", text="Speed")
+ layout.prop(scene, "doppler_factor")
bpy.types.register(RENDER_PT_game)
bpy.types.register(RENDER_PT_game_player)
@@ -446,11 +446,11 @@ class WORLD_PT_game_world(WorldButtonsPanel):
split = layout.split()
col = split.column()
- col.itemR(world, "horizon_color")
+ col.prop(world, "horizon_color")
if wide_ui:
col = split.column()
- col.itemR(world, "ambient_color")
+ col.prop(world, "ambient_color")
class WORLD_PT_game_mist(WorldButtonsPanel):
@@ -459,7 +459,7 @@ class WORLD_PT_game_mist(WorldButtonsPanel):
def draw_header(self, context):
world = context.world
- self.layout.itemR(world.mist, "enabled", text="")
+ self.layout.prop(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
@@ -471,11 +471,11 @@ class WORLD_PT_game_mist(WorldButtonsPanel):
split = layout.split()
col = split.column()
- col.itemR(world.mist, "start")
+ col.prop(world.mist, "start")
if wide_ui:
col = split.column()
- col.itemR(world.mist, "depth")
+ col.prop(world.mist, "depth")
class WORLD_PT_game_physics(WorldButtonsPanel):
@@ -487,40 +487,40 @@ class WORLD_PT_game_physics(WorldButtonsPanel):
gs = context.scene.game_data
wide_ui = context.region.width > narrowui
- layout.itemR(gs, "physics_engine")
+ layout.prop(gs, "physics_engine")
if gs.physics_engine != 'NONE':
- layout.itemR(gs, "physics_gravity", text="Gravity")
+ layout.prop(gs, "physics_gravity", text="Gravity")
split = layout.split()
col = split.column()
- col.itemL(text="Physics Steps:")
+ col.label(text="Physics Steps:")
sub = col.column(align=True)
- sub.itemR(gs, "physics_step_max", text="Max")
- sub.itemR(gs, "physics_step_sub", text="Substeps")
- col.itemR(gs, "fps", text="FPS")
+ sub.prop(gs, "physics_step_max", text="Max")
+ sub.prop(gs, "physics_step_sub", text="Substeps")
+ col.prop(gs, "fps", text="FPS")
if wide_ui:
col = split.column()
- col.itemL(text="Logic Steps:")
- col.itemR(gs, "logic_step_max", text="Max")
+ col.label(text="Logic Steps:")
+ col.prop(gs, "logic_step_max", text="Max")
col = layout.column()
- col.itemR(gs, "use_occlusion_culling", text="Occlusion Culling")
+ col.prop(gs, "use_occlusion_culling", text="Occlusion Culling")
sub = col.column()
sub.active = gs.use_occlusion_culling
- sub.itemR(gs, "occlusion_culling_resolution", text="Resolution")
+ sub.prop(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.label(text="Physics Steps:")
+ col.prop(gs, "fps", text="FPS")
col = split.column()
- col.itemL(text="Logic Steps:")
- col.itemR(gs, "logic_step_max", text="Max")
+ col.label(text="Logic Steps:")
+ col.prop(gs, "logic_step_max", text="Max")
bpy.types.register(WORLD_PT_game_context_world)
bpy.types.register(WORLD_PT_game_world)