2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-08-13 16:59:52 +00:00
|
|
|
import bpy
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-13 16:59:52 +00:00
|
|
|
class TIME_HT_header(bpy.types.Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'TIMELINE'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
|
|
|
tools = context.tool_settings
|
|
|
|
screen = context.screen
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
|
|
|
|
|
|
|
if context.area.show_menus:
|
|
|
|
sub = row.row(align=True)
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("TIME_MT_view")
|
|
|
|
sub.menu("TIME_MT_frame")
|
|
|
|
sub.menu("TIME_MT_playback")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(scene, "use_preview_range", text="PR")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
if not scene.use_preview_range:
|
2010-04-01 21:44:56 +00:00
|
|
|
row.prop(scene, "frame_start", text="Start")
|
|
|
|
row.prop(scene, "frame_end", text="End")
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
2010-04-01 21:44:56 +00:00
|
|
|
row.prop(scene, "preview_range_frame_start", text="Start")
|
|
|
|
row.prop(scene, "preview_range_frame_end", text="End")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-04-01 21:44:56 +00:00
|
|
|
layout.prop(scene, "frame_current", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("screen.frame_jump", text="", icon='REW').end = False
|
|
|
|
row.operator("screen.keyframe_jump", text="", icon='PREV_KEYFRAME').next = False
|
2009-10-31 19:31:45 +00:00
|
|
|
if not screen.animation_playing:
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("screen.animation_play", text="", icon='PLAY_REVERSE').reverse = True
|
|
|
|
row.operator("screen.animation_play", text="", icon='PLAY')
|
2009-10-31 19:31:45 +00:00
|
|
|
else:
|
|
|
|
sub = row.row()
|
|
|
|
sub.scale_x = 2.0
|
2009-12-10 10:23:53 +00:00
|
|
|
sub.operator("screen.animation_play", text="", icon='PAUSE')
|
|
|
|
row.operator("screen.keyframe_jump", text="", icon='NEXT_KEYFRAME').next = True
|
|
|
|
row.operator("screen.frame_jump", text="", icon='FF').end = True
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2010-02-17 15:14:09 +00:00
|
|
|
row.prop(tools, "use_auto_keying", text="", toggle=True, icon='REC')
|
|
|
|
if screen.animation_playing and tools.use_auto_keying:
|
2009-10-31 19:31:45 +00:00
|
|
|
subsub = row.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
subsub.prop(tools, "record_with_nla", toggle=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-02-19 12:20:29 +00:00
|
|
|
layout.prop(scene, "sync_mode", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
Keying Sets: BuiltIn vs Absolute Tweaks
This commit clarifies the somewhat "murky" separation between "builtin" and "absolute" KeyingSets as a result of discussions with Cessen.
* "Builtin" Keying Sets are now just the Keying Sets which in the past have been known as PyKeyingSets or Relative KeyingSets. These are registered from Py Scripts at startup, and will use the context info to determine what data they should be keyframing. These are stored per Blender session, independent of files, since usually these will be coded specific to sets of rigs used at a studio.
* "Absolute" Keying Sets are the ones that you can create from the Scene buttons and/or KKEY or RMB over any property. They specify the exact set of properties which should always get keyframed together. These are stored in the scene.
In relation to this, I've made it possible to now set one of the builtin Keying Set types as the active Keying Set.
* For now, this can only be done via the box beside the insert/delete key operator buttons on the TimeLine header (now complete with an recycled icon - HINT TO ICON DESIGNERS, to make this a bit more obvious). Later on I'll commit an operator to set this via a hotkey.
* The "IKEY" menu will only show up when there is no active Keying Set. When there is one, keying will happen silently (with info notice at the top of the screen). Later on, I'll hook this menu up to a hotkey, so that that active Keying Set can be changed without inserting keyframes or clearing active Keying Set...
* By default, there isn't any default Keying Set enabled. IMO, this is probably a good default, though some might like to have LocRotScale instead.
* I'm not terribly impressed with the search menu for the items being SORTED (and of all things, alphabetically!) currently, since this does break muscle-memory with the menu (and jumbles up order of closely related vs not closely related).
* The Scene buttons for KeyingSets still need some changes to fully cope with users setting builtin KeyingSets as active sometimes. Controls which are useless or shouldn't be used when a builtin set is shown are being shown.
Builtin set registrations have been tweaked a bit:
* Renamed "bl_idname" to "bl_label" for consistency with rest of API. Note that this is the identifier used by Blender internally when searching for the KeyingSet, and is also what the user sees.
2010-03-23 11:59:34 +00:00
|
|
|
row.prop_object(scene, "active_keying_set", scene, "all_keying_sets", text="")
|
2009-12-10 10:23:53 +00:00
|
|
|
row.operator("anim.keyframe_insert", text="", icon='KEY_HLT')
|
|
|
|
row.operator("anim.keyframe_delete", text="", icon='KEY_DEHLT')
|
2009-08-13 22:10:50 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-13 16:59:52 +00:00
|
|
|
class TIME_MT_view(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "View"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
st = context.space_data
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("anim.time_toggle")
|
2009-12-03 09:56:31 +00:00
|
|
|
layout.operator("time.view_all")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-11 11:18:55 +00:00
|
|
|
layout.prop(st, "show_cframe_indicator")
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(st, "only_selected")
|
2009-08-13 22:10:50 +00:00
|
|
|
|
2009-12-16 19:49:33 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("marker.camera_bind")
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-08-13 16:59:52 +00:00
|
|
|
class TIME_MT_frame(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Frame"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-11-14 13:35:44 +00:00
|
|
|
# tools = context.tool_settings
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("marker.add", text="Add Marker")
|
|
|
|
layout.operator("marker.duplicate", text="Duplicate Marker")
|
|
|
|
layout.operator("marker.move", text="Grab/Move Marker")
|
|
|
|
layout.operator("marker.delete", text="Delete Marker")
|
2010-01-21 19:43:27 +00:00
|
|
|
|
|
|
|
# it was ok for riscos... ok TODO, operator
|
|
|
|
for marker in context.scene.timeline_markers:
|
|
|
|
if marker.selected:
|
|
|
|
layout.separator()
|
|
|
|
layout.prop(marker, "name", text="", icon='MARKER_HLT')
|
|
|
|
break
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("time.start_frame_set")
|
|
|
|
layout.operator("time.end_frame_set")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = layout.row()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.menu("TIME_MT_autokey")
|
2009-08-13 22:10:50 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-13 16:59:52 +00:00
|
|
|
class TIME_MT_playback(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Playback"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
st = context.space_data
|
|
|
|
scene = context.scene
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(st, "play_top_left")
|
|
|
|
layout.prop(st, "play_all_3d")
|
|
|
|
layout.prop(st, "play_anim")
|
|
|
|
layout.prop(st, "play_buttons")
|
|
|
|
layout.prop(st, "play_image")
|
|
|
|
layout.prop(st, "play_sequencer")
|
|
|
|
layout.prop(st, "play_nodes")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-02-19 12:20:29 +00:00
|
|
|
layout.prop(scene, "frame_drop", text="Frame Dropping")
|
2010-02-18 14:37:17 +00:00
|
|
|
layout.prop(scene, "sync_audio", text="AV-sync", icon='SPEAKER')
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(scene, "mute_audio")
|
|
|
|
layout.prop(scene, "scrub_audio")
|
2009-08-25 12:31:35 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-25 12:31:35 +00:00
|
|
|
class TIME_MT_autokey(bpy.types.Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Auto-Keyframing Mode"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
tools = context.tool_settings
|
|
|
|
|
2009-11-23 11:43:38 +00:00
|
|
|
layout.prop_enum(tools, "autokey_mode", 'ADD_REPLACE_KEYS')
|
|
|
|
layout.prop_enum(tools, "autokey_mode", 'REPLACE_KEYS')
|
2009-08-13 16:59:52 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
classes = [
|
|
|
|
TIME_HT_header,
|
|
|
|
TIME_MT_view,
|
|
|
|
TIME_MT_frame,
|
|
|
|
TIME_MT_autokey,
|
|
|
|
TIME_MT_playback]
|
|
|
|
|
|
|
|
|
|
|
|
def register():
|
|
|
|
register = bpy.types.register
|
|
|
|
for cls in classes:
|
|
|
|
register(cls)
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
|
|
|
unregister = bpy.types.unregister
|
|
|
|
for cls in classes:
|
|
|
|
unregister(cls)
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|