We do have “angle” RNA float properties, which always output values in 
Radians (so no need to convert in code), and shows user either degrees 
or radians, depending on its choice (in Scene buttons)… Could be used 
here, imho! ;)

Le lun. 21 mai 2012 16:05:48 CEST, Jeroen Bakker a écrit :
> Revision: 46844
>            
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46844
> Author:   jbakker
> Date:     2012-05-21 14:05:47 +0000 (Mon, 21 May 2012)
> Log Message:
> -----------
>   * Bokeh Image angle now has rnge from -720 to +720 degrees
>
> Modified Paths:
> --------------
>      
> trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp
>      trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
>
> Modified: 
> trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp
> ===================================================================
> --- 
> trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp
>     2012-05-21 14:05:39 UTC (rev 46843)
> +++ 
> trunk/blender/source/blender/compositor/operations/COM_BokehImageOperation.cpp
>     2012-05-21 14:05:47 UTC (rev 46844)
> @@ -38,7 +38,10 @@
>       this->circularDistance = getWidth()/2;
>       this->flapRad = (M_PI*2)/this->data->flaps;
>       this->flapRadAdd = (this->data->angle/360.0)*M_PI*2;
> -     if (this->flapRadAdd>M_PI) {
> +     while (this->flapRadAdd<0.0f) {
> +             this->flapRadAdd+=M_PI*2;
> +     }
> +     while (this->flapRadAdd>M_PI) {
>               this->flapRadAdd-=M_PI*2;
>       }
>   }
>
> Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
> ===================================================================
> --- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c       
> 2012-05-21 14:05:39 UTC (rev 46843)
> +++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c       
> 2012-05-21 14:05:47 UTC (rev 46844)
> @@ -3111,7 +3111,7 @@
>       prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
>       RNA_def_property_float_sdna(prop, NULL, "angle");
>       RNA_def_property_float_default(prop, 0.0f);
> -     RNA_def_property_range(prop, -0.0f, 360.0f);
> +     RNA_def_property_range(prop, -720.0f, 720.0f);
>       RNA_def_property_ui_text(prop, "Angle", "Angle of the bokeh");
>       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
>
> @@ -3140,7 +3140,7 @@
>       RNA_def_property_float_sdna(prop, NULL, "lensshift");
>       RNA_def_property_float_default(prop, 0.0f);
>       RNA_def_property_range(prop, -1.0f, 1.0f);
> -     RNA_def_property_ui_text(prop, "Lens shift", "Shift of the lens");
> +     RNA_def_property_ui_text(prop, "Lens shift", "Shift of the lens 
> components");
>       RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
>
>   }
>
> _______________________________________________
> Bf-blender-cvs mailing list
> [email protected]
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
>
_______________________________________________
Bf-committers mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-committers

Reply via email to