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:
authorCampbell Barton <ideasman42@gmail.com>2018-12-11 05:02:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-11 05:05:32 +0300
commit908b6d8be3c08157bf30e482e6fa848d728eb1ed (patch)
tree19b4716720984adba83d29e21e9f609d09f4d6db /source/blender/makesrna/intern/rna_camera.c
parent642c315bae13ccb418ec767e6f29ca4e450dde5d (diff)
Fix T52051: Orthographic camera display size error
It was impractical to create a small orthographic camera with a usable size in the view-port. No longer scale the draw-size by ortho-size.
Diffstat (limited to 'source/blender/makesrna/intern/rna_camera.c')
-rw-r--r--source/blender/makesrna/intern/rna_camera.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c
index 981ae75e7c5..c1a76b1627a 100644
--- a/source/blender/makesrna/intern/rna_camera.c
+++ b/source/blender/makesrna/intern/rna_camera.c
@@ -45,6 +45,18 @@
#include "WM_api.h"
+static float rna_Camera_draw_size_get(PointerRNA *ptr)
+{
+ Camera *cam = ptr->id.data;
+ return cam->drawsize * 2.0f;
+}
+
+static void rna_Camera_draw_size_set(PointerRNA *ptr, float value)
+{
+ Camera *cam = ptr->id.data;
+ cam->drawsize = value / 2.0f;
+}
+
static float rna_Camera_angle_get(PointerRNA *ptr)
{
Camera *cam = ptr->id.data;
@@ -309,7 +321,11 @@ void RNA_def_camera(BlenderRNA *brna)
RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update");
prop = RNA_def_property(srna, "draw_size", PROP_FLOAT, PROP_DISTANCE);
+#if 0
RNA_def_property_float_sdna(prop, NULL, "drawsize");
+#else
+ RNA_def_property_float_funcs(prop, "rna_Camera_draw_size_get", "rna_Camera_draw_size_set", NULL);
+#endif
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");