diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-02-05 00:48:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-02-05 00:48:10 +0300 |
commit | 9c5a752c49813ad17ae8123474bf76633ea9054b (patch) | |
tree | 0648807c48877eefba5345620c2bb20fed7cafef /source | |
parent | fe5b216030d7cf376f007ba797d72d04c43d65bd (diff) |
use the camera's lens angle as radians.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_camera.c | 20 |
2 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index a95cc7d1816..e2d1b1dd694 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1028,7 +1028,7 @@ void copy_pose_result(bPose *to, bPose *from) bPoseChannel *pchanto, *pchanfrom; if(to==NULL || from==NULL) { - printf("pose result copy error\n"); // debug temp + printf("pose result copy error to:%p from:%p\n", to, from); // debug temp return; } diff --git a/source/blender/makesrna/intern/rna_camera.c b/source/blender/makesrna/intern/rna_camera.c index 12dc790a1e8..3cf86f02d69 100644 --- a/source/blender/makesrna/intern/rna_camera.c +++ b/source/blender/makesrna/intern/rna_camera.c @@ -49,6 +49,18 @@ static void rna_Camera_lens_update(Main *bmain, Scene *scene, PointerRNA *ptr) cam->angle= 360.0f * atan(16.0f/cam->lens) / M_PI; } +/* only for rad/deg conversion! can remove later */ +static float rna_Camera_angle_get(PointerRNA *ptr) +{ + Camera *cam= ptr->id.data; + return cam->angle * (M_PI / 180.0); +} + +static void rna_Camera_angle_set(PointerRNA *ptr, float value) +{ + Camera *cam= ptr->id.data; + cam->angle= value * (180.0 / M_PI); +} #else @@ -82,10 +94,12 @@ void RNA_def_camera(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Passepartout Alpha", "Opacity (alpha) of the darkened overlay in Camera view."); RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, NULL); - prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE); - RNA_def_property_float_sdna(prop, NULL, "angle"); - RNA_def_property_range(prop, 0.0f, 172.85f); + prop= RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); + //RNA_def_property_float_sdna(prop, NULL, "angle"); + //RNA_def_property_range(prop, 0.0f, 172.85f); + RNA_def_property_range(prop, 0.0f, M_PI * (172.85/180.0)); RNA_def_property_ui_text(prop, "Angle", "Perspective Camera lend field of view in degrees."); + RNA_def_property_float_funcs(prop, "rna_Camera_angle_get", "rna_Camera_angle_set", NULL); /* only for deg/rad conversion */ RNA_def_property_update(prop, NC_OBJECT|ND_DRAW, "rna_Camera_angle_update"); prop= RNA_def_property(srna, "clip_start", PROP_FLOAT, PROP_NONE); |