Page MenuHome

vis.patch

vis.patch

Index: release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- release/scripts/startup/bl_ui/space_view3d.py (revision 42792)
+++ release/scripts/startup/bl_ui/space_view3d.py (working copy)
@@ -2247,6 +2247,8 @@
col.prop(mesh, "show_extra_edge_length")
col.prop(mesh, "show_extra_face_angle")
col.prop(mesh, "show_extra_face_area")
+ if bpy.app.debug:
+ col.prop(mesh, "show_extra_indices")
class VIEW3D_PT_view3d_curvedisplay(Panel):
Index: source/blender/makesdna/DNA_mesh_types.h
===================================================================
--- source/blender/makesdna/DNA_mesh_types.h (revision 42792)
+++ source/blender/makesdna/DNA_mesh_types.h (working copy)
@@ -162,6 +162,8 @@
#define ME_DRAWEXTRA_FACEAREA (1 << 11)
#define ME_DRAWEXTRA_FACEANG (1 << 12)
+#define ME_DRAWEXTRA_INDICES (1 << 13)
+
/* old global flags:
#define G_DRAWEDGES (1 << 18)
#define G_DRAWFACES (1 << 7)
Index: source/blender/makesrna/intern/rna_mesh.c
===================================================================
--- source/blender/makesrna/intern/rna_mesh.c (revision 42792)
+++ source/blender/makesrna/intern/rna_mesh.c (working copy)
@@ -2132,6 +2132,11 @@
"Display the area of selected faces, using global values when set in the transform panel");
RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+ prop= RNA_def_property(srna, "show_extra_indices", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "drawflag", ME_DRAWEXTRA_INDICES);
+ RNA_def_property_ui_text(prop, "Indices", "Displays the index numbers of selected vertices, edges, and faces");
+ RNA_def_property_update(prop, 0, "rna_Mesh_update_draw");
+
/* editflag */
prop= RNA_def_property(srna, "use_mirror_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "editflag", ME_EDIT_MIRROR_X);
Index: source/blender/editors/space_view3d/drawobject.c
===================================================================
--- source/blender/editors/space_view3d/drawobject.c (revision 42792)
+++ source/blender/editors/space_view3d/drawobject.c (working copy)
@@ -2793,6 +2793,46 @@
}
}
+static void draw_em_indices(View3D *v3d, RegionView3D *rv3d,
+ Object *ob, EditMesh *em)
+{
+ EditEdge *e;
+ EditFace *f;
+ EditVert *v;
+ int i;
+ Mesh *me= ob->data;
+ char val[32];
+ float pos[3];
+ unsigned char col[4];
+
+ /* For now, reuse appropriate theme colors from stats text colors */
+
+ UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col);
+ for (v = em->verts.first, i = 0; v; v = v->next, i++) {
+ if (v->f & SELECT) {
+ sprintf(val, "%d", i);
+ view3d_cached_text_draw_add(v->co, val, 0, V3D_CACHE_TEXT_ASCII, col);
+ }
+ }
+
+ UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col);
+ for (e = em->edges.first, i = 0; e; e = e->next, i++) {
+ if (e->f & SELECT) {
+ sprintf(val, "%d", i);
+ mid_v3_v3v3(pos, e->v1->co, e->v2->co);
+ view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col);
+ }
+ }
+
+ UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col);
+ for (f = em->faces.first, i = 0; f; f = f->next, i++) {
+ if (f->f & SELECT) {
+ sprintf(val, "%d", i);
+ view3d_cached_text_draw_add(f->cent, val, 0, V3D_CACHE_TEXT_ASCII, col);
+ }
+ }
+}
+
static int draw_em_fancy__setFaceOpts(void *UNUSED(userData), int index, int *UNUSED(drawSmooth_r))
{
EditFace *efa = EM_get_face_for_index(index);
@@ -2968,6 +3008,11 @@
{
draw_em_measure_stats(v3d, rv3d, ob, em, &scene->unit);
}
+
+ if ((G.f & G_DEBUG) && (me->drawflag & ME_DRAWEXTRA_INDICES) &&
+ !(v3d->flag2 & V3D_RENDER_OVERRIDE)) {
+ draw_em_indices(v3d, rv3d, ob, em);
+ }
}
if(dt>OB_WIRE) {

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
db/e4/d8ffe36cc9286055ac896bb5dfc9

Event Timeline