2.5 Timeline:

* Python conversion is nearly done, still uncommented.
This commit is contained in:
2009-08-16 16:15:13 +00:00
parent 5555ef8a76
commit 13dcf69eee
2 changed files with 47 additions and 25 deletions

View File

@@ -9,12 +9,14 @@ class TIME_HT_header(bpy.types.Header):
st = context.space_data
scene = context.scene
tools = context.tool_settings
screen = context.screen
layout.template_header()
if context.area.show_menus:
row = layout.row()
#row.itemM("TIME_MT_view")
row.itemM("TIME_MT_view")
row.itemM("TIME_MT_frame")
row.itemM("TIME_MT_playback")
@@ -31,26 +33,37 @@ class TIME_HT_header(bpy.types.Header):
row.itemR(scene, "preview_range_end_frame", text="End")
layout.itemS()
layout.itemR(scene, "current_frame")
layout.itemR(scene, "current_frame", text="")
layout.itemS()
# XXX: Pause Button
row = layout.row(align=True)
row.itemO("screen.frame_jump", text="", icon='ICON_REW')
row.itemO("screen.keyframe_jump", text="", icon='ICON_PREV_KEYFRAME')
row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
if not screen.animation_playing:
row.item_booleanO("screen.animation_play", "reverse", True, text="", icon='ICON_PLAY_REVERSE')
row.itemO("screen.animation_play", text="", icon='ICON_PLAY')
else:
sub = row.row()
sub.scale_x = 2.0
sub.itemO("screen.animation_play", text="", icon='ICON_PAUSE')
row.item_booleanO("screen.keyframe_jump", "next", True, text="", icon='ICON_NEXT_KEYFRAME')
row.item_booleanO("screen.frame_jump", "end", True, text="", icon='ICON_FF')
layout.itemR(scene, "active_keyingset")
row = layout.row(align=True)
row.itemR(tools, "enable_auto_key", text="", toggle=True, icon='ICON_REC')
sub = row.row()
sub.active = tools.enable_auto_key
sub.itemR(tools, "autokey_mode", text="")
layout.itemS()
row = layout.row(align=True)
row.itemR(scene, "active_keyingset")
row.itemO("anim.insert_keyframe", text="", icon="ICON_KEY_HLT")
row.itemO("anim.delete_keyframe", text="", icon="ICON_KEY_DEHLT")
"""
class TIME_MT_view(bpy.types.Menu):
__space_type__ = "TIMELINE"
__label__ = "View"
@@ -58,9 +71,7 @@ class TIME_MT_view(bpy.types.Menu):
def draw(self, context):
layout = self.layout
st = context.space_data
"""
layout.itemO("anim.time_toggle")
class TIME_MT_frame(bpy.types.Menu):
__space_type__ = "TIMELINE"
@@ -80,7 +91,6 @@ class TIME_MT_frame(bpy.types.Menu):
layout.itemO("time.start_frame_set")
layout.itemO("time.end_frame_set")
class TIME_MT_playback(bpy.types.Menu):
__space_type__ = "TIMELINE"
__label__ = "Playback"
@@ -89,21 +99,17 @@ class TIME_MT_playback(bpy.types.Menu):
layout = self.layout
st = context.space_data
time = st.XXX #ToDo
layout.itemR(time, "play_top_left")
layout.itemR(time, "play_all_3d")
layout.itemR(time, "play_anim")
layout.itemR(time, "play_buttons")
layout.itemR(time, "play_image")
layout.itemR(time, "play_sequencer")
layout.itemR(st, "play_top_left")
layout.itemR(st, "play_all_3d")
layout.itemR(st, "play_anim")
layout.itemR(st, "play_buttons")
layout.itemR(st, "play_image")
layout.itemR(st, "play_sequencer")
layout.itemS()
layout.itemR(time, "continue_physics")
layout.itemR(st, "continue_physics")
bpy.types.register(TIME_HT_header)
#bpy.types.register(TIME_MT_view)
bpy.types.register(TIME_MT_view)
bpy.types.register(TIME_MT_frame)
bpy.types.register(TIME_MT_playback)

View File

@@ -30,6 +30,7 @@
#include "rna_internal.h"
#include "DNA_scene_types.h"
#include "DNA_userdef_types.h"
#ifdef WITH_FFMPEG
#include "BKE_writeffmpeg.h"
@@ -359,6 +360,11 @@ static void rna_def_tool_settings(BlenderRNA *brna)
{SCE_SNAP_TARGET_MEDIAN, "MEDIAN", 0, "Median", "Snap median onto target."},
{SCE_SNAP_TARGET_ACTIVE, "ACTIVE", 0, "Active", "Snap active onto target."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem auto_key_items[] = {
{AUTOKEY_MODE_NORMAL, "ADD_REPLACE_KEYS", 0, "Add/Replace", ""},
{AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""},
{0, NULL, 0, NULL, NULL}};
srna= RNA_def_struct(brna, "ToolSettings", NULL);
RNA_def_struct_ui_text(srna, "Tool Settings", "");
@@ -421,6 +427,16 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "snap_flag", SCE_SNAP_PEEL_OBJECT);
RNA_def_property_ui_text(prop, "Snap Peel Object", "Consider objects as whole when finding volume center.");
RNA_def_property_ui_icon(prop, ICON_SNAP_PEEL_OBJECT, 0);
/* Auto Keying */
prop= RNA_def_property(srna, "enable_auto_key", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "autokey_mode", AUTOKEY_ON);
RNA_def_property_ui_text(prop, "Auto Keying", "Automatic keyframe insertion for Objects and Bones");
prop= RNA_def_property(srna, "autokey_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "autokey_mode");
RNA_def_property_enum_items(prop, auto_key_items);
RNA_def_property_ui_text(prop, "Auto-Keying Mode", "Mode of automatic keyframe insertion for Objects and Bones");
/* UV */
prop= RNA_def_property(srna, "uv_selection_mode", PROP_ENUM, PROP_NONE);