[Bf-committers] Infinite Focal Distance

Mark Ayers markthema3 at gmail.com
Fri Nov 22 01:56:59 CET 2013


Allows for infinite focal distance/pixel aspect. Idea taken from the quick
fix page.
-------------- next part --------------
Index: source/blender/makesrna/intern/rna_camera.c
===================================================================
--- source/blender/makesrna/intern/rna_camera.c	(revision 61240)
+++ source/blender/makesrna/intern/rna_camera.c	(working copy)
@@ -187,7 +187,7 @@
 
 	prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_DISTANCE_CAMERA);
 	RNA_def_property_float_sdna(prop, NULL, "lens");
-	RNA_def_property_range(prop, 1.0f, 5000.0f);
+	RNA_def_property_range(prop, 1.0f, FLT_MAX);
 	RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters");
 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
 
@@ -235,7 +235,7 @@
 
 	prop = RNA_def_property(srna, "dof_distance", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "YF_dofdist");
-	RNA_def_property_range(prop, 0.0f, 5000.0f);
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
 	RNA_def_property_ui_text(prop, "DOF Distance", "Distance to the focus point for depth of field");
 	RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, NULL);
 
Index: source/blender/makesrna/intern/rna_image.c
===================================================================
--- source/blender/makesrna/intern/rna_image.c	(revision 61240)
+++ source/blender/makesrna/intern/rna_image.c	(working copy)
@@ -618,7 +618,7 @@
 	prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "aspx");
 	RNA_def_property_array(prop, 2);
-	RNA_def_property_range(prop, 0.1f, 5000.0f);
+	RNA_def_property_range(prop, 0.1f, FLT_MAX);
 	RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this image, does not affect rendering");
 	RNA_def_property_update(prop, NC_IMAGE | ND_DISPLAY, NULL);
 
Index: source/blender/makesrna/intern/rna_movieclip.c
===================================================================
--- source/blender/makesrna/intern/rna_movieclip.c	(revision 61240)
+++ source/blender/makesrna/intern/rna_movieclip.c	(working copy)
@@ -295,8 +295,8 @@
 	prop = RNA_def_property(srna, "display_aspect", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "aspx");
 	RNA_def_property_array(prop, 2);
-	RNA_def_property_range(prop, 0.1f, 5000.0f);
-	RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
+	RNA_def_property_range(prop, 0.1f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.1f, FLT_MAX, 1, 2);
 	RNA_def_property_ui_text(prop, "Display Aspect", "Display Aspect for this clip, does not affect rendering");
 	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, NULL);
 
Index: source/blender/makesrna/intern/rna_tracking.c
===================================================================
--- source/blender/makesrna/intern/rna_tracking.c	(revision 61240)
+++ source/blender/makesrna/intern/rna_tracking.c	(working copy)
@@ -962,7 +962,7 @@
 	prop = RNA_def_property(srna, "focal_length", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "focal");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-	RNA_def_property_range(prop, 0.0001f, 5000.0f);
+	RNA_def_property_range(prop, 0.0001f, FLT_MAX);
 	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);
@@ -971,7 +971,7 @@
 	prop = RNA_def_property(srna, "focal_length_pixels", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "focal");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-	RNA_def_property_range(prop, 0.0f, 5000.0f);
+	RNA_def_property_range(prop, 0.0f, FLT_MAX);
 	RNA_def_property_ui_text(prop, "Focal Length", "Camera's focal length");
 	RNA_def_property_update(prop, NC_MOVIECLIP | NA_EDITED, NULL);
 
@@ -1017,8 +1017,8 @@
 	prop = RNA_def_property(srna, "pixel_aspect", PROP_FLOAT, PROP_XYZ);
 	RNA_def_property_float_sdna(prop, NULL, "pixel_aspect");
 	RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
-	RNA_def_property_range(prop, 0.1f, 5000.0f);
-	RNA_def_property_ui_range(prop, 0.1f, 5000.0f, 1, 2);
+	RNA_def_property_range(prop, 0.1f, FLT_MAX);
+	RNA_def_property_ui_range(prop, 0.1f, FLT_MAX, 1, 2);
 	RNA_def_property_float_default(prop, 1.0f);
 	RNA_def_property_ui_text(prop, "Pixel Aspect Ratio", "Pixel aspect ratio");
 	RNA_def_property_update(prop, NC_MOVIECLIP | ND_DISPLAY, "rna_tracking_flushUpdate");


More information about the Bf-committers mailing list