forked from bartvdbraak/blender
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.
This commit is contained in:
parent
042fe910aa
commit
0ac90cabe1
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -1340,6 +1340,64 @@ static void rna_def_mesh(BlenderRNA *brna)
|
||||
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");
|
||||
|
||||
RNA_api_mesh(srna);
|
||||
|
Loading…
Reference in New Issue
Block a user