[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39069] branches/soc-2011-tomato: Camera tracking integration
Sergey Sharybin
g.ulairi at gmail.com
Fri Aug 5 13:43:09 CEST 2011
Revision: 39069
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39069
Author: nazgul
Date: 2011-08-05 11:43:09 +0000 (Fri, 05 Aug 2011)
Log Message:
-----------
Camera tracking integration
===========================
Added back Scale factor for scene orientation in toolshelf.
But now it's used in a bit other way -- invoke function
checks if operator's property is set and if not -- value
set in toolshelf is used.
Modified Paths:
--------------
branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c
branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
branches/soc-2011-tomato/source/blender/makesdna/DNA_tracking_types.h
branches/soc-2011-tomato/source/blender/makesrna/intern/rna_tracking.c
Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py 2011-08-05 11:31:41 UTC (rev 39068)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_clip.py 2011-08-05 11:43:09 UTC (rev 39069)
@@ -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-tomato/source/blender/blenkernel/intern/movieclip.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c 2011-08-05 11:31:41 UTC (rev 39068)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/movieclip.c 2011-08-05 11:43:09 UTC (rev 39069)
@@ -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-tomato/source/blender/editors/space_clip/tracking_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c 2011-08-05 11:31:41 UTC (rev 39068)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c 2011-08-05 11:43:09 UTC (rev 39069)
@@ -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-tomato/source/blender/makesdna/DNA_tracking_types.h
===================================================================
--- branches/soc-2011-tomato/source/blender/makesdna/DNA_tracking_types.h 2011-08-05 11:31:41 UTC (rev 39068)
+++ branches/soc-2011-tomato/source/blender/makesdna/DNA_tracking_types.h 2011-08-05 11:43:09 UTC (rev 39069)
@@ -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-tomato/source/blender/makesrna/intern/rna_tracking.c
===================================================================
--- branches/soc-2011-tomato/source/blender/makesrna/intern/rna_tracking.c 2011-08-05 11:31:41 UTC (rev 39068)
+++ branches/soc-2011-tomato/source/blender/makesrna/intern/rna_tracking.c 2011-08-05 11:43:09 UTC (rev 39069)
@@ -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