diff options
author | Thomas Dinges <blender@dingto.org> | 2009-08-07 03:34:14 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2009-08-07 03:34:14 +0400 |
commit | 0ac90cabe142d685d12662bb12be3775cd58e335 (patch) | |
tree | ee8455acbf960141bcc3741476ec085a146fddf0 | |
parent | 042fe910aaea3e863cdd21a3b6c05a3a249b34d9 (diff) |
2.5 Mesh Draw Options: [WIP]
* Added RNA for Mesh Draw Options.
* Added "Draw" Options into the Mesh Data Tab, needs check for Edit Mode.
* Fixed a typo in DNA.
-rw-r--r-- | release/ui/buttons_data_mesh.py | 37 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_mesh_types.h | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_mesh.c | 58 |
3 files changed, 93 insertions, 4 deletions
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py index e8ab59a96dd..3930d1029da 100644 --- a/release/ui/buttons_data_mesh.py +++ b/release/ui/buttons_data_mesh.py @@ -44,9 +44,39 @@ class DATA_PT_normals(DataButtonsPanel): sub.active = mesh.autosmooth sub.itemR(mesh, "autosmooth_angle", text="Angle") - sub = split.column() - sub.itemR(mesh, "vertex_normal_flip") - sub.itemR(mesh, "double_sided") + col = split.column() + col.itemR(mesh, "vertex_normal_flip") + col.itemR(mesh, "double_sided") + +class DATA_PT_meshdraw(DataButtonsPanel): + __label__ = "Draw" + + def draw(self, context): + layout = self.layout + + mesh = context.mesh + + layout.itemL(text="Edit Mode only, WIP") + + split = layout.split() + + col = split.column() + col.itemR(mesh, "draw_edges", text="Edges") + col.itemR(mesh, "draw_faces", text="Faces") + col.itemR(mesh, "draw_creases", text="Creases") + col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights") + col.itemR(mesh, "draw_seams", text="Seams") + col.itemR(mesh, "draw_sharp", text="Sharp") + + col = split.column() + col.itemR(mesh, "draw_normals", text="Face Normals") + col.itemR(mesh, "draw_vertex_normals", text="Vertex Normals") + + col.itemS() + + col.itemR(mesh, "draw_edge_lenght") + col.itemR(mesh, "draw_edge_angle") + col.itemR(mesh, "draw_face_area") class DATA_PT_vertex_groups(DataButtonsPanel): __label__ = "Vertex Groups" @@ -194,6 +224,7 @@ class DATA_PT_vertex_colors(DataButtonsPanel): bpy.types.register(DATA_PT_context_mesh) bpy.types.register(DATA_PT_normals) +bpy.types.register(DATA_PT_meshdraw) bpy.types.register(DATA_PT_vertex_groups) bpy.types.register(DATA_PT_shape_keys) bpy.types.register(DATA_PT_uv_texture) diff --git a/source/blender/makesdna/DNA_mesh_types.h b/source/blender/makesdna/DNA_mesh_types.h index 3ecfe416c79..f7f1d3b53bd 100644 --- a/source/blender/makesdna/DNA_mesh_types.h +++ b/source/blender/makesdna/DNA_mesh_types.h @@ -139,7 +139,7 @@ typedef struct TFace { #define ME_DRAWCREASES (1 << 6) #define ME_DRAWSEAMS (1 << 7) #define ME_DRAWSHARP (1 << 8) -#define ME_DRAWBWEIGHTS (1 << 8) +#define ME_DRAWBWEIGHTS (1 << 9) #define ME_DRAW_EDGELEN (1 << 10) #define ME_DRAW_FACEAREA (1 << 11) diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 525814f1f5e..769c4f485fa 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1339,6 +1339,64 @@ static void rna_def_mesh(BlenderRNA *brna) prop= RNA_def_property(srna, "shape_keys", PROP_POINTER, PROP_NONE); RNA_def_property_pointer_sdna(prop, NULL, "key"); RNA_def_property_ui_text(prop, "Shape Keys", ""); + + /* Mesh Draw Options for Edit Mode*/ + + prop= RNA_def_property(srna, "draw_edges", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEDGES); + RNA_def_property_ui_text(prop, "Draw Edges", "Displays selected edges using hilights in the 3d view and UV editor"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_faces", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWFACES); + RNA_def_property_ui_text(prop, "Draw Faces", "Displays all faces as shades in the 3d view and UV editor"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWNORMALS); + RNA_def_property_ui_text(prop, "Draw Normals", "Displays face normals as lines"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_vertex_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_VNORMALS); + RNA_def_property_ui_text(prop, "Draw Vertex Normals", "Displays vertex normals as lines"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_creases", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWCREASES); + RNA_def_property_ui_text(prop, "Draw Creases", "Displays creases created for subsurf weighting"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_bevel_weights", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWBWEIGHTS); + RNA_def_property_ui_text(prop, "Draw Bevel Weights", "Displays weights created for the Bevel modifier"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_seams", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSEAMS); + RNA_def_property_ui_text(prop, "Draw Seams", "Displays UV unwrapping seams"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_sharp", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWSHARP); + RNA_def_property_ui_text(prop, "Draw Sharp", "Displays sharp edges, used with the EdgeSplit modifier"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + + prop= RNA_def_property(srna, "draw_edge_lenght", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGELEN); + RNA_def_property_ui_text(prop, "Edge Length", "Displays selected edge lengths"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_edge_angle", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_EDGEANG); + RNA_def_property_ui_text(prop, "Edge Angles", "Displays the angles in the selected edges in degrees"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); + + prop= RNA_def_property(srna, "draw_face_area", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAW_FACEAREA); + RNA_def_property_ui_text(prop, "Face Area", "Displays the area of selected faces"); + RNA_def_property_update(prop, 0, "rna_Mesh_update_data"); rna_def_texmat_common(srna, "rna_Mesh_texspace_editable"); |