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
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Header, Menu
|
2009-08-13 16:59:52 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class TIME_HT_header(Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'TIMELINE'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
scene = context.scene
|
2012-01-17 17:57:20 +00:00
|
|
|
toolsettings = context.tool_settings
|
2009-10-31 19:31:45 +00:00
|
|
|
screen = context.screen
|
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
row.template_header()
|
|
|
|
|
|
|
|
if context.area.show_menus:
|
2011-08-13 17:52:13 +00:00
|
|
|
row.menu("TIME_MT_view")
|
2011-11-03 12:47:39 +00:00
|
|
|
row.menu("TIME_MT_marker")
|
2011-08-13 17:52:13 +00:00
|
|
|
row.menu("TIME_MT_frame")
|
|
|
|
row.menu("TIME_MT_playback")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2013-10-13 20:46:02 +00:00
|
|
|
row = layout.row(align=True)
|
|
|
|
row.prop(scene, "use_preview_range", text="", toggle=True)
|
|
|
|
row.prop(scene, "lock_frame_selection_to_range", text="", toggle=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
|
|
|
if not scene.use_preview_range:
|
2011-09-21 15:18:38 +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:
|
2011-09-21 15:18:38 +00:00
|
|
|
row.prop(scene, "frame_preview_start", text="Start")
|
|
|
|
row.prop(scene, "frame_preview_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
|
2010-08-18 13:02:59 +00:00
|
|
|
if not screen.is_animation_playing:
|
2010-12-22 11:37:56 +00:00
|
|
|
# if using JACK and A/V sync:
|
|
|
|
# hide the play-reversed button
|
|
|
|
# since JACK transport doesn't support reversed playback
|
2012-01-14 06:30:27 +00:00
|
|
|
if scene.sync_mode == 'AUDIO_SYNC' and context.user_preferences.system.audio_device == 'JACK':
|
2013-08-23 20:41:21 +00:00
|
|
|
sub = row.row(align=True)
|
2010-12-22 11:37:56 +00:00
|
|
|
sub.scale_x = 2.0
|
|
|
|
sub.operator("screen.animation_play", text="", icon='PLAY')
|
|
|
|
else:
|
|
|
|
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:
|
2013-08-23 20:41:21 +00:00
|
|
|
sub = row.row(align=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
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
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2010-12-28 11:52:35 +00:00
|
|
|
layout.prop(scene, "sync_mode", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-12-28 11:52:35 +00:00
|
|
|
layout.separator()
|
2011-01-01 07:20:34 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
row = layout.row(align=True)
|
2012-01-17 17:57:20 +00:00
|
|
|
row.prop(toolsettings, "use_keyframe_insert_auto", text="", toggle=True)
|
2012-05-06 06:57:02 +00:00
|
|
|
if toolsettings.use_keyframe_insert_auto:
|
|
|
|
row.prop(toolsettings, "use_keyframe_insert_keyingset", text="", toggle=True)
|
2012-05-15 18:50:51 +00:00
|
|
|
|
2012-05-06 06:57:02 +00:00
|
|
|
if screen.is_animation_playing:
|
2013-08-23 20:41:21 +00:00
|
|
|
subsub = row.row(align=True)
|
2012-05-06 06:57:02 +00:00
|
|
|
subsub.prop(toolsettings, "use_record_with_nla", toggle=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
row = layout.row(align=True)
|
2010-08-24 06:52:16 +00:00
|
|
|
row.prop_search(scene.keying_sets_all, "active", scene, "keying_sets_all", 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
|
|
|
|
2011-11-11 03:28:46 +00:00
|
|
|
class TIME_MT_marker(Menu):
|
2011-11-03 12:47:39 +00:00
|
|
|
bl_label = "Marker"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
marker_menu_generic(layout)
|
|
|
|
|
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class TIME_MT_view(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "View"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
st = context.space_data
|
|
|
|
|
2012-01-14 14:17:12 +00:00
|
|
|
layout.prop(st, "show_seconds")
|
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
|
|
|
|
2010-08-17 07:49:53 +00:00
|
|
|
layout.prop(st, "show_frame_indicator")
|
|
|
|
layout.prop(st, "show_only_selected")
|
2009-08-13 22:10:50 +00:00
|
|
|
|
Timeline addition: Display cached frames
This started off doing pointcache debugging but it's also very useful for users too.
Previously it was very hard to see the state of the system when you're working caches
such as physics point cache - is it baked? which frames are cached? is it out of date?
Now, for better feedback, cached frames are drawn for the active object at the bottom
of the timeline - a semitransparent area shows the entire cache extents, and more
solid blocks on top show the frames that are cached. Darker versions indicate it's
using a disk cache.
It can be disabled in general in the timeline View -> Caches menu, or by each individual
system that can be shown.
There's still a bit to do on this, behaviour needs to be clarified still eg. deciding what
shows when it's out of date, or when it's been played back but not cached, etc. etc.
Part of this is due to a lack of definition in the point cache system itself, so we should
try and clean up/clarify this behaviour and what it means to users, at the same time.
Also would be interested in extending this to other caches such as fluid cache,
sequencer memory cache etc. in the future, too.
2010-06-22 02:29:52 +00:00
|
|
|
layout.separator()
|
2010-07-05 22:22:22 +00:00
|
|
|
|
Timeline addition: Display cached frames
This started off doing pointcache debugging but it's also very useful for users too.
Previously it was very hard to see the state of the system when you're working caches
such as physics point cache - is it baked? which frames are cached? is it out of date?
Now, for better feedback, cached frames are drawn for the active object at the bottom
of the timeline - a semitransparent area shows the entire cache extents, and more
solid blocks on top show the frames that are cached. Darker versions indicate it's
using a disk cache.
It can be disabled in general in the timeline View -> Caches menu, or by each individual
system that can be shown.
There's still a bit to do on this, behaviour needs to be clarified still eg. deciding what
shows when it's out of date, or when it's been played back but not cached, etc. etc.
Part of this is due to a lack of definition in the point cache system itself, so we should
try and clean up/clarify this behaviour and what it means to users, at the same time.
Also would be interested in extending this to other caches such as fluid cache,
sequencer memory cache etc. in the future, too.
2010-06-22 02:29:52 +00:00
|
|
|
layout.menu("TIME_MT_cache")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2009-12-16 19:49:33 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("marker.camera_bind")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2012-11-04 18:26:30 +00:00
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("screen.area_dupli")
|
|
|
|
layout.operator("screen.screen_full_area")
|
|
|
|
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class TIME_MT_cache(Menu):
|
Timeline addition: Display cached frames
This started off doing pointcache debugging but it's also very useful for users too.
Previously it was very hard to see the state of the system when you're working caches
such as physics point cache - is it baked? which frames are cached? is it out of date?
Now, for better feedback, cached frames are drawn for the active object at the bottom
of the timeline - a semitransparent area shows the entire cache extents, and more
solid blocks on top show the frames that are cached. Darker versions indicate it's
using a disk cache.
It can be disabled in general in the timeline View -> Caches menu, or by each individual
system that can be shown.
There's still a bit to do on this, behaviour needs to be clarified still eg. deciding what
shows when it's out of date, or when it's been played back but not cached, etc. etc.
Part of this is due to a lack of definition in the point cache system itself, so we should
try and clean up/clarify this behaviour and what it means to users, at the same time.
Also would be interested in extending this to other caches such as fluid cache,
sequencer memory cache etc. in the future, too.
2010-06-22 02:29:52 +00:00
|
|
|
bl_label = "Cache"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
st = context.space_data
|
|
|
|
|
|
|
|
layout.prop(st, "show_cache")
|
|
|
|
|
|
|
|
layout.separator()
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Timeline addition: Display cached frames
This started off doing pointcache debugging but it's also very useful for users too.
Previously it was very hard to see the state of the system when you're working caches
such as physics point cache - is it baked? which frames are cached? is it out of date?
Now, for better feedback, cached frames are drawn for the active object at the bottom
of the timeline - a semitransparent area shows the entire cache extents, and more
solid blocks on top show the frames that are cached. Darker versions indicate it's
using a disk cache.
It can be disabled in general in the timeline View -> Caches menu, or by each individual
system that can be shown.
There's still a bit to do on this, behaviour needs to be clarified still eg. deciding what
shows when it's out of date, or when it's been played back but not cached, etc. etc.
Part of this is due to a lack of definition in the point cache system itself, so we should
try and clean up/clarify this behaviour and what it means to users, at the same time.
Also would be interested in extending this to other caches such as fluid cache,
sequencer memory cache etc. in the future, too.
2010-06-22 02:29:52 +00:00
|
|
|
col = layout.column()
|
|
|
|
col.enabled = st.show_cache
|
|
|
|
col.prop(st, "cache_softbody")
|
|
|
|
col.prop(st, "cache_particles")
|
|
|
|
col.prop(st, "cache_cloth")
|
|
|
|
col.prop(st, "cache_smoke")
|
2011-06-16 10:41:00 +00:00
|
|
|
col.prop(st, "cache_dynamicpaint")
|
2013-01-23 05:56:34 +00:00
|
|
|
col.prop(st, "cache_rigidbody")
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class TIME_MT_frame(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Frame"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
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
|
|
|
|
2012-07-29 10:03:46 +00:00
|
|
|
layout.menu("TIME_MT_autokey")
|
2009-08-13 22:10:50 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class TIME_MT_playback(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Playback"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
2011-02-01 23:41:01 +00:00
|
|
|
screen = context.screen
|
2009-10-31 19:31:45 +00:00
|
|
|
scene = context.scene
|
|
|
|
|
2011-02-01 23:41:01 +00:00
|
|
|
layout.prop(screen, "use_play_top_left_3d_editor")
|
|
|
|
layout.prop(screen, "use_play_3d_editors")
|
|
|
|
layout.prop(screen, "use_play_animation_editors")
|
|
|
|
layout.prop(screen, "use_play_properties_editors")
|
|
|
|
layout.prop(screen, "use_play_image_editors")
|
|
|
|
layout.prop(screen, "use_play_sequence_editors")
|
|
|
|
layout.prop(screen, "use_play_node_editors")
|
2011-11-07 12:55:18 +00:00
|
|
|
layout.prop(screen, "use_play_clip_editors")
|
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
|
|
|
|
2011-09-21 15:18:38 +00:00
|
|
|
layout.prop(scene, "use_frame_drop", text="Frame Dropping")
|
|
|
|
layout.prop(scene, "use_audio_sync", text="AV-sync", icon='SPEAKER')
|
2010-08-18 07:14:10 +00:00
|
|
|
layout.prop(scene, "use_audio")
|
2010-08-18 08:58:37 +00:00
|
|
|
layout.prop(scene, "use_audio_scrub")
|
2009-08-25 12:31:35 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class TIME_MT_autokey(Menu):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Auto-Keyframing Mode"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2012-01-17 17:57:20 +00:00
|
|
|
toolsettings = context.tool_settings
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2012-01-17 17:57:20 +00:00
|
|
|
layout.prop_enum(toolsettings, "auto_keying_mode", 'ADD_REPLACE_KEYS')
|
|
|
|
layout.prop_enum(toolsettings, "auto_keying_mode", 'REPLACE_KEYS')
|
2011-04-04 10:13:04 +00:00
|
|
|
|
2011-11-03 12:47:39 +00:00
|
|
|
|
|
|
|
def marker_menu_generic(layout):
|
|
|
|
|
|
|
|
#layout.operator_context = 'EXEC_REGION_WIN'
|
|
|
|
|
|
|
|
layout.column()
|
|
|
|
layout.operator("marker.add", "Add Marker")
|
|
|
|
layout.operator("marker.duplicate", text="Duplicate Marker")
|
|
|
|
|
2013-04-04 17:01:51 +00:00
|
|
|
if len(bpy.data.scenes) > 10:
|
2011-11-03 12:47:39 +00:00
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
|
|
|
layout.operator("marker.make_links_scene", text="Duplicate Marker to Scene...", icon='OUTLINER_OB_EMPTY')
|
|
|
|
else:
|
|
|
|
layout.operator_menu_enum("marker.make_links_scene", "scene", text="Duplicate Marker to Scene...")
|
|
|
|
|
|
|
|
layout.operator("marker.delete", text="Delete Marker")
|
|
|
|
|
|
|
|
layout.separator()
|
|
|
|
|
|
|
|
layout.operator("marker.rename", text="Rename Marker")
|
|
|
|
layout.operator("marker.move", text="Grab/Move Marker")
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2013-10-21 15:00:22 +00:00
|
|
|
layout.separator()
|
2013-11-19 16:38:18 +00:00
|
|
|
|
2013-10-21 15:00:22 +00:00
|
|
|
layout.operator("screen.marker_jump", text="Jump to Next Marker").next = True
|
|
|
|
layout.operator("screen.marker_jump", text="Jump to Previous Marker").next = False
|
2011-11-03 12:47:39 +00:00
|
|
|
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
bpy.utils.register_module(__name__)
|