Merging r43721 through r43847 from trunk into soc-2011-tomato

This commit is contained in:
Sergey Sharybin
2012-02-02 13:04:52 +00:00
122 changed files with 3065 additions and 2496 deletions

View File

@@ -44,7 +44,7 @@ def add_object_align_init(context, operator):
properties = operator.properties if operator is not None else None
space_data = context.space_data
if space_data.type != 'VIEW_3D':
if space_data and space_data.type != 'VIEW_3D':
space_data = None
# location

View File

@@ -9,3 +9,6 @@ settings.default_search_size = 100
settings.default_frames_limit = 0
settings.default_pattern_match = 'PREV_FRAME'
settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True

View File

@@ -9,3 +9,6 @@ settings.default_search_size = 61
settings.default_frames_limit = 0
settings.default_pattern_match = 'KEYFRAME'
settings.default_margin = 0
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True

View File

@@ -9,3 +9,6 @@ settings.default_search_size = 300
settings.default_frames_limit = 0
settings.default_pattern_match = 'PREV_FRAME'
settings.default_margin = 5
settings.use_default_red_channel = True
settings.use_default_green_channel = True
settings.use_default_blue_channel = True

View File

@@ -90,6 +90,34 @@ def CLIP_track_view_selected(sc, track):
return False
def CLIP_default_settings_from_track(clip, track):
settings = clip.tracking.settings
width = clip.size[0]
height = clip.size[1]
pattern = track.pattern_max - track.pattern_min
search = track.search_max - track.search_min
pattern[0] = pattern[0] * clip.size[0]
pattern[1] = pattern[1] * clip.size[1]
search[0] = search[0] * clip.size[0]
search[1] = search[1] * clip.size[1]
settings.default_tracker = track.tracker
settings.default_pyramid_levels = track.pyramid_levels
settings.default_correlation_min = track.correlation_min
settings.default_pattern_size = max(pattern[0], pattern[1])
settings.default_search_size = max(search[0], search[1])
settings.default_frames_limit = track.frames_limit
settings.default_pattern_match = track.pattern_match
settings.default_margin = track.margin
settings.use_default_red_channel = track.use_red_channel
settings.use_default_green_channel = track.use_green_channel
settings.use_default_blue_channel = track.use_blue_channel
class CLIP_OT_track_to_empty(Operator):
"""Create an Empty object which will be copying movement of active track"""
@@ -805,3 +833,29 @@ class CLIP_OT_setup_tracking_scene(Operator):
self._setupObjects(context)
return {'FINISHED'}
class CLIP_OT_track_settings_as_default(Operator):
"""Copy tracking settings from active track to default settings"""
bl_idname = "clip.track_settings_as_default"
bl_label = "Track Settings As Default"
bl_options = {'UNDO', 'REGISTER'}
@classmethod
def poll(cls, context):
sc = context.space_data
if sc.type != 'CLIP_EDITOR':
return False
clip = sc.clip
return clip and clip.tracking.tracks.active
def execute(self, context):
sc = context.space_data
clip = sc.clip
CLIP_default_settings_from_track(clip, clip.tracking.tracks.active)
return {'FINISHED'}

View File

@@ -20,7 +20,10 @@
import bpy
from bpy.types import Operator
from bpy.props import StringProperty, BoolProperty, EnumProperty, IntProperty
from bpy.props import (StringProperty,
BoolProperty,
EnumProperty,
IntProperty)
class SelectPattern(Operator):
@@ -54,7 +57,7 @@ class SelectPattern(Operator):
pattern_match = fnmatch.fnmatchcase
else:
pattern_match = (lambda a, b:
fnmatch.fnmatchcase(a.upper(), b.upper()))
fnmatch.fnmatchcase(a.upper(), b.upper()))
is_ebone = False
obj = context.object
if obj and obj.mode == 'POSE':
@@ -489,9 +492,8 @@ class ShapeTransfer(Operator):
return (obj and obj.mode != 'EDIT')
def execute(self, context):
C = bpy.context
ob_act = C.active_object
objects = [ob for ob in C.selected_editable_objects if ob != ob_act]
ob_act = context.active_object
objects = [ob for ob in context.selected_editable_objects if ob != ob_act]
if 1: # swap from/to, means we cant copy to many at once.
if len(objects) != 1:
@@ -585,11 +587,6 @@ class MakeDupliFace(Operator):
bl_idname = "object.make_dupli_face"
bl_label = "Make Dupli-Face"
@classmethod
def poll(cls, context):
obj = context.active_object
return (obj and obj.type == 'MESH')
def _main(self, context):
from mathutils import Vector
@@ -601,22 +598,22 @@ class MakeDupliFace(Operator):
Vector((-offset, +offset, 0.0)),
)
def matrix_to_quat(matrix):
def matrix_to_quad(matrix):
# scale = matrix.median_scale
trans = matrix.to_translation()
rot = matrix.to_3x3() # also contains scale
return [(rot * b) + trans for b in base_tri]
scene = bpy.context.scene
scene = context.scene
linked = {}
for obj in bpy.context.selected_objects:
for obj in context.selected_objects:
data = obj.data
if data:
linked.setdefault(data, []).append(obj)
for data, objects in linked.items():
face_verts = [axis for obj in objects
for v in matrix_to_quat(obj.matrix_world)
for v in matrix_to_quad(obj.matrix_world)
for axis in v]
faces = list(range(len(face_verts) // 3))

View File

@@ -409,7 +409,10 @@ class AddPresetTrackingSettings(AddPresetBase, Operator):
"settings.default_search_size",
"settings.default_frames_limit",
"settings.default_pattern_match",
"settings.default_margin"
"settings.default_margin",
"settings.use_default_red_channel",
"settings.use_default_green_channel",
"settings.use_default_blue_channel"
]
preset_subdir = "tracking_settings"

View File

@@ -226,10 +226,10 @@ class DATA_PT_shape_keys(MeshButtonsPanel, Panel):
row.alignment = 'RIGHT'
sub = row.row(align=True)
sub.label() # XXX, for alignment only
subsub = sub.row(align=True)
subsub.active = enable_edit_value
subsub.prop(ob, "show_only_shape_key", text="")
subsub.prop(kb, "mute", text="")
sub.prop(ob, "use_shape_key_edit_mode", text="")
sub = row.row()

View File

@@ -434,25 +434,28 @@ class ConstraintButtonsPanel():
def ACTION(self, context, layout, con):
self.target_template(layout, con)
layout.prop(con, "action")
layout.prop(con, "transform_channel")
split = layout.split()
col = split.column(align=True)
col.label(text="Action Length:")
col.prop(con, "frame_start", text="Start")
col.prop(con, "frame_end", text="End")
col = split.column()
col.label(text="From Target:")
col.prop(con, "transform_channel", text="")
col.prop(con, "target_space", text="")
col = split.column()
col.label(text="To Action:")
col.prop(con, "action", text="")
split = layout.split()
col = split.column(align=True)
col.label(text="Target Range:")
col.prop(con, "min", text="Min")
col.prop(con, "max", text="Max")
row = layout.row()
row.label(text="Convert:")
row.prop(con, "target_space", text="")
col = split.column(align=True)
col.label(text="Action Range:")
col.prop(con, "frame_start", text="Start")
col.prop(con, "frame_end", text="End")
def LOCKED_TRACK(self, context, layout, con):
self.target_template(layout, con)

View File

@@ -85,6 +85,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
col.label()
col.prop(fluid, "use_speed_vectors")
col.prop(fluid, "use_reverse_frames")
col.prop(fluid, "frame_offset", text="Offset")
layout.prop(fluid, "filepath", text="")

View File

@@ -127,6 +127,13 @@ class CLIP_PT_tools_marker(Panel):
col.separator()
row = col.row(align=True)
row.prop(settings, "use_default_red_channel", text="R", toggle=True)
row.prop(settings, "use_default_green_channel", text="G", toggle=True)
row.prop(settings, "use_default_blue_channel", text="B", toggle=True)
col.separator()
sub = col.column(align=True)
sub.prop(settings, "default_pattern_size")
sub.prop(settings, "default_search_size")
@@ -147,6 +154,9 @@ class CLIP_PT_tools_marker(Panel):
col.label(text="Match:")
col.prop(settings, "default_pattern_match", text="")
col.separator()
col.operator('clip.track_settings_as_default', text="Copy From Active Track")
class CLIP_PT_tools_tracking(Panel):
bl_space_type = 'CLIP_EDITOR'
@@ -710,17 +720,21 @@ class CLIP_PT_proxy(Panel):
layout.active = clip.use_proxy
layout.label(text="Build Sizes:")
layout.label(text="Build Original:")
row = layout.row()
row.prop(clip.proxy, "build_25")
row.prop(clip.proxy, "build_50")
row = layout.row(align=True)
row.prop(clip.proxy, "build_25", toggle=True)
row.prop(clip.proxy, "build_50", toggle=True)
row.prop(clip.proxy, "build_75", toggle=True)
row.prop(clip.proxy, "build_100", toggle=True)
row = layout.row()
row.prop(clip.proxy, "build_75")
row.prop(clip.proxy, "build_100")
layout.label(text="Build Undistorted:")
layout.prop(clip.proxy, "build_undistorted")
row = layout.row(align=True)
row.prop(clip.proxy, "build_undistorted_25", toggle=True)
row.prop(clip.proxy, "build_undistorted_50", toggle=True)
row.prop(clip.proxy, "build_undistorted_75", toggle=True)
row.prop(clip.proxy, "build_undistorted_100", toggle=True)
layout.prop(clip.proxy, "quality")
@@ -728,7 +742,7 @@ class CLIP_PT_proxy(Panel):
if clip.use_proxy_custom_directory:
layout.prop(clip.proxy, "directory")
layout.operator("clip.rebuild_proxy", text="Rebuild Proxy")
layout.operator("clip.rebuild_proxy", text="Build Proxy")
if clip.source == 'MOVIE':
col = layout.column()

View File

@@ -92,7 +92,7 @@ class IMAGE_MT_select(Menu):
layout = self.layout
layout.operator("uv.select_border").pinned = False
layout.operator("uv.select_border").pinned = True
layout.operator("uv.select_border", text="Border Select Pinned").pinned = True
layout.separator()