[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39070] branches/soc-2011-salad: Merging r39052 through r39069 from soc-2011-tomato into soc-2011-salad
Sergey Sharybin
g.ulairi at gmail.com
Fri Aug 5 13:50:37 CEST 2011
Revision: 39070
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39070
Author: nazgul
Date: 2011-08-05 11:50:37 +0000 (Fri, 05 Aug 2011)
Log Message:
-----------
Merging r39052 through r39069 from soc-2011-tomato into soc-2011-salad
Revision Links:
--------------
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39052
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39069
Modified Paths:
--------------
branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c
branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c
branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c
branches/soc-2011-salad/source/blender/makesdna/DNA_tracking_types.h
branches/soc-2011-salad/source/blender/makesrna/intern/rna_tracking.c
Property Changed:
----------------
branches/soc-2011-salad/
Property changes on: branches/soc-2011-salad
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282,38620,38661-38662,39001,39009,39063
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38934
/branches/soc-2011-tomato:36831-39051
/trunk/blender:36834-39050
+ /branches/soc-2010-jwilkins:28499-37009
/branches/soc-2010-nicolasbishop:28448-30783,30792-30793,30797-30798,30815
/branches/soc-2011-carrot:36854,37548,37564,37602,37622,37848,38043,38064,38226,38231,38282,38620,38661-38662,39001,39009,39063
/branches/soc-2011-cucumber:36829-36994
/branches/soc-2011-onion:36833-38309
/branches/soc-2011-pepper:36830-38934
/branches/soc-2011-tomato:36831-39069
/trunk/blender:36834-39050
Modified: branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py 2011-08-05 11:43:09 UTC (rev 39069)
+++ branches/soc-2011-salad/release/scripts/startup/bl_ui/space_clip.py 2011-08-05 11:50:37 UTC (rev 39070)
@@ -188,6 +188,9 @@
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'
+
+ col = layout.column()
+ col.prop(settings, "distance")
col.operator("clip.set_scale")
col = layout.column(align=True)
Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c 2011-08-05 11:43:09 UTC (rev 39069)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/movieclip.c 2011-08-05 11:50:37 UTC (rev 39070)
@@ -238,6 +238,7 @@
clip->tracking.settings.frames_limit= 20;
clip->tracking.settings.keyframe1= 1;
clip->tracking.settings.keyframe2= 30;
+ clip->tracking.settings.dist= 1;
clip->tracking.stabilization.scaleinf= 1.f;
clip->tracking.stabilization.locinf= 1.f;
Modified: branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c
===================================================================
--- branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c 2011-08-05 11:43:09 UTC (rev 39069)
+++ branches/soc-2011-salad/source/blender/blenkernel/intern/tracking.c 2011-08-05 11:50:37 UTC (rev 39070)
@@ -702,14 +702,16 @@
{
TrackContext *track_context;
MovieTrackingTrack *track;
- ListBase tracks= {NULL, NULL};
+ ListBase tracks= {NULL, NULL}, new_tracks= {NULL, NULL};
ListBase *old_tracks= &context->clip->tracking.tracks;
int a, sel_type, newframe;
void *sel;
BKE_movieclip_last_selection(context->clip, &sel_type, &sel);
- /* duplicate currently tracking tracks to list of displaying tracks */
+ /* duplicate currently tracking tracks to temporary list.
+ this is needed to keep names in unique state and it's faster to change names
+ of currently tracking tracks (if needed) */
for(a= 0, track_context= context->track_context; a<context->num_tracks; a++, track_context++) {
int replace_sel= 0;
MovieTrackingTrack *new_track, *old;
@@ -753,19 +755,34 @@
BLI_addtail(&tracks, new_track);
}
- /* move tracks, which could be added by user during tracking */
+ /* move all tracks, which aren't tracking */
track= old_tracks->first;
while(track) {
MovieTrackingTrack *next= track->next;
track->next= track->prev= NULL;
- BLI_addtail(&tracks, track);
+ BLI_addtail(&new_tracks, track);
track= next;
}
- context->clip->tracking.tracks= tracks;
+ /* now move all tracks which are currently tracking and keep their names unique */
+ track= tracks.first;
+ while(track) {
+ MovieTrackingTrack *next= track->next;
+ BLI_remlink(&tracks, track);
+
+ track->next= track->prev= NULL;
+ BLI_addtail(&new_tracks, track);
+
+ BLI_uniquename(&new_tracks, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name));
+
+ track= next;
+ }
+
+ context->clip->tracking.tracks= new_tracks;
+
if(context->backwards) newframe= context->user.framenr+1;
else newframe= context->user.framenr-1;
Modified: branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c
===================================================================
--- branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c 2011-08-05 11:43:09 UTC (rev 39069)
+++ branches/soc-2011-salad/source/blender/editors/space_clip/tracking_ops.c 2011-08-05 11:50:37 UTC (rev 39070)
@@ -2025,6 +2025,18 @@
return OPERATOR_FINISHED;
}
+static int set_scale_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
+{
+ SpaceClip *sc= CTX_wm_space_clip(C);
+ MovieClip *clip= ED_space_clip(sc);
+ float dist= RNA_float_get(op->ptr, "distance");
+
+ if(dist==0.f)
+ RNA_float_set(op->ptr, "distance", clip->tracking.settings.dist);
+
+ return set_scale_exec(C, op);
+}
+
void CLIP_OT_set_scale(wmOperatorType *ot)
{
/* identifiers */
@@ -2034,13 +2046,14 @@
/* api callbacks */
ot->exec= set_scale_exec;
+ ot->invoke= set_scale_invoke;
ot->poll= space_clip_frame_camera_poll;
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
/* properties */
- RNA_def_float(ot->srna, "distance", 1.0f, -FLT_MAX, FLT_MAX,
+ RNA_def_float(ot->srna, "distance", 0.0f, -FLT_MAX, FLT_MAX,
"Distance", "Distance between selected tracks.", -100.0f, 100.0f);
}
Modified: branches/soc-2011-salad/source/blender/makesdna/DNA_tracking_types.h
===================================================================
--- branches/soc-2011-salad/source/blender/makesdna/DNA_tracking_types.h 2011-08-05 11:43:09 UTC (rev 39069)
+++ branches/soc-2011-salad/source/blender/makesdna/DNA_tracking_types.h 2011-08-05 11:50:37 UTC (rev 39070)
@@ -104,6 +104,8 @@
short speed; /* speed of tracking */
short frames_limit; /* number of frames to be tarcked during single tracking session (if TRACKING_FRAMES_LIMIT is set) */
int keyframe1, keyframe2; /* two keyframes for reconstrution initialization */
+ float dist; /* distance between two bundles used for scene scaling */
+ float pad;
} MovieTrackingSettings;
typedef struct MovieTrackingStabilization {
Modified: branches/soc-2011-salad/source/blender/makesrna/intern/rna_tracking.c
===================================================================
--- branches/soc-2011-salad/source/blender/makesrna/intern/rna_tracking.c 2011-08-05 11:43:09 UTC (rev 39069)
+++ branches/soc-2011-salad/source/blender/makesrna/intern/rna_tracking.c 2011-08-05 11:50:37 UTC (rev 39070)
@@ -247,6 +247,12 @@
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_int_sdna(prop, NULL, "keyframe2");
RNA_def_property_ui_text(prop, "Keyframe 2", "Second keyframe used for reconstruction initialization");
+
+ /* distance */
+ prop= RNA_def_property(srna, "distance", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_float_sdna(prop, NULL, "dist");
+ RNA_def_property_ui_text(prop, "Distance", "Distance between two bundles used for scene scaling");
}
static void rna_def_trackingCamera(BlenderRNA *brna)
More information about the Bf-blender-cvs
mailing list