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:
authorBastien Montagne <montagne29@wanadoo.fr>2011-11-13 22:03:27 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2011-11-13 22:03:27 +0400
commitfea58943ecf32daa5bd828656d5e1157e6de984a (patch)
tree34a57950730971670ff3b9fae32826609a41363e /source/blender/makesrna
parentc491b8bf459bcb3bdc1e73fbe3c1f95ff096c335 (diff)
Moving all node angle-type values to radians. This also fixes [#29151] rotate node wrong input (mixing up radians and degrees).
Warning! Angles in nodes have just been moved to consistant Radians values (ANGLE subtype of RNA Float property). You will still see them as degrees in the GUI, though, unless you chose otherwise in Scene properties, Units panel. Conversion from degrees to radians for old files is obviously done at loading time, but if you use a mixed pipeline of trunk and releases, be carefull! Loading a 2.60.4 file (or higher) into any previous version of Blender, your angles in nodes will have odd values (well, radians interpreted as degrees)! And if you save such file in a pre-2.60.4 version, the angle node values will be converted again when loaded in Blender 2.60.4 or higher... This affects following nodes: * Compo: Rotate, Defocus, ChromaMatte, Glare and DirectionalBlur * Shader: Mapping And all future code using the TexMapping struct’s rotation part (its rot memember is now in radians).
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c30
-rw-r--r--source/blender/makesrna/intern/rna_texture.c2
2 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 55693f8e53f..35ba9984c79 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1928,17 +1928,17 @@ static void def_cmp_chroma_matte(StructRNA *srna)
RNA_def_struct_sdna_from(srna, "NodeChroma", "storage");
- prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "tolerance", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "t1");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t1_set", NULL);
- RNA_def_property_range(prop, 1.0f, 80.0f);
+ RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(80.0f));
RNA_def_property_ui_text(prop, "Acceptance", "Tolerance for a color to be considered a keying color");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "threshold", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "t2");
RNA_def_property_float_funcs(prop, NULL, "rna_Matte_t2_set", NULL);
- RNA_def_property_range(prop, 0.0f, 30.0f);
+ RNA_def_property_range(prop, 0.0f, DEG2RADF(30.0f));
RNA_def_property_ui_text(prop, "Cutoff", "Tolerance below which colors will be considered as exact matches");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -2103,9 +2103,9 @@ static void def_cmp_defocus(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
/* TODO: angle in degrees */
- prop = RNA_def_property(srna, "angle", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "rotation");
- RNA_def_property_range(prop, 0, 90);
+ prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "rotation");
+ RNA_def_property_range(prop, 0.0f, DEG2RADF(90.0f));
RNA_def_property_ui_text(prop, "Angle", "Bokeh shape rotation offset in degrees");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -2271,15 +2271,15 @@ static void def_cmp_dblur(StructRNA *srna)
RNA_def_property_ui_text(prop, "Distance", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_NONE);
+ 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, 360.0f);
+ RNA_def_property_range(prop, 0.0f, DEG2RADF(360.0f));
RNA_def_property_ui_text(prop, "Angle", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "spin", PROP_FLOAT, PROP_ANGLE);
RNA_def_property_float_sdna(prop, NULL, "spin");
- RNA_def_property_range(prop, -360.0f, 360.0f);
+ RNA_def_property_range(prop, DEG2RADF(-360.0f), DEG2RADF(360.0f));
RNA_def_property_ui_text(prop, "Spin", "");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
@@ -2393,10 +2393,10 @@ static void def_cmp_glare(StructRNA *srna)
RNA_def_property_ui_text(prop, "Streaks", "Total number of streaks");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
- prop = RNA_def_property(srna, "angle_offset", PROP_INT, PROP_NONE);
- RNA_def_property_int_sdna(prop, NULL, "angle_ofs");
- RNA_def_property_range(prop, 0, 180);
- RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset in degrees");
+ prop = RNA_def_property(srna, "angle_offset", PROP_FLOAT, PROP_ANGLE);
+ RNA_def_property_float_sdna(prop, NULL, "angle_ofs");
+ RNA_def_property_range(prop, 0.0f, DEG2RADF(180.0f));
+ RNA_def_property_ui_text(prop, "Angle Offset", "Streak angle offset");
RNA_def_property_update(prop, NC_NODE|NA_EDITED, "rna_Node_update");
prop = RNA_def_property(srna, "fade", PROP_FLOAT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c
index 249bdb4a366..dfbfac75f8c 100644
--- a/source/blender/makesrna/intern/rna_texture.c
+++ b/source/blender/makesrna/intern/rna_texture.c
@@ -472,7 +472,7 @@ static void rna_def_texmapping(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Location", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");
- prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_XYZ); /* Not PROP_EUL, this is already in degrees, not radians */
+ prop= RNA_def_property(srna, "rotation", PROP_FLOAT, PROP_EULER); /* Not PROP_XYZ, this is now in radians, no more degrees */
RNA_def_property_float_sdna(prop, NULL, "rot");
RNA_def_property_ui_text(prop, "Rotation", "");
RNA_def_property_update(prop, 0, "rna_Texture_mapping_update");