2.5 Timeline:
authorThomas Dinges <blender@dingto.org>
Sun, 16 Aug 2009 16:15:13 +0000 (16:15 +0000)
committerThomas Dinges <blender@dingto.org>
Sun, 16 Aug 2009 16:15:13 +0000 (16:15 +0000)
* Python conversion is nearly done, still uncommented.

release/ui/space_time.py
source/blender/makesrna/intern/rna_scene.c

index 7d15a1c7250ded4b49c5c7fc432deab854620dad..26e55bac0163ec54e72c059e952af9599aa43b97 100644 (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)
index fe982ced466da2f359fa9cedda16faa7a15434ec..8b8da209f5eca918a6b86f4fe062a50e72f4afe3 100644 (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);