Feature Request - Update 09/01/06

The interface, modeling, 3d editing tools, import/export, feature requests, etc

Moderators: jesterKing, stiv

wnunes
Posts: 8
Joined: Sat Dec 31, 2005 2:17 pm

Feature Request - Update 09/01/06

Post by wnunes » Fri Jan 06, 2006 2:43 pm

Small suggestions for the next version.

Interface

- Name of vision
View 1
View 2

- Co-ordinated
View 3

- Material color
View 4
View 5

- New appearance
- 0 - 255, Color settings


- Material preview
View 5
View 6
View 7
View 8

- New Tube preview
- New Wire preview
- Background solid or "chess"
- Size of sphere preview


- Object Center
View 9
View 10

Tools

- Object Centers
View 11
View 12
View 13


- Implement those tools
- Insert
- Chamfer


Later i come back with more update :)
Last edited by wnunes on Mon Jan 09, 2006 2:22 pm, edited 2 times in total.

UncleZeiv
Posts: 35
Joined: Mon Aug 29, 2005 1:11 pm

Post by UncleZeiv » Fri Jan 06, 2006 6:59 pm

Yes, I completely agree with this one. Doesn't seem difficult to implement and I can't see any reason for not doing it.

UncleZeiv
Posts: 35
Joined: Mon Aug 29, 2005 1:11 pm

Post by UncleZeiv » Mon Jan 23, 2006 5:21 pm

Ok so: as a would-be blender contributor, I decided that trying to implement some feature proposal that I like could be a good start. In particular, I was curious to see what I could do about your number 3, or "Co-ordinated", as you call it.

So, here's a patch; it's not perfect in many ways, but before working on it any further, I would like to hear some comments.

Code: Select all

diff -u -r1.184 drawview.c
--- drawview.c	15 Jan 2006 13:30:56 -0000	1.184
+++ drawview.c	23 Jan 2006 16:06:39 -0000
@@ -1108,27 +1108,75 @@
 	else sprintf(info, "(%d) %s", CFRA, ob->id.name+2);
 
 	BIF_ThemeColor(TH_TEXT_HI);
-	glRasterPos2i(30,  10);
+	glRasterPos2i(40,  10);
 	BMF_DrawString(G.fonts, info);
 }
 
 
-static void draw_view_icon(void)
+/* Draw a live substitute of the view icon, which is always shown */
+static void draw_view_axis()
 {
-	BIFIconID icon;
-	
-	if(G.vd->view==7) icon= ICON_AXIS_TOP;
-	else if(G.vd->view==1) icon= ICON_AXIS_FRONT;
-	else if(G.vd->view==3) icon= ICON_AXIS_SIDE;
-	else return ;
-
-	glEnable(GL_BLEND);
-	glBlendFunc(GL_SRC_ALPHA,  GL_ONE_MINUS_SRC_ALPHA); 
-	
-	BIF_draw_icon(5.0, 5.0, icon);
-	
-	glBlendFunc(GL_ONE,  GL_ZERO); 
-	glDisable(GL_BLEND);
+	const float k = 8.5;       // axis size
+	const float tag = 1.5;     // placement of axis tag along axis
+	const float toll = 0.5;    // used to see when view is quasi-orthogonal
+	const float start = 16.0f; // axis center in screen coordinates, x=y
+
+	unsigned char col[3];
+	float vec[4];
+	float dx, dy;
+	int i;
+	
+	/* X */
+	vec[0] = vec[3] = 1;
+	vec[1] = vec[2] = 0;
+	QuatMulVecf(G.vd->viewquat, vec);
+	
+	// Not using make_axis_color but the original icon's fixed colors
+	col[0] = 99;
+	col[1] = col[2] = 20;
+	glColor3ubv(col);
+	
+	dx = vec[0] * k;
+	dy = vec[1] * k;
+	fdrawline(start, start, start + dx, start + dy);
+	if (fabs(dx) > toll || fabs(dy) > toll) {
+		glRasterPos2i(start + dx * tag - 2, start + dy * tag - 2);
+		BMF_DrawString(G.fonts, "x");
+	}
+	
+	/* Y */
+	vec[1] = vec[3] = 1;
+	vec[0] = vec[2] = 0;
+	QuatMulVecf(G.vd->viewquat, vec);
+	
+	col[1] = 99;
+	col[0] = col[2] = 20;
+	glColor3ubv(col);
+	
+	dx = vec[0] * k;
+	dy = vec[1] * k;
+	fdrawline(start, start, start + dx, start + dy);
+	if (fabs(dx) > toll || fabs(dy) > toll) {
+		glRasterPos2i(start + dx * tag - 2, start + dy * tag - 2);
+		BMF_DrawString(G.fonts, "y");
+	}
+	
+	/* Z */
+	vec[2] = vec[3] = 1;
+	vec[1] = vec[0] = 0;
+	QuatMulVecf(G.vd->viewquat, vec);
+	
+	col[2] = 99;
+	col[0] = col[1] = 20;
+	glColor3ubv(col);
+	
+	dx = vec[0] * k;
+	dy = vec[1] * k;
+	fdrawline(start, start, start + dx, start + dy);
+	if (fabs(dx) > toll || fabs(dy) > toll) {
+		glRasterPos2i(start + dx * tag - 2, start + dy * tag - 2);
+		BMF_DrawString(G.fonts, "z");
+	}
 }
 
 /* ******************* view3d space & buttons ************** */
@@ -2299,7 +2347,7 @@
 	
 	if(v3d->persp>1) drawviewborder();
 	if(!(G.f & G_PLAYANIM)) drawcursor(v3d);
-	draw_view_icon();
+	draw_view_axis();
 
 	ob= OBACT;
 	if(ob && (U.uiflag & USER_DRAWVIEWINFO)) 

Neo1975
Posts: 2
Joined: Wed Jan 25, 2006 9:06 am

Post by Neo1975 » Wed Jan 25, 2006 10:15 am

This is my patch for 3Dviewndow view point name.

Code: Select all

Index: drawview.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/drawview.c,v
retrieving revision 1.184
diff -u -r1.184 drawview.c
--- drawview.c	15 Jan 2006 13:30:56 -0000	1.184
+++ drawview.c	24 Jan 2006 16:32:19 -0000
@@ -1131,6 +1131,21 @@
 	glDisable(GL_BLEND);
 }
 
+static void draw_viewport_name(ScrArea *sa)
+{
+	char ViewPortName[8];
+	
+	if(G.vd->view==7) sprintf(ViewPortName,"Top");
+	else if(G.vd->view==1) sprintf(ViewPortName,"Front");
+	else if(G.vd->view==3) sprintf(ViewPortName,"Side");
+	else if(G.vd->persp==2) sprintf(ViewPortName,"Camera");
+	else sprintf(ViewPortName,"User");	
+
+	BIF_ThemeColor(TH_TEXT_HI);
+	glRasterPos2i(30,  sa->winy-20);
+	BMF_DrawString(G.fonts, ViewPortName);
+}
+
 /* ******************* view3d space & buttons ************** */
 
 static void view3d_change_bgpic_ima(View3D *v3d, Image *newima) {
@@ -2300,6 +2315,7 @@
 	if(v3d->persp>1) drawviewborder();
 	if(!(G.f & G_PLAYANIM)) drawcursor(v3d);
 	draw_view_icon();
+	draw_viewport_name(sa);
 
 	ob= OBACT;
 	if(ob && (U.uiflag & USER_DRAWVIEWINFO)) 

wnunes
Posts: 8
Joined: Sat Dec 31, 2005 2:17 pm

Post by wnunes » Wed Jan 25, 2006 12:53 pm

where are a compiled blender version?

We want to test. :)

fobsta
Posts: 141
Joined: Sat Jun 12, 2004 11:21 pm

Post by fobsta » Thu Jan 26, 2006 12:15 am

So, here's a patch; it's not perfect in many ways, but before working on it any further, I would like to hear some comments.
I'll have to wait for a blender version with this patch incorporated before I can test your code. I'm sure it will be a very popular addition.

I think you should maybe incorporate an option to turn this new feauture on or off in the preferences.

thanks

Neo1975
Posts: 2
Joined: Wed Jan 25, 2006 9:06 am

Post by Neo1975 » Thu Jan 26, 2006 1:20 pm

here a new version of my patch.
I can compile only a version for linux... As soon as I can I will upload a version with my patch on a site.

Code: Select all

Index: source/blender/makesdna/DNA_view3d_types.h
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/makesdna/DNA_view3d_types.h,v
retrieving revision 1.28
diff -a -u -r1.28 DNA_view3d_types.h
--- source/blender/makesdna/DNA_view3d_types.h	19 Nov 2005 10:55:06 -0000	1.28
+++ source/blender/makesdna/DNA_view3d_types.h	26 Jan 2006 10:59:14 -0000
@@ -131,7 +131,10 @@
 	/* afterdraw, for xray & transparent */
 	struct ListBase afterdraw;
 	/* drawflags, denoting state */
-	short zbuf, transp, xray, pad2;
+	short zbuf, transp, xray;
+	/*Added a Switch for know if viewpoit selected is used eith CTRL*/
+	short viewDirection;
+	
 } View3D;
 
 /* View3D->flag (short) */
Index: source/blender/src/drawview.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/drawview.c,v
retrieving revision 1.184
diff -a -u -r1.184 drawview.c
--- source/blender/src/drawview.c	15 Jan 2006 13:30:56 -0000	1.184
+++ source/blender/src/drawview.c	26 Jan 2006 10:59:25 -0000
@@ -1131,6 +1131,30 @@
 	glDisable(GL_BLEND);
 }
 
+static void draw_viewport_name(ScrArea *sa)
+{
+	char *ViewPortName = "Unknow";
+	
+	switch(G.vd->view) {
+		case 1:
+			ViewPortName = G.vd->viewDirection>=0 ? "Front" : "Back";
+			break;
+		case 3:
+			ViewPortName = G.vd->viewDirection>=0 ? "Right" : "Left";
+			break;
+		case 7:
+			ViewPortName = G.vd->viewDirection>=0 ? "Top" : "Bottom";
+			break;
+		default:
+			ViewPortName = G.vd->persp==V3D_PERSP_USE_THE_CAMERA ? "Camera" : "User";
+		
+	}
+
+	BIF_ThemeColor(TH_TEXT_HI);
+	glRasterPos2i(30,  sa->winy-20);
+	BMF_DrawString(G.fonts, ViewPortName);
+}
+
 /* ******************* view3d space & buttons ************** */
 
 static void view3d_change_bgpic_ima(View3D *v3d, Image *newima) {
@@ -2300,6 +2324,7 @@
 	if(v3d->persp>1) drawviewborder();
 	if(!(G.f & G_PLAYANIM)) drawcursor(v3d);
 	draw_view_icon();
+	draw_viewport_name(sa);
 
 	ob= OBACT;
 	if(ob && (U.uiflag & USER_DRAWVIEWINFO)) 
Index: source/blender/src/toets.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/toets.c,v
retrieving revision 1.67
diff -a -u -r1.67 toets.c
--- source/blender/src/toets.c	17 Dec 2005 14:27:33 -0000	1.67
+++ source/blender/src/toets.c	26 Jan 2006 10:59:27 -0000
@@ -287,6 +287,10 @@
 		}
 	}
 	else if((G.qual & (LR_SHIFTKEY | LR_CTRLKEY)) && (event != PAD0)) {
+		
+		/*Indicate that this view is obtained by CTRL*/
+		G.vd->viewDirection=-1;
+		
 		if(event==PAD0) {
 			/* G.vd->persp= 3; */
 		}
@@ -346,6 +350,8 @@
 		}
 	}
 	else {
+		/*Indicate that this view is obtained widthout CTRL*/
+		G.vd->viewDirection=1;
 
 		if(event==PAD7) {
 			G.vd->viewquat[0]= 1.0;

vizzy
Posts: 23
Joined: Tue Feb 28, 2006 12:36 am

binary version for linux

Post by vizzy » Tue Feb 28, 2006 12:41 am

i added the current patch to cvs, (special thx to UnNamed and lukeP for their gret help) and compiled latest cvs version with it. great stuff. if anyone is interested in testing that version, here it is:
http://www.vizzy.de//Files/PUB/verblend ... pnames.tgz

its for linux i3/686, compiled in fedora3, latest cvs

oh, there is another patch from me (involved by Unnamed too) , pressing q you get a warning, use strg+q for quitting Blender instead :), and before quitting an autosave i called....,

cortex patch also applied (sorry i was funny), only a name change, find the easteregg :)
and... gameengine is disabled

(im not a coder or so, just played with that patch and added it, so i cant say anything about coding style or usability, i just found it a great improvement)

anyone interested in diffs? i could make some then.

yours vizzy
alias verblendet

vizzy
Posts: 23
Joined: Tue Feb 28, 2006 12:36 am

...update...., cvs binary with viewportnames, rotating axis.

Post by vizzy » Tue Feb 28, 2006 2:33 am

i also added another patch found at http://www.blender.it/forum/viewtopic.php?p=23826
it changes the axis to a 3d rotating axis on the lower left corner of the 3d view, wooohooo
here it is, with same patches as above, latest cvs, ... using maxthreads=4 too :)

preview: Image
and the binary:
http://www.vizzy.de//Files/PUB/verblend ... 3daxis.tgz

thx for that real great peace of code!!!

yours vizzy/verblendet

fobsta
Posts: 141
Joined: Sat Jun 12, 2004 11:21 pm

Post by fobsta » Fri Mar 03, 2006 1:04 am

Vizzy thank you for this build

A few comments about the 3d rotating axis

Can you make it bigger? I think it might be too small.

I think the 3d rotating axis should be drawn with perspective when in perpective mode. At the moment it's always orthographic

keep up the good work!

UncleZeiv
Posts: 35
Joined: Mon Aug 29, 2005 1:11 pm

Post by UncleZeiv » Fri Mar 03, 2006 1:36 am

fobsta wrote:A few comments about the 3d rotating axis
Can you make it bigger? I think it might be too small.
Hi I'm the author of the patch :) The axis size is more or less the same as before (non rotating one), it is even slightly bigger :) Anyway, in order to accomodate this kind of requirement, I did not hardcode the parameters, so that if you want you can play with them, they are even commented (see patch above). Maybe I could add some user option to change them at runtime.
fobsta wrote:I think the 3d rotating axis should be drawn with perspective when in perpective mode. At the moment it's always orthographic
This is intended... it doesn't make sense to me otherwise: in which point of space do you place the mini axis? ... I'll take a look at how is implemented in other softwares anyway.

fobsta
Posts: 141
Joined: Sat Jun 12, 2004 11:21 pm

Post by fobsta » Fri Mar 03, 2006 5:51 pm

Hi UncleZeiv

Maya draws the Axes in the lower left corner of a viewport - it looks like other packages keep to this layout as well


keep working hard!

thanks

vizzy
Posts: 23
Joined: Tue Feb 28, 2006 12:36 am

blender patchwork

Post by vizzy » Fri Mar 03, 2006 6:42 pm

i did some other blender patchwork, containing some other nice new features.
you can look at it here: http://www.vizzy.de/?i=verblender
would be great iof users can review this build :) maybe some of these patches find its way to blender 2.42 or so... :)

yours vizzy / verblendet

fobsta
Posts: 141
Joined: Sat Jun 12, 2004 11:21 pm

Re: blender patchwork

Post by fobsta » Fri Mar 03, 2006 11:27 pm

Vizzy

I get the following error on Suse 10

./blender: error while loading shared libraries: libpython2.3.so.1.0: cannot open shared object file: No such file or directory

Can you make you make your version of Blender work with Python 2.4 or will I have to install Python 2.3 as well?

You should also post a link to this build on Elysiun

thanks

vizzy
Posts: 23
Joined: Tue Feb 28, 2006 12:36 am

Re: blender patchwork

Post by vizzy » Sat Mar 04, 2006 12:34 am

hi fobsta :)
fobsta wrote: I get the following error on Suse 10
./blender: error while loading shared libraries: libpython2.3.so.1.0: cannot open shared object file: No such file or directory
This is my first build with 'scons' (for the vector output patch and gameengine as well as openal get working).
I used 'make' on the other build before. and in my opinion 'make' makes it a bit more static.
I also can see filesize differs a lot. 'sccons' built has around 8mb and 'make' built has approx. 10MB.
One also tested this on his machine in Kanotix and had a missing 'libgettextlib.xx.xx.so' , but i guess this could be solved by symlinking (well not the elegant way to do it).
Another guy had no problems in 3 year old updated debian.

I guess problem is dynamic linking.
Maybe ill provide a version built by make too without gameengine and w/o gl2ps.

@fobsta, about the python thing, does the 'make' built worked before i posted above? so i guess python was dynamic too. I only have py2.3 installed at this time.

ill dig into scons right now :) thx for feedback.
fobsta wrote: You should also post a link to this build on Elysiun
yep, but maybe only a link to here, or from here to there... :) i think one thread is enough.
im newbie to blenderforum, so what forum you would suggest?

yours
vizzy / verblendet

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests