Page Menu
Home
Search
Configure Global Search
Log In
Files
F16665
multi-axis-grids2.diff
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Harley Acheson (harley)
Nov 13 2013, 3:20 PM
Size
9 KB
Subscribers
None
multi-axis-grids2.diff
View Options
Index: release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- release/scripts/startup/bl_ui/space_view3d.py (revision 36153)
+++ release/scripts/startup/bl_ui/space_view3d.py (working copy)
@@ -2089,24 +2089,42 @@
mesh = ob.data
col.prop(mesh, "show_all_edges")
+
+
+
+
col = layout.column()
col.active = display_all
+
split = col.split(percentage=0.55)
- split.prop(view, "show_floor", text="Grid Floor")
+ split.label(text="Grid Floors:")
+ row = split.row(align=True)
+ row.prop(view, "show_x_floor", text="X", toggle=True)
+ row.prop(view, "show_y_floor", text="Y", toggle=True)
+ row.prop(view, "show_floor", text="Z", toggle=True)
+ split = col.split(percentage=0.55)
+ split.label(text="Axis Lines:")
row = split.row(align=True)
row.prop(view, "show_axis_x", text="X", toggle=True)
row.prop(view, "show_axis_y", text="Y", toggle=True)
row.prop(view, "show_axis_z", text="Z", toggle=True)
sub = col.column(align=True)
- sub.active = (display_all and view.show_floor)
+ sub.active = (display_all and (view.show_floor or view.show_x_floor or view.show_y_floor))
sub.prop(view, "grid_lines", text="Lines")
sub.prop(view, "grid_scale", text="Scale")
subsub = sub.column(align=True)
subsub.active = scene.unit_settings.system == 'NONE'
subsub.prop(view, "grid_subdivisions", text="Subdivisions")
+
+
+
+
+
+
+
col = layout.column()
col.label(text="Shading:")
col.prop(gs, "material_mode", text="")
Index: source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- source/blender/editors/space_view3d/view3d_draw.c (revision 36153)
+++ source/blender/editors/space_view3d/view3d_draw.c (working copy)
@@ -422,12 +422,13 @@
}
#undef GRID_MIN_PX
+
+
static void drawfloor(Scene *scene, View3D *v3d, const char **grid_unit)
{
float vert[3], grid, grid_scale;
- int a, gridlines, emphasise;
- unsigned char col[3], col2[3];
- short draw_line = 0;
+ int a, gridlines, regular, emphasise;
+ unsigned char col[3], col2[3], xcol[3], ycol[3], zcol[3];
vert[2]= 0.0;
@@ -455,113 +456,135 @@
gridlines= v3d->gridlines/2;
grid= gridlines * grid_scale;
+
UI_GetThemeColor3ubv(TH_GRID, col);
UI_GetThemeColor3ubv(TH_BACK, col2);
-
+
/* emphasise division lines lighter instead of darker, if background is darker than grid */
- if ( ((col[0]+col[1]+col[2])/3+10) > (col2[0]+col2[1]+col2[2])/3 )
- emphasise = 20;
- else
- emphasise = -10;
-
- /* draw the Y axis and/or grid lines */
+ if ( ((col[0]+col[1]+col[2])/3+10) > (col2[0]+col2[1]+col2[2])/3 ) {
+ regular = 10;
+ emphasise = 25;
+
+ } else {
+ regular = -10;
+ emphasise = -25;
+ }
+
+
+ UI_make_axis_color(col, xcol, 'X');
+ UI_make_axis_color(col, ycol, 'Y');
+ UI_make_axis_color(col, zcol, 'Z');
+
+
+
+ glBegin(GL_LINES);
+
+
+
for(a= -gridlines;a<=gridlines;a++) {
- if(a==0) {
- /* check for the 'show Y axis' preference */
- if (v3d->gridflag & V3D_SHOW_Y) {
- UI_make_axis_color(col, col2, 'Y');
- glColor3ubv(col2);
-
- draw_line = 1;
- } else if (v3d->gridflag & V3D_SHOW_FLOOR) {
+
+
+ /* draw the grid line floor, with z=0, normal default */
+
+ if ((v3d->gridflag & V3D_SHOW_FLOOR) || ((v3d->gridflag & V3D_SHOW_X) && (a==0))) {
+ if ((v3d->gridflag & V3D_SHOW_X) && (a==0))
+ glColor3ubv(xcol);
+ else if ((a % 10)==0)
UI_ThemeColorShade(TH_GRID, emphasise);
- } else {
- draw_line = 0;
- }
- } else {
- /* check for the 'show grid floor' preference */
- if (v3d->gridflag & V3D_SHOW_FLOOR) {
- if( (a % 10)==0) {
- UI_ThemeColorShade(TH_GRID, emphasise);
- }
- else UI_ThemeColorShade(TH_GRID, 10);
-
- draw_line = 1;
- } else {
- draw_line = 0;
- }
+ else UI_ThemeColorShade(TH_GRID, 0);
+ vert[0]= grid;
+ vert[1]= a * grid_scale;
+ vert[2]= 0;
+ glVertex3fv(vert );
+ vert[0]= -grid;
+ glVertex3fv(vert);
}
-
- if (draw_line) {
- glBegin(GL_LINE_STRIP);
+
+ if ((v3d->gridflag & V3D_SHOW_FLOOR) || ((v3d->gridflag & V3D_SHOW_Y) && (a==0))) {
+ if ((v3d->gridflag & V3D_SHOW_Y) && (a==0))
+ glColor3ubv(ycol);
+ else if ((a % 10)==0)
+ UI_ThemeColorShade(TH_GRID, emphasise);
+ else UI_ThemeColorShade(TH_GRID, regular);
vert[0]= a * grid_scale;
vert[1]= grid;
+ vert[2]= 0;
glVertex3fv(vert);
vert[1]= -grid;
glVertex3fv(vert);
- glEnd();
}
- }
-
- /* draw the X axis and/or grid lines */
- for(a= -gridlines;a<=gridlines;a++) {
- if(a==0) {
- /* check for the 'show X axis' preference */
- if (v3d->gridflag & V3D_SHOW_X) {
- UI_make_axis_color(col, col2, 'X');
- glColor3ubv(col2);
-
- draw_line = 1;
- } else if (v3d->gridflag & V3D_SHOW_FLOOR) {
+
+
+ /* grid line floor with y=0, not normally shown */
+
+ if ((v3d->gridflag & V3D_SHOW_FLOORY) || ((v3d->gridflag & V3D_SHOW_Z) && (a==0))) {
+ if ((v3d->gridflag & V3D_SHOW_Z) && (a==0))
+ glColor3ubv(zcol);
+ else if ((a % 10)==0)
UI_ThemeColorShade(TH_GRID, emphasise);
- } else {
- draw_line = 0;
- }
- } else {
- /* check for the 'show grid floor' preference */
- if (v3d->gridflag & V3D_SHOW_FLOOR) {
- if( (a % 10)==0) {
- UI_ThemeColorShade(TH_GRID, emphasise);
- }
- else UI_ThemeColorShade(TH_GRID, 10);
-
- draw_line = 1;
- } else {
- draw_line = 0;
- }
+ else UI_ThemeColorShade(TH_GRID, regular);
+ vert[0]= a * grid_scale;
+ vert[1]= 0;
+ vert[2]= grid;
+ glVertex3fv(vert );
+ vert[2]= -grid;
+ glVertex3fv(vert);
}
-
- if (draw_line) {
- glBegin(GL_LINE_STRIP);
- vert[1]= a * grid_scale;
+
+
+ if ((v3d->gridflag & V3D_SHOW_FLOORY) && ((a!=0) || (!(v3d->gridflag & V3D_SHOW_X)))) {
+ if ((a % 10)==0)
+ UI_ThemeColorShade(TH_GRID, emphasise);
+ else UI_ThemeColorShade(TH_GRID, regular);
vert[0]= grid;
+ vert[1]= 0;
+ vert[2]= a * grid_scale;
glVertex3fv(vert );
vert[0]= -grid;
glVertex3fv(vert);
- glEnd();
}
+
+
+ /* grid line floor with x=0, not normally shown */
+
+ if ((v3d->gridflag & V3D_SHOW_FLOORX) && ((a!=0) || (!(v3d->gridflag & V3D_SHOW_Z)))) {
+ if ((a % 10)==0)
+ UI_ThemeColorShade(TH_GRID, emphasise);
+ else UI_ThemeColorShade(TH_GRID, regular);
+ vert[0]= 0;
+ vert[1]= a * grid_scale;
+ vert[2]= grid;
+ glVertex3fv(vert );
+ vert[2]= -grid;
+ glVertex3fv(vert);
+ }
+
+ if ((v3d->gridflag & V3D_SHOW_FLOORX) && ((a!=0) || (!(v3d->gridflag & V3D_SHOW_Y)))) {
+ if ((a % 10)==0)
+ UI_ThemeColorShade(TH_GRID, emphasise);
+ else UI_ThemeColorShade(TH_GRID, regular);
+ vert[0]= 0;
+ vert[1]= grid;
+ vert[2]= a * grid_scale;
+ glVertex3fv(vert );
+ vert[1]= -grid;
+ glVertex3fv(vert);
+ }
+
}
+
+
+ glEnd();
+
- /* draw the Z axis line */
- /* check for the 'show Z axis' preference */
- if (v3d->gridflag & V3D_SHOW_Z) {
- UI_make_axis_color(col, col2, 'Z');
- glColor3ubv(col2);
-
- glBegin(GL_LINE_STRIP);
- vert[0]= 0;
- vert[1]= 0;
- vert[2]= grid;
- glVertex3fv(vert );
- vert[2]= -grid;
- glVertex3fv(vert);
- glEnd();
- }
-
if(v3d->zbuf && scene->obedit) glDepthMask(1);
}
+
+
+
+
static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d)
{
short mx,my,co[2];
Index: source/blender/makesdna/DNA_view3d_types.h
===================================================================
--- source/blender/makesdna/DNA_view3d_types.h (revision 36153)
+++ source/blender/makesdna/DNA_view3d_types.h (working copy)
@@ -267,6 +267,8 @@
#define V3D_SHOW_X 2
#define V3D_SHOW_Y 4
#define V3D_SHOW_Z 8
+#define V3D_SHOW_FLOORX 16
+#define V3D_SHOW_FLOORY 32
/* View3d->twtype (bits, we can combine them) */
#define V3D_MANIP_TRANSLATE 1
Index: source/blender/makesrna/intern/rna_space.c
===================================================================
--- source/blender/makesrna/intern/rna_space.c (revision 36153)
+++ source/blender/makesrna/intern/rna_space.c (working copy)
@@ -1158,11 +1158,22 @@
RNA_def_property_range(prop, 1, 1024);
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
prop= RNA_def_property(srna, "show_floor", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOOR);
RNA_def_property_ui_text(prop, "Display Grid Floor", "Show the ground plane grid in perspective view");
RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
-
+
+ prop= RNA_def_property(srna, "show_x_floor", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOORX);
+ RNA_def_property_ui_text(prop, "Display X Grid Floor", "Show the X-axis ground plane grid in perspective view");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
+ prop= RNA_def_property(srna, "show_y_floor", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_FLOORY);
+ RNA_def_property_ui_text(prop, "Display Y Grid Floor", "Show the Y-axis ground plane grid in perspective view");
+ RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL);
+
prop= RNA_def_property(srna, "show_axis_x", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "gridflag", V3D_SHOW_X);
RNA_def_property_ui_text(prop, "Display X Axis", "Show the X axis line in perspective view");
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
19/f1/5378bf808a98f6bd35419c23ed7d
Event Timeline
Log In to Comment