I'd suggest write an Add-on instead of edit the python files which shipped with blender, simply because you can update Blender as you like.
Also it's fairly simple to append a property or a custom menu to the editor headers. Take a look into the python templates: Text Editor > Templates > Python > UI Menu. Key is to register bpy.types.EDITOR_TYPE.append(draw)
and append a custom method to display the property.
Display a single property
To display a property in the timeline header use: bpy.types.TIME_HT_header.append(draw)
:
import bpy
def draw_frame_rate_property(self, context):
scene = context.scene
layout = self.layout
# call the property
layout.prop(scene.render, "fps", text="FPS")
def register():
# lets add the menu to the timeline header via append or prepend
bpy.types.TIME_HT_header.append(draw_frame_rate_property)
def unregister():
# remove header menu
bpy.types.INFO_HT_header.remove(draw_frame_rate_property)
if __name__ == "__main__":
register()
Display multiple properties as menu
For a custom frame rate menu in your timeline, create a menu class (see the UI Menu template) and call layout.menu for reference in your draw function. Following Add-on creates a new menu in the timeline header to edit all frame rate properties:
bl_info = {
"name": "Set Frame Rate in Timeline",
"description": "",
"author": "poor",
"version": (0, 0, 1),
"blender": (2, 73, 0),
"location": "Timeline > Header",
"warning": "",
"wiki_url": "",
"tracker_url": "",
"category": "Timeline"
}
import bpy
class CustomFrameRateMenu(bpy.types.Menu):
bl_label = "Frame Rate"
bl_idname = "RENDER_MT_framerate_menu"
def draw(self, context):
scene = context.scene
layout = self.layout
#frame rate properties
layout.prop(scene.render, "fps_base", text="FPS Base")
layout.prop(scene.render, "fps", text="FPS")
layout.menu("RENDER_MT_framerate_presets", text="Presets", icon="SCENE")
def draw_frame_rate_menu(self, context):
layout = self.layout
layout.menu(CustomFrameRateMenu.bl_idname)
def register():
bpy.utils.register_module(__name__)
# lets add the menu to the timeline header via append or prepend
bpy.types.TIME_HT_header.append(draw_frame_rate_menu)
def unregister():
bpy.utils.unregister_module(__name__)
# remove header menu
bpy.types.INFO_HT_header.remove(draw_frame_rate_menu)
if __name__ == "__main__":
register()
Note: Use bpy.types.EDITOR_TYPE.prepend()
to display the property before the menu:
Further information: