Revision: 22284
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22284
Author:   dingto
Date:     2009-08-07 01:34:14 +0200 (Fri, 07 Aug 2009)

Log Message:
-----------
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.

Modified Paths:
--------------
    branches/blender2.5/blender/release/ui/buttons_data_mesh.py
    branches/blender2.5/blender/source/blender/makesdna/DNA_mesh_types.h
    branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c

Modified: branches/blender2.5/blender/release/ui/buttons_data_mesh.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-08-06 
23:19:05 UTC (rev 22283)
+++ branches/blender2.5/blender/release/ui/buttons_data_mesh.py 2009-08-06 
23:34:14 UTC (rev 22284)
@@ -44,10 +44,40 @@
                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 @@
 
 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)

Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_mesh_types.h
===================================================================
--- branches/blender2.5/blender/source/blender/makesdna/DNA_mesh_types.h        
2009-08-06 23:19:05 UTC (rev 22283)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_mesh_types.h        
2009-08-06 23:34:14 UTC (rev 22284)
@@ -139,7 +139,7 @@
 #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)

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c
===================================================================
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c       
2009-08-06 23:19:05 UTC (rev 22283)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c       
2009-08-06 23:34:14 UTC (rev 22284)
@@ -1339,6 +1339,64 @@
        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");
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to