svn merge ^/trunk/blender -r43117:43124
This commit is contained in:
@@ -60,6 +60,22 @@ def CLIP_set_viewport_background(context, all_screens, clip, clip_user):
|
|||||||
set_background, clip, clip_user)
|
set_background, clip, clip_user)
|
||||||
|
|
||||||
|
|
||||||
|
def CLIP_camera_for_clip(context, clip):
|
||||||
|
scene = context.scene
|
||||||
|
|
||||||
|
camera = scene.camera
|
||||||
|
|
||||||
|
for ob in scene.objects:
|
||||||
|
if ob.type == 'CAMERA':
|
||||||
|
for con in ob.constraints:
|
||||||
|
if con.type == 'CAMERA_SOLVER':
|
||||||
|
cur_clip = scene.clip if con.use_active_clip else con.clip
|
||||||
|
|
||||||
|
if cur_clip == clip:
|
||||||
|
return ob
|
||||||
|
|
||||||
|
return camera
|
||||||
|
|
||||||
def CLIP_track_view_selected(sc, track):
|
def CLIP_track_view_selected(sc, track):
|
||||||
if track.select_anchor:
|
if track.select_anchor:
|
||||||
return True
|
return True
|
||||||
@@ -80,7 +96,7 @@ class CLIP_OT_track_to_empty(Operator):
|
|||||||
bl_label = "Link Empty to Track"
|
bl_label = "Link Empty to Track"
|
||||||
bl_options = {'UNDO', 'REGISTER'}
|
bl_options = {'UNDO', 'REGISTER'}
|
||||||
|
|
||||||
def _link_track(self, context, track):
|
def _link_track(self, context, clip, tracking_object, track):
|
||||||
sc = context.space_data
|
sc = context.space_data
|
||||||
constraint = None
|
constraint = None
|
||||||
ob = None
|
ob = None
|
||||||
@@ -101,14 +117,17 @@ class CLIP_OT_track_to_empty(Operator):
|
|||||||
constraint.clip = sc.clip
|
constraint.clip = sc.clip
|
||||||
constraint.track = track.name
|
constraint.track = track.name
|
||||||
constraint.use_3d_position = False
|
constraint.use_3d_position = False
|
||||||
|
constraint.object = tracking_object.name
|
||||||
|
constraint.camera = CLIP_camera_for_clip(context, clip);
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
sc = context.space_data
|
sc = context.space_data
|
||||||
clip = sc.clip
|
clip = sc.clip
|
||||||
|
tracking_object = clip.tracking.objects.active
|
||||||
|
|
||||||
for track in clip.tracking.tracks:
|
for track in tracking_object.tracks:
|
||||||
if CLIP_track_view_selected(sc, track):
|
if CLIP_track_view_selected(sc, track):
|
||||||
self._link_track(context, track)
|
self._link_track(context, clip, tracking_object ,track)
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
@@ -130,11 +149,12 @@ class CLIP_OT_bundles_to_mesh(Operator):
|
|||||||
|
|
||||||
sc = context.space_data
|
sc = context.space_data
|
||||||
clip = sc.clip
|
clip = sc.clip
|
||||||
|
tracking_object = clip.tracking.objects.active
|
||||||
|
|
||||||
new_verts = []
|
new_verts = []
|
||||||
|
|
||||||
mesh = bpy.data.meshes.new(name="Tracks")
|
mesh = bpy.data.meshes.new(name="Tracks")
|
||||||
for track in clip.tracking.tracks:
|
for track in tracking_object.tracks:
|
||||||
if track.has_bundle:
|
if track.has_bundle:
|
||||||
new_verts.append(track.bundle)
|
new_verts.append(track.bundle)
|
||||||
|
|
||||||
@@ -269,7 +289,7 @@ object's movement caused by this constraint"""
|
|||||||
# TODO: several camera solvers and track followers would fail,
|
# TODO: several camera solvers and track followers would fail,
|
||||||
# but can't think about eal workflow where it'll be useful
|
# but can't think about eal workflow where it'll be useful
|
||||||
for x in ob.constraints:
|
for x in ob.constraints:
|
||||||
if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK'}:
|
if x.type in {'CAMERA_SOLVER', 'FOLLOW_TRACK', 'OBJECT_SOLVER'}:
|
||||||
con = x
|
con = x
|
||||||
|
|
||||||
if not con:
|
if not con:
|
||||||
|
|||||||
@@ -827,8 +827,7 @@ static void bundle_midpoint(Scene *scene, Object *ob, float vec[3])
|
|||||||
|
|
||||||
tracking= &clip->tracking;
|
tracking= &clip->tracking;
|
||||||
|
|
||||||
if(scene->camera)
|
copy_m4_m4(cammat, ob->obmat);
|
||||||
copy_m4_m4(cammat, scene->camera->obmat);
|
|
||||||
|
|
||||||
BKE_get_tracking_mat(scene, ob, mat);
|
BKE_get_tracking_mat(scene, ob, mat);
|
||||||
|
|
||||||
|
|||||||
@@ -768,8 +768,8 @@ static int ffmpeg_decode_video_frame(struct anim * anim)
|
|||||||
== AV_NOPTS_VALUE) ?
|
== AV_NOPTS_VALUE) ?
|
||||||
-1 : (long long int)anim->pFrame->pkt_pts,
|
-1 : (long long int)anim->pFrame->pkt_pts,
|
||||||
(long long int)anim->next_pts);
|
(long long int)anim->next_pts);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
av_free_packet(&anim->next_packet);
|
av_free_packet(&anim->next_packet);
|
||||||
anim->next_packet.stream_index = -1;
|
anim->next_packet.stream_index = -1;
|
||||||
|
|||||||
@@ -305,7 +305,14 @@ static void rna_trackingObject_tracks_begin(CollectionPropertyIterator *iter, Po
|
|||||||
{
|
{
|
||||||
MovieTrackingObject *object= (MovieTrackingObject* )ptr->data;
|
MovieTrackingObject *object= (MovieTrackingObject* )ptr->data;
|
||||||
|
|
||||||
rna_iterator_listbase_begin(iter, &object->tracks, NULL);
|
if(object->flag&TRACKING_OBJECT_CAMERA) {
|
||||||
|
MovieClip *clip= (MovieClip*)ptr->id.data;
|
||||||
|
|
||||||
|
rna_iterator_listbase_begin(iter, &clip->tracking.tracks, NULL);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rna_iterator_listbase_begin(iter, &object->tracks, NULL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static PointerRNA rna_tracking_active_object_get(PointerRNA *ptr)
|
static PointerRNA rna_tracking_active_object_get(PointerRNA *ptr)
|
||||||
|
|||||||
Reference in New Issue
Block a user