Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2011-11-16 14:00:02 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2011-11-16 14:00:02 +0400
commit01af54c4647f838e3e48bf7ffeb19e1729fc0c93 (patch)
tree72e805952bb5e0c55f5a7c9bb718e9dbacba3ec6 /source/blender/makesrna
parentba7fbf6ae73ff488300b1e22d440cba0b0bd89cc (diff)
Camera tracking: forbid focal length=0 and small code cleanup
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_tracking.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c
index 368359925c4..73b2914fba1 100644
--- a/source/blender/makesrna/intern/rna_tracking.c
+++ b/source/blender/makesrna/intern/rna_tracking.c
@@ -169,7 +169,8 @@ static void rna_trackingCamera_focal_mm_set(PointerRNA *ptr, float value)
if(clip->lastsize[0])
value= clip->lastsize[0]*value/camera->sensor_width;
- camera->focal= value;
+ if(value>=0.0001)
+ camera->focal= value;
}
static int rna_track_2d_stabilization(CollectionPropertyIterator *UNUSED(iter), void *data)
@@ -372,7 +373,7 @@ static void rna_def_trackingCamera(BlenderRNA *brna)
/* Focal Length */
prop= RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "focal");
- RNA_def_property_range(prop, 0.0f, 5000.0f);
+ RNA_def_property_range(prop, 0.0001f, 5000.0f);
RNA_def_property_float_funcs(prop, "rna_trackingCamera_focal_mm_get", "rna_trackingCamera_focal_mm_set", NULL);
RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length");
RNA_def_property_update(prop, NC_MOVIECLIP|NA_EDITED, NULL);