diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-11 05:10:56 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-11 05:10:56 +0300 |
commit | 65b930af39bd3c89a2aed97d238c669d8788a892 (patch) | |
tree | 9d1f312b91772f561977603a89627beb3c32cf65 /source/blender | |
parent | 9a8b6d51c129aec9385b83391745ce4ac38e953b (diff) | |
parent | 908b6d8be3c08157bf30e482e6fa848d728eb1ed (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/camera.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 54ce0d3a903..7457fc8b7ad 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -378,7 +378,7 @@ void BKE_camera_view_frame_ex( facy = 0.5f * camera->ortho_scale * r_asp[1] * scale[1]; r_shift[0] = camera->shiftx * camera->ortho_scale * scale[0]; r_shift[1] = camera->shifty * camera->ortho_scale * scale[1]; - depth = do_clip ? -((camera->clipsta * scale[2]) + 0.1f) : -drawsize * camera->ortho_scale * scale[2]; + depth = do_clip ? -((camera->clipsta * scale[2]) + 0.1f) : -(drawsize * 2.0f) * scale[2]; *r_drawsize = 0.5f * camera->ortho_scale; } diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 1e68ab65965..aee14cd3185 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -47,6 +47,18 @@ #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.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; @@ -502,7 +514,11 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Camera_update"); prop = RNA_def_property(srna, "display_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_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); |