diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-18 21:09:56 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-18 21:09:56 +0400 |
commit | 5c72a19c09a8066b0cbe49730dc129bd93d5857a (patch) | |
tree | 0afce5d4f7636b17082ab830e5e49419b4af1fb8 /source/blender/makesrna | |
parent | feeab1ad53f1b7cd4496fb8e7f173f21e460aac0 (diff) |
add display mode for sharp edges.
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 11 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 19 |
2 files changed, 29 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 56d93cc1d3b..4386ae0cf1d 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -129,6 +129,15 @@ static void rna_Mesh_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) } } +static void rna_Mesh_update_statvis(Main *bmain, Scene *scene, PointerRNA *ptr) +{ + Mesh *me = rna_mesh(ptr); + rna_Mesh_update_data(bmain, scene, ptr); + if (me->edit_btmesh) { + BKE_editmesh_color_free(me->edit_btmesh); + } +} + static void rna_Mesh_update_select(Main *bmain, Scene *scene, PointerRNA *ptr) { ID *id = ptr->id.data; @@ -2957,7 +2966,7 @@ static void rna_def_mesh(BlenderRNA *brna) prop = RNA_def_property(srna, "show_statvis", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_STATVIS); RNA_def_property_ui_text(prop, "Stat Vis", "Display statistical information about the mesh"); - RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_statvis"); prop = RNA_def_property(srna, "show_extra_edge_length", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_EDGELEN); diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 1ff2805f4e2..d5aea5d2585 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2010,6 +2010,7 @@ static void rna_def_statvis(BlenderRNA *brna) {SCE_STATVIS_THICKNESS, "THICKNESS", 0, "Thickness", ""}, {SCE_STATVIS_INTERSECT, "INTERSECT", 0, "Intersect", ""}, {SCE_STATVIS_DISTORT, "DISTORT", 0, "Distort", ""}, + {SCE_STATVIS_SHARP, "SHARP", 0, "Sharp", ""}, {0, NULL, 0, NULL, NULL}}; srna = RNA_def_struct(brna, "MeshStatVis", NULL); @@ -2069,6 +2070,7 @@ static void rna_def_statvis(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Samples", "Number of samples to test per face"); RNA_def_property_update(prop, 0, "rna_EditMesh_update"); + /* distort */ prop = RNA_def_property(srna, "distort_min", PROP_FLOAT, PROP_ANGLE); RNA_def_property_float_sdna(prop, NULL, "distort_min"); RNA_def_property_float_default(prop, 0.5f); @@ -2084,6 +2086,23 @@ static void rna_def_statvis(BlenderRNA *brna) RNA_def_property_ui_range(prop, 0.0f, DEG2RADF(180.0f), 0.001, 3); RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display"); RNA_def_property_update(prop, 0, "rna_EditMesh_update"); + + /* sharp */ + prop = RNA_def_property(srna, "sharp_min", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "sharp_min"); + RNA_def_property_float_default(prop, 0.5f); + RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f)); + RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 0.001, 3); + RNA_def_property_ui_text(prop, "Distort Min", "Minimum angle to display"); + RNA_def_property_update(prop, 0, "rna_EditMesh_update"); + + prop = RNA_def_property(srna, "sharp_max", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "sharp_max"); + RNA_def_property_float_default(prop, 0.5f); + RNA_def_property_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f)); + RNA_def_property_ui_range(prop, -DEG2RADF(180.0f), DEG2RADF(180.0f), 0.001, 3); + RNA_def_property_ui_text(prop, "Distort Max", "Maximum angle to display"); + RNA_def_property_update(prop, 0, "rna_EditMesh_update"); } static void rna_def_unit_settings(BlenderRNA *brna) |