[Bf-blender-cvs] [c6a4b469e3a] blender2.8: RNA: Set default for Camera properties

Clément Foucault noreply at git.blender.org
Fri Jul 27 12:17:45 CEST 2018


Commit: c6a4b469e3ac8844dfd66ad03cee38a746e0e01a
Author: Clément Foucault
Date:   Thu Jul 26 12:29:16 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc6a4b469e3ac8844dfd66ad03cee38a746e0e01a

RNA: Set default for Camera properties

Change the default clipend value to match the viewport (1000.0f)

===================================================================

M	source/blender/blenkernel/intern/camera.c
M	source/blender/makesrna/intern/rna_camera.c

===================================================================

diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 87b65601534..1b5995de4f0 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -70,7 +70,7 @@ void BKE_camera_init(Camera *cam)
 	cam->sensor_x = DEFAULT_SENSOR_WIDTH;
 	cam->sensor_y = DEFAULT_SENSOR_HEIGHT;
 	cam->clipsta = 0.1f;
-	cam->clipend = 100.0f;
+	cam->clipend = 1000.0f;
 	cam->drawsize = 0.5f;
 	cam->ortho_scale = 6.0;
 	cam->flag |= CAM_SHOWPASSEPARTOUT;
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 146a8e2738d..8ca45e6dd2d 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -428,6 +428,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "passepartout_alpha", PROP_FLOAT, PROP_FACTOR);
 	RNA_def_property_float_sdna(prop, NULL, "passepartalpha");
+	RNA_def_property_float_default(prop, 0.5f);
 	RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view");
 	RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL);
 
@@ -454,6 +455,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "clipsta");
+	RNA_def_property_float_default(prop, 0.1f);
 	RNA_def_property_range(prop, 1e-6f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
 	RNA_def_property_ui_text(prop, "Clip Start", "Camera near clipping distance");
@@ -461,6 +463,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "clip_end", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "clipend");
+	RNA_def_property_float_default(prop, 1000.0f);
 	RNA_def_property_range(prop, 1e-6f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3);
 	RNA_def_property_ui_text(prop, "Clip End", "Camera far clipping distance");
@@ -468,6 +471,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "lens", PROP_FLOAT, PROP_DISTANCE_CAMERA);
 	RNA_def_property_float_sdna(prop, NULL, "lens");
+	RNA_def_property_float_default(prop, 50.0f);
 	RNA_def_property_range(prop, 1.0f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 1.0f, 5000.0f, 1, 2);
 	RNA_def_property_ui_text(prop, "Focal Length", "Perspective Camera lens value in millimeters");
@@ -475,6 +479,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "sensor_width", PROP_FLOAT, PROP_DISTANCE_CAMERA);
 	RNA_def_property_float_sdna(prop, NULL, "sensor_x");
+	RNA_def_property_float_default(prop, 36.0f);
 	RNA_def_property_range(prop, 1.0f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
 	RNA_def_property_ui_text(prop, "Sensor Width", "Horizontal size of the image sensor area in millimeters");
@@ -482,6 +487,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "sensor_height", PROP_FLOAT, PROP_DISTANCE_CAMERA);
 	RNA_def_property_float_sdna(prop, NULL, "sensor_y");
+	RNA_def_property_float_default(prop, 34.0f);
 	RNA_def_property_range(prop, 1.0f, FLT_MAX);
 	RNA_def_property_ui_range(prop, 1.0f, 100.f, 1, 2);
 	RNA_def_property_ui_text(prop, "Sensor Height", "Vertical size of the image sensor area in millimeters");
@@ -489,6 +495,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "ortho_scale", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "ortho_scale");
+	RNA_def_property_float_default(prop, 6.0f);
 	RNA_def_property_range(prop, FLT_MIN, FLT_MAX);
 	RNA_def_property_ui_range(prop, 0.001f, 10000.0f, 10, 3);
 	RNA_def_property_ui_text(prop, "Orthographic Scale", "Orthographic Camera scale (similar to zoom)");
@@ -496,6 +503,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
 	RNA_def_property_float_sdna(prop, NULL, "drawsize");
+	RNA_def_property_float_default(prop, 1.0f);
 	RNA_def_property_range(prop, 0.01f, 1000.0f);
 	RNA_def_property_ui_range(prop, 0.01, 100, 1, 2);
 	RNA_def_property_ui_text(prop, "Draw Size", "Apparent size of the Camera object in the 3D View");
@@ -542,6 +550,7 @@ void RNA_def_camera(BlenderRNA *brna)
 
 	prop = RNA_def_property(srna, "show_passepartout", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", CAM_SHOWPASSEPARTOUT);
+	RNA_def_property_boolean_default(prop, true);
 	RNA_def_property_ui_text(prop, "Show Passepartout",
 	                         "Show a darkened overlay outside the image area in Camera view");
 	RNA_def_property_update(prop, NC_CAMERA | ND_DRAW_RENDER_VIEWPORT, NULL);



More information about the Bf-blender-cvs mailing list