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
|
|
|
|
2010-05-03 03:33:20 +00:00
|
|
|
layout.prop(scene, "use_preview_range", text="", toggle=True)
|
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-08-18 08:58:37 +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:
|
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-08-18 03:24:52 +00:00
|
|
|
row.prop(tools, "use_keyframe_insert_auto", text="", toggle=True)
|
2010-08-18 13:02:59 +00:00
|
|
|
if screen.is_animation_playing and tools.use_keyframe_insert_auto:
|
2009-10-31 19:31:45 +00:00
|
|
|
subsub = row.row()
|
2010-08-18 03:24:52 +00:00
|
|
|
subsub.prop(tools, "use_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)
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
|
|
|
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
|
|
|
class TIME_MT_cache(bpy.types.Menu):
|
|
|
|
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")
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2010-07-05 22:22:22 +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:
|
2010-07-15 16:56:04 +00:00
|
|
|
if marker.select:
|
2010-01-21 19:43:27 +00:00
|
|
|
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
|
|
|
|
|
2010-08-17 07:49:53 +00:00
|
|
|
layout.prop(st, "use_play_top_left_3d_editor")
|
|
|
|
layout.prop(st, "use_play_3d_editors")
|
|
|
|
layout.prop(st, "use_play_animation_editors")
|
|
|
|
layout.prop(st, "use_play_properties_editors")
|
|
|
|
layout.prop(st, "use_play_image_editors")
|
|
|
|
layout.prop(st, "use_play_sequence_editors")
|
|
|
|
layout.prop(st, "use_play_node_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
|
|
|
|
2010-08-18 08:58:37 +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
|
|
|
|
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
|
|
|
|
|
2010-08-18 03:24:52 +00:00
|
|
|
layout.prop_enum(tools, "auto_keying_mode", 'ADD_REPLACE_KEYS')
|
|
|
|
layout.prop_enum(tools, "auto_keying_mode", 'REPLACE_KEYS')
|
2009-08-13 16:59:52 +00:00
|
|
|
|
2010-09-07 15:17:42 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def register():
|
2010-08-02 02:55:12 +00:00
|
|
|
pass
|
2010-02-14 11:21:21 +00:00
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
2010-08-02 02:55:12 +00:00
|
|
|
pass
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|