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
|
|
|
|
|
tools = context.tool_settings
|
|
|
|
|
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")
|
|
|
|
|
row.menu("TIME_MT_frame")
|
|
|
|
|
row.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:
|
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
|
|
|
|
|
if (context.user_preferences.system.audio_device == 'JACK' and scene.sync_mode == 'AUDIO_SYNC'):
|
|
|
|
|
sub = row.row()
|
|
|
|
|
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:
|
|
|
|
|
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
|
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)
|
2010-08-18 03:24:52 +00:00
|
|
|
row.prop(tools, "use_keyframe_insert_auto", text="", toggle=True)
|
2011-02-04 08:33:07 +00:00
|
|
|
row.prop(tools, "use_keyframe_insert_keyingset", 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
|
|
|
|
|
|
|
|
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-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
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
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")
|
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("marker.add", text="Add Marker")
|
|
|
|
|
layout.operator("marker.duplicate", text="Duplicate Marker")
|
|
|
|
|
layout.operator("marker.delete", text="Delete Marker")
|
2010-01-21 19:43:27 +00:00
|
|
|
|
2011-01-06 04:47:57 +00:00
|
|
|
layout.separator()
|
2011-01-13 23:00:51 +00:00
|
|
|
|
2011-01-06 04:47:57 +00:00
|
|
|
layout.operator("marker.rename", text="Rename Marker")
|
|
|
|
|
layout.operator("marker.move", text="Grab/Move Marker")
|
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
|
|
|
|
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")
|
Camera tracking integration
===========================
- Initial implementaiton of new ID named MovieClip.
Currently it has plactically the same functionality as
images, but this functionality would be widen in nearest future.
- Initial implementation of SpaceClip.
This space is supposed to be used for acting with MovieClips
(opening, playbacking, math-moving interaction and so on).
Currently you could open image sequence/movie file here, pan/zoom,
use a playback here.
I've added cache visualizer to this space, but it's currently more
a developer's feature to see how cache system works, but it could
be adopted for further artists' usage (something like cache visuzlizer
for simulations).
- Added new theme area for Space Clip.
No special colors were defined here yet.
- Implementation of basic cache system for movies.
This cache system is very familiar with sequence cache system,
but it supposed to be more portable: at least cache keys aren't
limited with sequence-based data and current seqcache could
became an interface between sequencer and moviecache without
much logic (only logic related on keys handling would be necessary
here).
Implemented basic limitors (ab\mount of cached imbuf's), so it'll
be a bit more difficult to go out of memory when playing long
animations in Image Editor (this cache system could be used for
images too, in the future).
- Very basic tools implementation -- only sceletion added, no
real tool implemented (only camera focal length added to the UI
which hasn't got real affect on anything).
Assorted notes:
- Not sure about best behaviour for Unlink clip button: should
it be imageeditor-like (with de-referencing only) or text-editor
like (with removing datablock from file).
- Also not sure if tools/properties should be splitted into
different areas or it'll be better to have tools and settings
for this tool/item/etc in the same area (tools at the top,
properties are under them).
Code for properties area is '#if 0'-ed.
- Sound isn't supported during playback in movie clip.
2011-05-30 04:18:02 +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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
|
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')
|
2011-04-04 10:13:04 +00:00
|
|
|
|
|
|
|
|
if __name__ == "__main__": # only for live edit.
|
|
|
|
|
bpy.utils.register_module(__name__)
|