diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 19:23:08 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2011-11-07 19:23:08 +0400 |
commit | 5ef9039b7e2ea16bd4b651aab21d5aa690485569 (patch) | |
tree | e67247fa43d89748900b697eb9bdf0341fe53afc /release | |
parent | fb56dbc2afc7c8b6ffc24406ed82cbcbff090da3 (diff) | |
parent | 5ebee683bd736ef80df939552bbe0d8e104b56df (diff) |
Cycles: svn merge -r41531:41613 ^/trunk/blender
Diffstat (limited to 'release')
37 files changed, 1581 insertions, 33 deletions
diff --git a/release/datafiles/blender_icons.png b/release/datafiles/blender_icons.png Binary files differindex a68a1f8394c..c309ad11da2 100644 --- a/release/datafiles/blender_icons.png +++ b/release/datafiles/blender_icons.png diff --git a/release/scripts/modules/bpy_extras/keyconfig_utils.py b/release/scripts/modules/bpy_extras/keyconfig_utils.py index 6eb19c0ff05..fab6886b314 100644 --- a/release/scripts/modules/bpy_extras/keyconfig_utils.py +++ b/release/scripts/modules/bpy_extras/keyconfig_utils.py @@ -92,6 +92,10 @@ KM_HIERARCHY = [ ('Script', 'SCRIPTS_WINDOW', 'WINDOW', []), ('Text', 'TEXT_EDITOR', 'WINDOW', []), ('Console', 'CONSOLE', 'WINDOW', []), + ('Clip', 'CLIP_EDITOR', 'WINDOW', [ + ('Clip Editor', 'CLIP_EDITOR', 'WINDOW', []), + ('Clip Graph Editor', 'CLIP_EDITOR', 'WINDOW', []), + ]), ('View3D Gesture Circle', 'EMPTY', 'WINDOW', []), ('Gesture Border', 'EMPTY', 'WINDOW', []), diff --git a/release/scripts/presets/tracking_camera/Blender.py b/release/scripts/presets/tracking_camera/Blender.py new file mode 100644 index 00000000000..507cedac4fc --- /dev/null +++ b/release/scripts/presets/tracking_camera/Blender.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 32.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 35.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_1100D.py b/release/scripts/presets/tracking_camera/Canon_1100D.py new file mode 100644 index 00000000000..7ea78412f40 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_1100D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.2 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_1D.py b/release/scripts/presets/tracking_camera/Canon_1D.py new file mode 100644 index 00000000000..89590d3cc19 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_1D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 27.9 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_1DS.py b/release/scripts/presets/tracking_camera/Canon_1DS.py new file mode 100644 index 00000000000..7d9b6c8b390 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_1DS.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 36.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_500D.py b/release/scripts/presets/tracking_camera/Canon_500D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_500D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_550D.py b/release/scripts/presets/tracking_camera/Canon_550D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_550D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_5D.py b/release/scripts/presets/tracking_camera/Canon_5D.py new file mode 100644 index 00000000000..7d9b6c8b390 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_5D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 36.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_600D.py b/release/scripts/presets/tracking_camera/Canon_600D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_600D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_60D.py b/release/scripts/presets/tracking_camera/Canon_60D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_60D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Canon_7D.py b/release/scripts/presets/tracking_camera/Canon_7D.py new file mode 100644 index 00000000000..3dd66c5b609 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Canon_7D.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.3 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D300S.py b/release/scripts/presets/tracking_camera/Nikon_D300S.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D300S.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D3100.py b/release/scripts/presets/tracking_camera/Nikon_D3100.py new file mode 100644 index 00000000000..a112dd22dd2 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D3100.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.1 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D35.py b/release/scripts/presets/tracking_camera/Nikon_D35.py new file mode 100644 index 00000000000..7d9b6c8b390 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D35.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 36.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D5000.py b/release/scripts/presets/tracking_camera/Nikon_D5000.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D5000.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D5100.py b/release/scripts/presets/tracking_camera/Nikon_D5100.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D5100.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D7000.py b/release/scripts/presets/tracking_camera/Nikon_D7000.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D7000.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Nikon_D90.py b/release/scripts/presets/tracking_camera/Nikon_D90.py new file mode 100644 index 00000000000..8db89189cd7 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Nikon_D90.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 23.6 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_Epic.py b/release/scripts/presets/tracking_camera/Red_Epic.py new file mode 100644 index 00000000000..913b507d296 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_Epic.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 30.0 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_One_2K.py b/release/scripts/presets/tracking_camera/Red_One_2K.py new file mode 100644 index 00000000000..0a52b377959 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_One_2K.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 11.1 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_One_3K.py b/release/scripts/presets/tracking_camera/Red_One_3K.py new file mode 100644 index 00000000000..88c232bb944 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_One_3K.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 16.65 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_camera/Red_One_4K.py b/release/scripts/presets/tracking_camera/Red_One_4K.py new file mode 100644 index 00000000000..7ea78412f40 --- /dev/null +++ b/release/scripts/presets/tracking_camera/Red_One_4K.py @@ -0,0 +1,10 @@ +import bpy +camera = bpy.context.edit_movieclip.tracking.camera + +camera.sensor_width = 22.2 +camera.units = 'MILLIMETERS' +camera.focal_length = 24.0 +camera.pixel_aspect = 1 +camera.k1 = 0.0 +camera.k2 = 0.0 +camera.k3 = 0.0 diff --git a/release/scripts/presets/tracking_track_color/default.py b/release/scripts/presets/tracking_track_color/default.py new file mode 100644 index 00000000000..3213d6e0c83 --- /dev/null +++ b/release/scripts/presets/tracking_track_color/default.py @@ -0,0 +1,5 @@ +import bpy +track = bpy.context.edit_movieclip.tracking.tracks.active + +track.color = (0.0, 0.0, 0.0) +track.use_custom_color = False diff --git a/release/scripts/presets/tracking_track_color/far_plane.py b/release/scripts/presets/tracking_track_color/far_plane.py new file mode 100644 index 00000000000..579d5562642 --- /dev/null +++ b/release/scripts/presets/tracking_track_color/far_plane.py @@ -0,0 +1,5 @@ +import bpy +track = bpy.context.edit_movieclip.tracking.tracks.active + +track.color = (0.0, 0.0, 1.0) +track.use_custom_color = True diff --git a/release/scripts/presets/tracking_track_color/near_plane.py b/release/scripts/presets/tracking_track_color/near_plane.py new file mode 100644 index 00000000000..790429ce7a1 --- /dev/null +++ b/release/scripts/presets/tracking_track_color/near_plane.py @@ -0,0 +1,5 @@ +import bpy +track = bpy.context.edit_movieclip.tracking.tracks.active + +track.color = (0.0, 1.0, 0.0) +track.use_custom_color = True diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py index c0e83cee9d6..06b4429d25c 100644 --- a/release/scripts/startup/bl_operators/__init__.py +++ b/release/scripts/startup/bl_operators/__init__.py @@ -25,6 +25,7 @@ if "bpy" in locals(): _modules = ( "add_mesh_torus", "anim", + "clip", "console", "image", "mesh", diff --git a/release/scripts/startup/bl_operators/clip.py b/release/scripts/startup/bl_operators/clip.py new file mode 100644 index 00000000000..d085b7ea105 --- /dev/null +++ b/release/scripts/startup/bl_operators/clip.py @@ -0,0 +1,318 @@ +# ##### 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. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +import os +import shutil +from bpy.types import Operator +from bpy_extras.io_utils import unpack_list + + +class CLIP_OT_track_to_empty(Operator): + """Create an Empty object which will be copying movement of active track""" + + bl_idname = "clip.track_to_empty" + bl_label = "2D Track to Empty" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + if context.space_data.type != 'CLIP_EDITOR': + return False + + sc = context.space_data + clip = sc.clip + + return clip and clip.tracking.tracks.active + + def execute(self, context): + sc = context.space_data + clip = sc.clip + track = clip.tracking.tracks.active + constraint = None + ob = None + + ob = bpy.data.objects.new(name=track.name, object_data=None) + ob.select = True + bpy.context.scene.objects.link(ob) + bpy.context.scene.objects.active = ob + + for con in ob.constraints: + if con.type == 'FOLLOW_TRACK': + constraint = con + break + + if constraint is None: + constraint = ob.constraints.new(type='FOLLOW_TRACK') + + constraint.clip = sc.clip + constraint.track = track.name + constraint.reference = 'TRACK' + + return {'FINISHED'} + + +class CLIP_OT_bundles_to_mesh(Operator): + """Create vertex cloud using coordinates of bundles""" + + bl_idname = "clip.bundles_to_mesh" + bl_label = "Bundles to Mesh" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + if context.space_data.type != 'CLIP_EDITOR': + return False + + sc = context.space_data + clip = sc.clip + + return clip + + def execute(self, context): + sc = context.space_data + clip = sc.clip + + new_verts = [] + + mesh = bpy.data.meshes.new(name="Bundles") + for track in clip.tracking.tracks: + if track.has_bundle: + new_verts.append(track.bundle) + + if new_verts: + mesh.vertices.add(len(new_verts)) + mesh.vertices.foreach_set("co", unpack_list(new_verts)) + + ob = bpy.data.objects.new(name="Bundles", object_data=mesh) + + bpy.context.scene.objects.link(ob) + + return {'FINISHED'} + + +class CLIP_OT_delete_proxy(Operator): + """Delete movie clip proxy files from the hard drive""" + + bl_idname = "clip.delete_proxy" + bl_label = "Delete Proxy" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def invoke(self, context, event): + wm = context.window_manager + + return wm.invoke_confirm(self, event) + + def _rmproxy(self, abspath): + if not os.path.exists(abspath): + return + + if os.path.isdir(abspath): + shutil.rmtree(abspath) + else: + os.remove(abspath) + + def execute(self, context): + sc = context.space_data + clip = sc.clip + if clip.use_proxy_custom_directory: + proxydir = clip.proxy.directory + else: + clipdir = os.path.dirname(clip.filepath) + proxydir = os.path.join(clipdir, 'BL_proxy') + + clipfile = os.path.basename(clip.filepath) + proxy = os.path.join(proxydir, clipfile) + absproxy = bpy.path.abspath(proxy) + + # proxy_<quality>[_undostorted] + for x in (25, 50, 75, 100): + d = os.path.join(absproxy, 'proxy_' + str(x)) + + self._rmproxy(d) + self._rmproxy(d + '_undistorted') + self._rmproxy(os.path.join(absproxy, 'proxy_' + str(x) + '.avi')) + + tc = ('free_run.blen_tc', 'interp_free_run.blen_tc', \ + 'record_run.blen_tc') + + for x in tc: + self._rmproxy(os.path.join(absproxy, x)) + + # remove proxy per-clip directory + try: + os.rmdir(absproxy) + except OSError: + pass + + # remove [custom] proxy directory if empty + try: + absdir = bpy.path.abspath(proxydir) + os.rmdir(absdir) + except OSError: + pass + + return {'FINISHED'} + + +class CLIP_OT_set_viewport_background(Operator): + """Set current movie clip as a camera background in 3D viewport""" + + bl_idname = "clip.set_viewport_background" + bl_label = "Set as Background" + bl_options = {'UNDO', 'REGISTER'} + + @classmethod + def poll(cls, context): + if context.space_data.type != 'CLIP_EDITOR': + return False + + sc = context.space_data + + return sc.clip + + def _set_background(self, space_v3d, clip, user): + bgpic = None + + for x in space_v3d.background_images: + if x.source == 'MOVIE': + bgpic = x + break + + if not bgpic: + bgpic = space_v3d.background_images.add() + + bgpic.source = 'MOVIE' + bgpic.clip = clip + bgpic.clip_user.proxy_render_size = user.proxy_render_size + bgpic.clip_user.use_render_undistorted = user.use_render_undistorted + bgpic.use_camera_clip = False + bgpic.view_axis = 'CAMERA' + + space_v3d.show_background_images = True + + def execute(self, context): + sc = context.space_data + clip = sc.clip + + for area in context.window.screen.areas: + if area.type == 'VIEW_3D': + for space in area.spaces: + if space.type == 'VIEW_3D': + self._set_background(space, clip, sc.clip_user) + + return {'FINISHED'} + + +class CLIP_OT_constraint_to_fcurve(Operator): + """Create F-Curves for object which will copy object's movement caused by this constraint""" + + bl_idname = "clip.constraint_to_fcurve" + bl_label = "Constraint to F-Curve" + bl_options = {'UNDO', 'REGISTER'} + + def _bake_object(self, scene, ob): + con = None + clip = None + sfra = None + efra = None + frame_current = scene.frame_current + matrices = [] + + # Find constraint which would eb converting + # TODO: several camera solvers and track followers would fail, + # but can't think about eal workflow where it'll be useful + for x in ob.constraints: + if x.type in ('CAMERA_SOLVER', 'FOLLOW_TRACK'): + con = x + + if not con: + return + + if con.type == 'FOLLOW_TRACK' and con.reference == 'BUNDLE': + mat = ob.matrix_world.copy() + ob.constraints.remove(con) + ob.matrix_world = mat + + return + + # Get clip used for parenting + if con.use_active_clip: + clip = scene.active_clip + else: + clip = con.clip + + if not clip: + return + + # Find start and end frames + for track in clip.tracking.tracks: + if sfra is None: + sfra = track.markers[0].frame + else: + sfra = min(sfra, track.markers[0].frame) + + if efra is None: + efra = track.markers[-1].frame + else: + efra = max(efra, track.markers[-1].frame) + + if sfra is None or efra is None: + return + + # Store object matrices + for x in range(sfra, efra+1): + scene.frame_set(x) + matrices.append(ob.matrix_world.copy()) + + ob.animation_data_create() + + # Apply matrices on object and insert keyframes + i = 0 + for x in range(sfra, efra+1): + scene.frame_set(x) + ob.matrix_world = matrices[i] + + ob.keyframe_insert("location") + + if ob.rotation_mode == 'QUATERNION': + ob.keyframe_insert("rotation_quaternion") + else: + ob.keyframe_insert("rotation_euler") + + i += 1 + + ob.constraints.remove(con) + + scene.frame_set(frame_current) + + def execute(self, context): + scene = context.scene + + for ob in scene.objects: + if ob.select: + self._bake_object(scene, ob) + + return {'FINISHED'} diff --git a/release/scripts/startup/bl_operators/presets.py b/release/scripts/startup/bl_operators/presets.py index 21ac128f177..ac19bab4c66 100644 --- a/release/scripts/startup/bl_operators/presets.py +++ b/release/scripts/startup/bl_operators/presets.py @@ -319,6 +319,47 @@ class AddPresetInteraction(AddPresetBase, Operator): preset_subdir = "interaction" +class AddPresetTrackingCamera(AddPresetBase, Operator): + '''Add a Tracking Camera Intrinsics Preset''' + bl_idname = "clip.camera_preset_add" + bl_label = "Add Camera Preset" + preset_menu = "CLIP_MT_camera_presets" + + preset_defines = [ + "camera = bpy.context.edit_movieclip.tracking.camera" + ] + + preset_values = [ + "camera.sensor_width", + "camera.units", + "camera.focal_length", + "camera.pixel_aspect", + "camera.k1", + "camera.k2", + "camera.k3" + ] + + preset_subdir = "tracking_camera" + + +class AddPresetTrackingTrackColor(AddPresetBase, Operator): + '''Add a Clip Track Color Preset''' + bl_idname = "clip.track_color_preset_add" + bl_label = "Add Track Color Preset" + preset_menu = "CLIP_MT_track_color_presets" + + preset_defines = [ + "track = bpy.context.edit_movieclip.tracking.tracks" + ] + + preset_values = [ + "track.color", + "track.use_custom_color" + ] + + preset_subdir = "tracking_track_color" + + class AddPresetKeyconfig(AddPresetBase, Operator): '''Add a Keyconfig Preset''' bl_idname = "wm.keyconfig_preset_add" diff --git a/release/scripts/startup/bl_ui/__init__.py b/release/scripts/startup/bl_ui/__init__.py index 682341cbf2f..48aefa93a5c 100644 --- a/release/scripts/startup/bl_ui/__init__.py +++ b/release/scripts/startup/bl_ui/__init__.py @@ -52,6 +52,7 @@ _modules = ( "properties_scene", "properties_texture", "properties_world", + "space_clip", "space_console", "space_dopesheet", "space_filebrowser", diff --git a/release/scripts/startup/bl_ui/properties_object.py b/release/scripts/startup/bl_ui/properties_object.py index 0779debb102..a359d58b59e 100644 --- a/release/scripts/startup/bl_ui/properties_object.py +++ b/release/scripts/startup/bl_ui/properties_object.py @@ -257,10 +257,8 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): layout.prop(ob, "dupli_group", text="Group") -# XXX: the following options are all quite buggy, ancient hacks that should be dropped - -class OBJECT_PT_animation(ObjectButtonsPanel, Panel): - bl_label = "Animation Hacks" +class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): + bl_label = "Relations Extras" bl_options = {'DEFAULT_CLOSED'} def draw(self, context): @@ -269,23 +267,17 @@ class OBJECT_PT_animation(ObjectButtonsPanel, Panel): ob = context.object split = layout.split() - - col = split.column() - col.label(text="Time Offset:") - col.prop(ob, "use_time_offset_edit", text="Edit") - row = col.row() - row.prop(ob, "use_time_offset_parent", text="Parent") - row.active = (ob.parent is not None) - row = col.row() - row.prop(ob, "use_slow_parent") - row.active = (ob.parent is not None) - col.prop(ob, "time_offset", text="Offset") - - # XXX: these are still used for a few curve-related tracking features + col = split.column() col.label(text="Tracking Axes:") col.prop(ob, "track_axis", text="Axis") col.prop(ob, "up_axis", text="Up Axis") + + col = split.column() + col.prop(ob, "use_slow_parent") + row = col.row() + row.active = ((ob.parent is not None) and (ob.use_slow_parent)) + row.prop(ob, "slow_parent_offset", text="Offset") from bl_ui.properties_animviz import ( diff --git a/release/scripts/startup/bl_ui/properties_object_constraint.py b/release/scripts/startup/bl_ui/properties_object_constraint.py index dc19f58ca35..c493124c5bb 100644 --- a/release/scripts/startup/bl_ui/properties_object_constraint.py +++ b/release/scripts/startup/bl_ui/properties_object_constraint.py @@ -753,6 +753,26 @@ class ConstraintButtonsPanel(): col = layout.column() col.prop(con, "rotation_range", text="Pivot When") + def FOLLOW_TRACK(self, context, layout, con): + layout.prop(con, "use_active_clip") + + if not con.use_active_clip: + layout.prop(con, "clip") + + layout.prop(con, "track") + + layout.row().prop(con, "reference", expand=True) + + layout.operator("clip.constraint_to_fcurve") + + def CAMERA_SOLVER(self, context, layout, con): + layout.prop(con, "use_active_clip") + + if not con.use_active_clip: + layout.prop(con, "clip") + + layout.operator("clip.constraint_to_fcurve") + def SCRIPT(self, context, layout, con): layout.label("Blender 2.5 has no py-constraints") diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py index d3859a78bea..86880b9ddec 100644 --- a/release/scripts/startup/bl_ui/properties_scene.py +++ b/release/scripts/startup/bl_ui/properties_scene.py @@ -42,6 +42,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel): layout.prop(scene, "camera") layout.prop(scene, "background_set", text="Background") + layout.prop(scene, "active_clip", text="Active Clip") class SCENE_PT_audio(SceneButtonsPanel, Panel): diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py new file mode 100644 index 00000000000..09209017823 --- /dev/null +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -0,0 +1,885 @@ +# ##### 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. +# +# 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. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# ##### END GPL LICENSE BLOCK ##### + +# <pep8 compliant> +import bpy +from bpy.types import Panel, Header, Menu + + +class CLIP_HT_header(Header): + bl_space_type = 'CLIP_EDITOR' + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + row = layout.row(align=True) + row.template_header() + + if context.area.show_menus: + sub = row.row(align=True) + sub.menu("CLIP_MT_view") + + if clip: + sub.menu("CLIP_MT_select") + + sub.menu("CLIP_MT_clip") + + if clip: + sub.menu("CLIP_MT_track") + sub.menu("CLIP_MT_reconstruction") + + if clip: + layout.prop(sc, "mode", text="") + layout.prop(sc, "view", text="", expand=True) + + if sc.view == 'GRAPH': + row = layout.row(align=True) + + if sc.show_filters: + row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_DOWN', text="Filters") + row.prop(sc, "show_graph_frames", icon='SEQUENCE', text="") + row.prop(sc, "show_graph_tracks", icon='ANIM', text="") + else: + row.prop(sc, "show_filters", icon='DISCLOSURE_TRI_RIGHT', text="Filters") + + row = layout.row() + row.template_ID(sc, "clip", open='clip.open') + + if clip: + r = clip.tracking.reconstruction + + if r.is_valid: + layout.label(text="Average solve error: %.4f" % + (r.average_error)) + + layout.template_running_jobs() + + +class CLIP_PT_tools_marker(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Marker" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + + col = layout.column(align=True) + col.operator("clip.add_marker_move") + col.operator("clip.detect_features") + col.operator("clip.delete_track") + + +class CLIP_PT_tools_tracking(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Track" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + row = layout.row(align=True) + + props = row.operator("clip.track_markers", text="", icon='FRAME_PREV') + props.backwards = True + props = row.operator("clip.track_markers", text="", + icon='PLAY_REVERSE') + props.backwards = True + props.sequence = True + props = row.operator("clip.track_markers", text="", icon='PLAY') + props.sequence = True + row.operator("clip.track_markers", text="", icon='FRAME_NEXT') + + col = layout.column(align=True) + props = col.operator("clip.clear_track_path", text="Clear After") + props.action = 'REMAINED' + + props = col.operator("clip.clear_track_path", text="Clear Before") + props.action = 'UPTO' + + props = col.operator("clip.clear_track_path", text="Clear Track Path") + props.action = 'ALL' + + layout.operator("clip.join_tracks") + + +class CLIP_PT_tools_solving(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Solving" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + col = layout.column(align=True) + col.operator("clip.solve_camera") + col.operator("clip.clear_solution") + + col = layout.column(align=True) + col.prop(settings, "keyframe_a") + col.prop(settings, "keyframe_b") + + +class CLIP_PT_tools_cleanup(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Clean up" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'TRACKING' + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + layout.operator("clip.clean_tracks") + + layout.prop(settings, 'clean_frames', text="Frames") + layout.prop(settings, 'clean_error', text="Error") + layout.prop(settings, 'clean_action', text="") + + +class CLIP_PT_tools_geometry(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Geometry" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'RECONSTRUCTION' + + def draw(self, context): + layout = self.layout + + layout.operator("clip.bundles_to_mesh") + layout.operator("clip.track_to_empty") + + +class CLIP_PT_tools_orientation(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Orientation" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'RECONSTRUCTION' + + def draw(self, context): + sc = context.space_data + layout = self.layout + settings = sc.clip.tracking.settings + + col = layout.column(align=True) + col.label(text="Scene Orientation:") + col.operator("clip.set_floor") + col.operator("clip.set_origin") + + row = col.row() + row.operator("clip.set_axis", text="Set X Axis").axis = 'X' + row.operator("clip.set_axis", text="Set Y Axis").axis = 'Y' + + layout.separator() + + col = layout.column() + col.operator("clip.set_scale") + col.prop(settings, "distance") + + +class CLIP_PT_tools_grease_pencil(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Grease Pencil" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return clip and sc.mode == 'DISTORTION' + + def draw(self, context): + layout = self.layout + + col = layout.column(align=True) + + row = col.row(align=True) + row.operator("gpencil.draw", text="Draw").mode = 'DRAW' + row.operator("gpencil.draw", text="Line").mode = 'DRAW_STRAIGHT' + + row = col.row(align=True) + row.operator("gpencil.draw", text="Poly").mode = 'DRAW_POLY' + row.operator("gpencil.draw", text="Erase").mode = 'ERASER' + + row = col.row() + row.prop(context.tool_settings, "use_grease_pencil_sessions") + + +class CLIP_PT_track(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Track" + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return sc.mode == 'TRACKING' and clip + + def draw(self, context): + layout = self.layout + sc = context.space_data + clip = context.space_data.clip + act_track = clip.tracking.tracks.active + + if not act_track: + layout.active = False + layout.label(text="No active track") + return + + row = layout.row() + row.prop(act_track, "name", text="") + + sub = row.row(align=True) + + sub.template_marker(sc, "clip", sc.clip_user, act_track, True) + + icon = 'LOCKED' if act_track.lock else 'UNLOCKED' + sub.prop(act_track, "lock", text="", icon=icon) + + layout.template_track(sc, "scopes") + + row = layout.row(align=True) + row.prop(act_track, "use_red_channel", text="R", toggle=True) + row.prop(act_track, "use_green_channel", text="G", toggle=True) + row.prop(act_track, "use_blue_channel", text="B", toggle=True) + + layout.separator() + + row = layout.row(align=True) + label = bpy.types.CLIP_MT_track_color_presets.bl_label + row.menu('CLIP_MT_track_color_presets', text=label) + row.menu('CLIP_MT_track_color_specials', text="", icon="DOWNARROW_HLT") + row.operator("clip.track_color_preset_add", text="", icon="ZOOMIN") + props = row.operator("clip.track_color_preset_add", + text="", icon="ZOOMOUT") + props.remove_active = True + + row = layout.row() + row.prop(act_track, "use_custom_color") + if act_track.use_custom_color: + row.prop(act_track, "color", text="") + + if act_track.has_bundle: + label_text = "Average Error: %.4f" % (act_track.average_error) + layout.label(text=label_text) + + +class CLIP_PT_tracking_camera(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Camera Data" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.mode in ['TRACKING', 'DISTORTION'] and sc.clip + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + row = layout.row(align=True) + label = bpy.types.CLIP_MT_camera_presets.bl_label + row.menu('CLIP_MT_camera_presets', text=label) + row.operator("clip.camera_preset_add", text="", icon="ZOOMIN") + props = row.operator("clip.camera_preset_add", text="", icon="ZOOMOUT") + props.remove_active = True + + row = layout.row(align=True) + sub = row.split(percentage=0.65) + if clip.tracking.camera.units == 'MILLIMETERS': + sub.prop(clip.tracking.camera, "focal_length") + else: + sub.prop(clip.tracking.camera, "focal_length_pixels") + sub.prop(clip.tracking.camera, "units", text="") + + col = layout.column(align=True) + col.label(text="Sensor:") + col.prop(clip.tracking.camera, "sensor_width", text="Width") + col.prop(clip.tracking.camera, "pixel_aspect") + + col = layout.column() + col.label(text="Principal Point") + row = col.row() + row.prop(clip.tracking.camera, "principal", text="") + col.operator("clip.set_center_principal", text="Center") + + col = layout.column(align=True) + col.label(text="Undistortion:") + col.prop(clip.tracking.camera, "k1") + col.prop(clip.tracking.camera, "k2") + col.prop(clip.tracking.camera, "k3") + + +class CLIP_PT_display(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Display" + + def draw(self, context): + layout = self.layout + sc = context.space_data + + col = layout.column(align=True) + + col.prop(sc, "show_marker_pattern", text="Pattern") + col.prop(sc, "show_marker_search", text="Search") + col.prop(sc, "show_pyramid_levels", text="Pyramid") + + col.prop(sc, "show_track_path", text="Track Path") + row = col.row() + row.active = sc.show_track_path + row.prop(sc, "path_length", text="Length") + + col.prop(sc, "show_disabled", "Disabled Tracks") + col.prop(sc, "show_bundles", text="Bundles") + + col.prop(sc, "show_names", text="Track Names") + col.prop(sc, "show_tiny_markers", text="Tiny Markers") + + col.prop(sc, "show_grease_pencil", text="Grease Pencil") + col.prop(sc, "use_mute_footage", text="Mute") + + if sc.mode == 'DISTORTION': + col.prop(sc, "show_grid", text="Grid") + col.prop(sc, "use_manual_calibration") + elif sc.mode == 'RECONSTRUCTION': + col.prop(sc, "show_stable", text="Stable") + + col.prop(sc, "lock_selection") + + clip = sc.clip + if clip: + col.label(text="Display Aspect:") + col.prop(clip, "display_aspect", text="") + + +class CLIP_PT_track_settings(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Tracking Settings" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.mode == 'TRACKING' and sc.clip + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + settings = clip.tracking.settings + + active = clip.tracking.tracks.active + if active: + layout.prop(active, "tracker") + if active.tracker == "KLT": + layout.prop(active, "pyramid_levels") + if active.tracker == "SAD": + layout.prop(active, "correlation_min") + + layout.prop(settings, "frames_adjust") + layout.prop(settings, "speed") + layout.prop(settings, "frames_limit") + layout.prop(settings, "margin") + + +class CLIP_PT_stabilization(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "2D Stabilization" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.mode == 'RECONSTRUCTION' and sc.clip + + def draw_header(self, context): + sc = context.space_data + tracking = sc.clip.tracking + stab = tracking.stabilization + + self.layout.prop(stab, "use_2d_stabilization", text="") + + def draw(self, context): + layout = self.layout + sc = context.space_data + tracking = sc.clip.tracking + stab = tracking.stabilization + + layout.active = stab.use_2d_stabilization + + row = layout.row() + row.template_list(stab, "tracks", stab, "active_track_index", rows=3) + + sub = row.column(align=True) + + sub.operator("clip.stabilize_2d_add", icon='ZOOMIN', text="") + sub.operator("clip.stabilize_2d_remove", icon='ZOOMOUT', text="") + + sub.menu('CLIP_MT_stabilize_2d_specials', text="", + icon="DOWNARROW_HLT") + + layout.prop(stab, "influence_location") + + layout.separator() + + layout.prop(stab, "use_autoscale") + col = layout.column() + col.active = stab.use_autoscale + col.prop(stab, "scale_max") + col.prop(stab, "influence_scale") + + layout.separator() + + layout.label(text="Rotation:") + + row = layout.row(align=True) + row.prop_search(stab, "rotation_track", tracking, "tracks", text="") + row.operator("clip.stabilize_2d_set_rotation", text="", icon='ZOOMIN') + + row = layout.row() + row.active = stab.rotation_track is not None + row.prop(stab, "influence_rotation") + + +class CLIP_PT_marker(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Marker" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + clip = sc.clip + + return sc.mode == 'TRACKING' and clip + + def draw(self, context): + layout = self.layout + sc = context.space_data + clip = context.space_data.clip + act_track = clip.tracking.tracks.active + + if act_track: + layout.template_marker(sc, "clip", sc.clip_user, act_track, False) + else: + layout.active = False + layout.label(text="No active track") + + +class CLIP_PT_proxy(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Proxy / Timecode" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def draw_header(self, context): + sc = context.space_data + + self.layout.prop(sc.clip, "use_proxy", text="") + + def draw(self, context): + layout = self.layout + sc = context.space_data + clip = sc.clip + + layout.active = clip.use_proxy + + layout.label(text="Build Sizes:") + + row = layout.row() + row.prop(clip.proxy, "build_25") + row.prop(clip.proxy, "build_50") + + row = layout.row() + row.prop(clip.proxy, "build_75") + row.prop(clip.proxy, "build_100") + + layout.prop(clip.proxy, "build_undistorted") + + layout.prop(clip.proxy, "quality") + + layout.prop(clip, 'use_proxy_custom_directory') + if clip.use_proxy_custom_directory: + layout.prop(clip.proxy, "directory") + + layout.operator("clip.rebuild_proxy", text="Rebuild Proxy") + + if clip.source == 'MOVIE': + col = layout.column() + + col.label(text="Use timecode index:") + col.prop(clip.proxy, "timecode", text="") + + col = layout.column() + col.label(text="Proxy render size:") + + col.prop(sc.clip_user, "proxy_render_size", text="") + col.prop(sc.clip_user, "use_render_undistorted") + + +class CLIP_PT_footage(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'UI' + bl_label = "Footage Settings" + bl_options = {'DEFAULT_CLOSED'} + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + if clip: + layout.template_movieclip(sc, "clip", compact=True) + else: + layout.operator("clip.open", icon='FILESEL') + + +class CLIP_PT_tools_clip(Panel): + bl_space_type = 'CLIP_EDITOR' + bl_region_type = 'TOOLS' + bl_label = "Clip" + + @classmethod + def poll(cls, context): + sc = context.space_data + + return sc.clip + + def draw(self, context): + layout = self.layout + clip = context.space_data.clip + + layout.operator("clip.set_viewport_background") + + +class CLIP_MT_view(Menu): + bl_label = "View" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.properties", icon='MENU_PANEL') + layout.operator("clip.tools", icon='MENU_PANEL') + layout.separator() + + layout.operator("clip.view_selected") + layout.operator("clip.view_all") + + layout.separator() + layout.operator("clip.view_zoom_in") + layout.operator("clip.view_zoom_out") + + layout.separator() + + ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1)) + + for a, b in ratios: + text = "Zoom %d:%d" % (a, b) + layout.operator("clip.view_zoom_ratio", text=text).ratio = a / b + + layout.separator() + layout.operator("screen.area_dupli") + layout.operator("screen.screen_full_area") + + +class CLIP_MT_clip(Menu): + bl_label = "Clip" + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + layout.operator("clip.open") + + if clip: + layout.operator("clip.reload") + layout.menu("CLIP_MT_proxy") + + +class CLIP_MT_proxy(Menu): + bl_label = "Proxy" + + def draw(self, context): + layout = self.layout + + sc = context.space_data + clip = sc.clip + + layout.operator("clip.rebuild_proxy") + layout.operator("clip.delete_proxy") + + +class CLIP_MT_track(Menu): + bl_label = "Track" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.clear_solution") + layout.operator("clip.solve_camera") + + layout.separator() + props = layout.operator("clip.clear_track_path", text="Clear After") + props.action = 'REMAINED' + + props = layout.operator("clip.clear_track_path", text="Clear Before") + props.action = 'UPTO' + + props = layout.operator("clip.clear_track_path", text="Clear Track Path") + props.action = 'ALL' + + layout.separator() + layout.operator("clip.join_tracks") + + layout.separator() + layout.operator("clip.clean_tracks") + + layout.separator() + props = layout.operator("clip.track_markers", + text="Track Frame Backwards") + props.backwards = True + + props = layout.operator("clip.track_markers", text="Track Backwards") + props.backwards = True + props.sequence = True + + props = layout.operator("clip.track_markers", text="Track Forwards") + props.sequence = True + layout.operator("clip.track_markers", text="Track Frame Forwards") + + layout.separator() + layout.operator("clip.delete_track") + layout.operator("clip.delete_marker") + + layout.separator() + layout.operator("clip.add_marker_move") + + layout.separator() + layout.menu("CLIP_MT_track_visibility") + layout.menu("CLIP_MT_track_transform") + + +class CLIP_MT_reconstruction(Menu): + bl_label = "Reconstruction" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.set_origin") + layout.operator("clip.set_floor") + + layout.operator("clip.set_axis", text="Set X Asix").axis = "X" + layout.operator("clip.set_axis", text="Set Y Asix").axis = "Y" + + layout.operator("clip.set_scale") + + layout.separator() + + layout.operator("clip.track_to_empty") + layout.operator("clip.bundles_to_mesh") + + +class CLIP_MT_track_visibility(Menu): + bl_label = "Show/Hide" + + def draw(self, context): + layout = self.layout + + layout.operator("clip.hide_tracks_clear", text="Show Hidden") + layout.operator("clip.hide_tracks", text="Hide Selected") + + props = layout.operator("clip.hide_tracks", text="Hide Unselected") + props.unselected = True + + +class CLIP_MT_track_transform(Menu): + bl_label = "Transform" + + def draw(self, context): + layout = self.layout + + layout.operator("transform.translate") + layout.operator("transform.resize") + + +class CLIP_MT_select(Menu): + bl_label = "Select" + + def draw(self, context): + layout = self.layout + + sc = context.space_data + + layout.operator("clip.select_border") + layout.operator("clip.select_circle") + + layout.separator() + + layout.operator("clip.select_all", text="Select/Deselect all") + layout.operator("clip.select_all", text="Inverse").action = 'INVERT' + + layout.menu("CLIP_MT_select_grouped") + + +class CLIP_MT_select_grouped(Menu): + bl_label = "Select Grouped" + + def draw(self, context): + layout = self.layout + + layout.operator_enum("clip.select_grouped", "group") + + +class CLIP_MT_tracking_specials(Menu): + bl_label = "Specials" + + @classmethod + def poll(cls, context): + return context.space_data.clip + + def draw(self, context): + layout = self.layout + + props = layout.operator("clip.disable_markers", text="Enable Markers") + props.action = 'ENABLE' + + props = layout.operator("clip.disable_markers", text="Disable markers") + props.action = 'DISABLE' + + layout.separator() + layout.operator("clip.set_origin") + + layout.separator() + layout.operator("clip.hide_tracks") + layout.operator("clip.hide_tracks_clear", text="Show Tracks") + + layout.separator() + props = layout.operator("clip.lock_tracks", text="Lock Tracks") + props.action = 'LOCK' + + props = layout.operator("clip.lock_tracks", text="Unlock Tracks") + props.action = 'UNLOCK' + + +class CLIP_MT_camera_presets(Menu): + bl_label = "Camera Presets" + preset_subdir = "tracking_camera" + preset_operator = "script.execute_preset" + draw = bpy.types.Menu.draw_preset + + +class CLIP_MT_track_color_presets(Menu): + bl_label = "Color Presets" + preset_subdir = "tracking_track_color" + preset_operator = "script.execute_preset" + draw = bpy.types.Menu.draw_preset + + +class CLIP_MT_track_color_specials(Menu): + bl_label = "Track Color Specials" + + def draw(self, context): + layout = self.layout + + layout.operator('clip.track_copy_color', icon='COPY_ID') + + +class CLIP_MT_stabilize_2d_specials(Menu): + bl_label = "Track Color Specials" + + def draw(self, context): + layout = self.layout + + layout.operator('clip.stabilize_2d_select') + +if __name__ == "__main__": # only for live edit. + bpy.utils.register_module(__name__) diff --git a/release/scripts/startup/bl_ui/space_time.py b/release/scripts/startup/bl_ui/space_time.py index 6f8e6a574ec..5209e8be597 100644 --- a/release/scripts/startup/bl_ui/space_time.py +++ b/release/scripts/startup/bl_ui/space_time.py @@ -177,6 +177,7 @@ class TIME_MT_playback(Menu): layout.prop(screen, "use_play_image_editors") layout.prop(screen, "use_play_sequence_editors") layout.prop(screen, "use_play_node_editors") + layout.prop(screen, "use_play_clip_editors") layout.separator() diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 3f5b7b86e89..9edb1ea1197 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -2063,7 +2063,22 @@ class VIEW3D_PT_view3d_properties(Panel): subcol.label(text="Local Camera:") subcol.prop(view, "camera", text="") - layout.column().prop(view, "cursor_location") + +class VIEW3D_PT_view3d_cursor(Panel): + bl_space_type = 'VIEW_3D' + bl_region_type = 'UI' + bl_label = "3D Cursor" + + @classmethod + def poll(cls, context): + view = context.space_data + return (view) + + def draw(self, context): + layout = self.layout + + view = context.space_data + layout.column().prop(view, "cursor_location", text="Location") class VIEW3D_PT_view3d_name(Panel): @@ -2149,6 +2164,16 @@ class VIEW3D_PT_view3d_display(Panel): layout.separator() + layout.prop(view, "show_reconstruction") + if view.show_reconstruction: + layout.label(text="Bundle type:") + layout.prop(view, "bundle_draw_type", text="") + layout.prop(view, "bundle_draw_size") + layout.prop(view, "show_bundle_name") + layout.prop(view, "show_camera_path") + + layout.separator() + region = view.region_quadview layout.operator("screen.region_quadview", text="Toggle Quad View") @@ -2254,8 +2279,10 @@ class VIEW3D_PT_background_image(Panel): box = layout.box() row = box.row(align=True) row.prop(bg, "show_expanded", text="", emboss=False) - if bg.image: + if bg.source == 'IMAGE' and bg.image: row.prop(bg.image, "name", text="", emboss=False) + if bg.source == 'MOVIE' and bg.clip: + row.prop(bg.clip, "name", text="", emboss=False) else: row.label(text="Not Set") row.operator("view3d.background_image_remove", text="", emboss=False, icon='X').index = i @@ -2264,10 +2291,36 @@ class VIEW3D_PT_background_image(Panel): if bg.show_expanded: row = box.row() - row.template_ID(bg, "image", open="image.open") - if (bg.image): - box.template_image(bg, "image", bg.image_user, compact=True) + row.prop(bg, "source", expand=True) + + hasbg = False + if bg.source == 'IMAGE': + row = box.row() + row.template_ID(bg, "image", open="image.open") + if (bg.image): + box.template_image(bg, "image", bg.image_user, compact=True) + hasbg = True + + elif bg.source == 'MOVIE': + has_clip = False + box.prop(bg, 'use_camera_clip') + + column = box.column() + column.active = not bg.use_camera_clip + column.template_ID(bg, "clip", open="clip.open") + + if bg.clip: + column.template_movieclip(bg, "clip", compact=True) + + if bg.use_camera_clip or bg.clip: + hasbg = True + + column = box.column() + column.active = hasbg + column.prop(bg.clip_user, "proxy_render_size", text="") + column.prop(bg.clip_user, "use_render_undistorted") + if hasbg: box.prop(bg, "opacity", slider=True) if bg.view_axis != 'CAMERA': box.prop(bg, "size") diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index 96201a4b960..332577a7902 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -172,25 +172,31 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, Panel): class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel): bl_context = "mesh_edit" bl_label = "Mesh Options" + + @classmethod + def poll(cls, context): + return context.active_object def draw(self, context): layout = self.layout ob = context.active_object - if ob: - mesh = ob.data - col = layout.column(align=True) - col.prop(mesh, "use_mirror_x") - sub = col.column() - sub.active = ob.data.use_mirror_x - sub.prop(mesh, "use_mirror_topology") + tool_settings = context.tool_settings + mesh = ob.data - ts = context.tool_settings + col = layout.column(align=True) + col.active = tool_settings.proportional_edit == 'DISABLED' + col.prop(mesh, "use_mirror_x") - col.label("Edge Select Mode") - col.prop(ts, "edge_path_mode", text="") - col.prop(context.tool_settings, "edge_path_live_unwrap") + row = col.row() + row.active = ob.data.use_mirror_x + row.prop(mesh, "use_mirror_topology") + + col = layout.column(align=True) + col.label("Edge Select Mode:") + col.prop(tool_settings, "edge_path_mode", text="") + col.prop(tool_settings, "edge_path_live_unwrap") # ********** default tools for editmode_curve **************** |