Page MenuHome

drawsummary_2.patch

Authored By
Gladstone (gladstone)
Nov 13 2013, 1:18 PM
Size
4 KB
Subscribers
None

drawsummary_2.patch

Index: blender/makesdna/DNA_userdef_types.h
===================================================================
--- blender/makesdna/DNA_userdef_types.h (revision 12995)
+++ blender/makesdna/DNA_userdef_types.h (working copy)
@@ -258,7 +258,8 @@
#define USER_SHOW_VIEWPORTNAME (1 << 18)
#define USER_KEYINSERTNEED (1 << 19)
#define USER_ZOOM_TO_MOUSEPOS (1 << 20)
-#define USER_SHOW_FPS (1 << 21)
+#define USER_SHOW_FPS (1 << 21)
+#define USER_SHOW_SUMMARY (1 << 22)
/* transopts */
Index: blender/src/drawview.c
===================================================================
--- blender/src/drawview.c (revision 12995)
+++ blender/src/drawview.c (working copy)
@@ -1387,7 +1394,78 @@
BMF_DrawString(G.fonts, info);
}
+/* Draw a single-line pipe-separated summary for tools options in edit mode */
+static void draw_tools_summary(ScrArea *sa)
+{
+ char str[32];
+ int i = 0;
+ int sz = 0;
+
+ if((G.obedit && (G.obedit->type == OB_MESH || G.obedit->type == OB_CURVE || G.obedit->type == OB_SURF || G.obedit->type == OB_LATTICE)) || G.f & G_PARTICLEEDIT)
+ {
+ /* Occlude background geometry? */
+ if (G.vd->flag & V3D_ZBUF_SELECT)
+ {
+ str[i++] = 'O';
+ str[i++] = 'C';
+ str[i++] = 'D';
+ }
+
+ /* Is proportional mode active? */
+ if (G.scene->proportional)
+ {
+ if (G.vd->flag & V3D_ZBUF_SELECT)
+ {
+ str[i++] = ' ';
+ str[i++] = ' ';
+ str[i++] = '|';
+ str[i++] = ' ';
+ str[i++] = ' ';
+ }
+
+ str[i++] = 'P';
+ str[i++] = 'r';
+ str[i++] = 'o';
+ str[i++] = 'p';
+ str[i++] = ':';
+
+ /* Proportional mode is On */
+ if (G.scene->proportional == 1)
+ {
+ str[i++] = ' ';
+ str[i++] = 'O';
+ str[i++] = 'n';
+ }
+ /* Proportional mode is Connected */
+ else if (G.scene->proportional == 2)
+ {
+ str[i++] = ' ';
+ str[i++] = 'C';
+ str[i++] = 'o';
+ str[i++] = 'n';
+ }
+ }
+
+ /* Other tools options to show in the summary? Add below. */
+ /* Just fill in characters of the str buffer */
+ /* Note: remember the buffer is on the stack, so increase */
+ /* the amount of chars allocated if needed, although */
+ /* a summary longer than 32 chars will probably be */
+ /* too space consuming on the 3d view. */
+
+
+
+ str[i++] = '\0';
+
+ BIF_ThemeColor(TH_TEXT_HI);
+
+ sz = BMF_GetStringWidth(G.fonts, str);
+ glRasterPos2i(sa->winx-sz-20, sa->winy-20);
+
+ BMF_DrawString(G.fonts, str);
+ }
+}
+
/* Draw a live substitute of the view icon, which is always shown */
static void draw_view_axis(void)
{
@@ -3098,6 +3193,9 @@
if(ob && (U.uiflag & USER_DRAWVIEWINFO))
draw_selected_name(ob);
+ if(U.uiflag & USER_SHOW_SUMMARY)
+ draw_tools_summary(sa);
+
draw_area_emboss(sa);
/* it is important to end a view in a transform compatible with buttons */
Index: blender/src/space.c
===================================================================
--- blender/src/space.c (revision 12995)
+++ blender/src/space.c (working copy)
@@ -3358,29 +3358,33 @@
0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButBitI(block, TOG, USER_TOOLTIPS, 0, "Tool Tips",
- (xpos+edgsp),y5,spref,buth,
+ (xpos+edgsp),y5+4,spref,buth-4,
&(U.flag), 0, 0, 0, 0,
"Display tooltips (help tags) over buttons");
uiDefButBitI(block, TOG, USER_DRAWVIEWINFO, B_DRAWINFO, "Object Info",
- (xpos+edgsp),y4,spref,buth,
+ (xpos+edgsp),y4+8,spref,buth-4,
&(U.uiflag), 0, 0, 0, 0,
"Display active object name and frame number in the 3D View");
uiDefButBitI(block, TOG, USER_SCENEGLOBAL, 0, "Global Scene",
- (xpos+edgsp),y3,spref,buth,
+ (xpos+edgsp),y3+12,spref,buth-4,
&(U.flag), 0, 0, 0, 0,
"Forces the current Scene to be displayed in all Screens");
#ifndef __APPLE__
uiDefButBitS(block, TOG, 1, 0, "Large Cursors",
- (xpos+edgsp),y2,spref,buth,
+ (xpos+edgsp),y2+16,spref,buth-4,
&(U.curssize), 0, 0, 0, 0,
"Use large mouse cursors when available");
#else
U.curssize=0; /*Small Cursor always for OS X for now */
#endif
uiDefButBitI(block, TOG, USER_SHOW_VIEWPORTNAME, B_DRAWINFO, "View Name",
- (xpos+edgsp),y1,spref,buth,
+ (xpos+edgsp),y1+20,spref,buth-4,
&(U.uiflag), 0, 0, 0, 0,
"Show the name of the view's direction in each 3D View");
+ uiDefButBitI(block, TOG, USER_SHOW_SUMMARY, B_DRAWINFO, "View Summary",
+ (xpos+edgsp),y1,spref,buth-4,
+ &(U.uiflag), 0, 0, 0, 0,
+ "Show a one-line tools options summary in the 3d View");
uiBlockEndAlign(block);
uiDefBut(block, LABEL,0,"Menus:",

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
9d/08/341811a29430f810fa04b9e1744f

Event Timeline