Posted: Tue Oct 29, 2002 5:00 pm
Joined: 29 Oct 2002
Posts: 6
Been waiting for colored wireframes? Here they are:
http://tinus.ath.cx/temp/blendercolor.png
Trying to make some on/off-switch somewhere, any suggestions? I was thinking of adding another mode to the 'drawtype' icon in the toolbar below the edit screen.
--
tinus
Posted: Tue Oct 29, 2002 6:05 pm
Joined: 25 Oct 2002
Posts: 34
I think color wireframe is very usefull when you have a big scene. Good idea
Posted: Tue Oct 29, 2002 7:37 pm
Joined: 13 Oct 2002
Posts: 330
would be great to have Shaded Wireframe as well and Wireframe with backculling, I mean, the wires that aren't in front, aren't visible....both these features would be even more usable !
Posted: Wed Oct 30, 2002 4:51 am
Joined: 14 Oct 2002
Posts: 897
Wow, that looks awesome!
As for the UI though, I think rather than a button, it'd be better to add a colour picker to the drawtype buttons, so people can choose what colour they want.
Posted: Wed Oct 30, 2002 3:19 pm
Joined: 29 Oct 2002
Posts: 6
Well actually the current color is just taken from the material being assigned to the object. This seems kind of logical to me.
--
tinus
Posted: Wed Oct 30, 2002 3:20 pm
Joined: 29 Oct 2002
Posts: 6
Well actually the current color is just taken from the material being assigned to the object. This seems kind of logical to me.
--
tinus
Posted: Wed Oct 30, 2002 3:20 pm
Joined: 29 Oct 2002
Posts: 6
Well actually the current color is just taken from the material being assigned to the object. This seems kind of logical to me.
--
tinus
Posted: Wed Oct 30, 2002 7:00 pm
Joined: 18 Oct 2002
Posts: 271
Crap - you beat me to it. Actually, I haven't had a chance to start yet. Kids take up even more time than usual getting close to Halloween.
I was thinking about linking the wireframe colors to different layers. If you want to tackle that, go ahead. If not, I'd still like to. If you don't mind, could you email me (harkyman@attbi.com) your code modifications (and where they're from) so I don't completely reinvent the wheel.
Thanks and nice job!
Posted: Thu Oct 31, 2002 12:02 am
Joined: 29 Oct 2002
Posts: 6
Hmm, seems my previous message got sumbitted multiple times, yet I received an error every time I submitted them ...
I -could- email, but I'd rather paste it here, so others can do-it-themselves too. Since I've done multiple modifications I cannot paste the exact line numbers.
blender/src/drawobject.c:
in function void draw_object(Base *base) define:
| Code: |
Material ma*;
int color;
|
in same function, just after:
| Code: |
mymultmatrix(ob->obmat);
|
define:
| Code: |
if (give_current_material(ob, 1) != 0) {
ma = give_current_material(ob, 1);
color = ((int)(ma->b*255) << 16) + ((int)(ma->g*255) << 8) + ((int)(ma->r*255));
}
|
The two lines containing:
| Code: |
col = colortab[colindex];
cpack(col);
|
should get:
| Code: |
if (colindex == 0)
col = color;
else
col = colortab[colindex];
cpack(col);
|
Note: this is unconditional: the user has no choice whether to display the meshes in color or not.
I -did- implement a choice option, too, when pressing the Dkey, when you choose BoundBox or Mesh mode, you'll get a second option to display the objects in color or not.
This by adding:
to the typedef struct View3D in blender/makesdna/include/DNA_view3d_types.h and edit blender/src/space.c:633 to be like:
| Code: |
pupval= pupmenu("Draw mode%t|BoundBox %x1|Wire %x2|OpenGL Solid %x3|Shaded Solid %x4");
if(pupval>0) {
G.vd->drawtype= pupval;
if (pupval < 3) {
pupval= pupmenu("Display in color%t|Yes %x1|No%x0");
G.vd->color = pupval;
}
doredraw= 1;
}
|
and changing
into
| Code: |
if (colindex == 0 && G.vd->color)
|
in blender/src/drawobject.c.
This all is coded very sloppy and fast, but it works.
Good luck!
--
tinus
Posted: Sat Nov 02, 2002 2:11 pm
Joined: 15 Oct 2002
Posts: 527
What should be improved in Blender is the way it displays 'selected' items. Curently it only works nice in wireframe.
When you adopt colors for wirerframe, you have to solve that. For the time being, I prefer 'context' based wireframe colors. Like having blue for library objects, grey for linked from other scenes, yellow for Ipo keys, etc.
Posted: Sat Nov 02, 2002 11:49 pm
Joined: 19 Oct 2002
Posts: 13
| Code: |
| #define makeColor(r,g,b) ((int)(b) << 16) + ((int)(g) << 8) + ((int)(r)) |
A bit of abstraction to make color code more readable.
(This is as good a place as any.)[/code]
Posted: Mon Nov 04, 2002 4:55 am
Joined: 16 Oct 2002
Posts: 1177
| ton wrote: |
| For the time being, I prefer 'context' based wireframe colors. Like having blue for library objects, grey for linked from other scenes, yellow for Ipo keys, etc. |
I'll second that. While having layer colors is nice, it could turn ugly if it makes more difficult the task of seeing what object is selected or not.
about back face culling, it is, all in all, a good idea, but there might be some technical difficulties. While a quick hack using the dot product of the face normal and the view vector to determine if the face is facing back might work most of the time, it would probably cause some problems with open shapes (take, for example, the cube in Tinus' pic and delete the top face. now, the two "back" face would need to be part visible part invisible) or complex concave objects.
I don't want to sound like the devil's advocate, I'm merely saying that these thing will probably not happen overnight (although I'd really love to be proven wrong).
Martin
_________________
Life is what happens to you when you're busy making other plans.
- John Lennon
Posted: Thu Nov 07, 2002 12:45 pm
Joined: 14 Oct 2002
Posts: 125
button in button bar
with an options list kinda like all the others (plus hotkeys)
mat (colour from material)
mir (colour from mir colour)
con (colour from context like ton says)
lay (colour from layer)
-------(oh yeah and last but not least)
stan (for the standard grey and pink)
-------(and another i just thought of)
dyn (for seperation between dynamic realtime oblects and objects which ignor physics in the realtime engine. between objects and settings)
makes everyone happy!!!!!!
cause it depends on what you are doing doesn't it.
for me i rarely link objects between scenes so wouldn't normaly use the con button but i may decied to use the layer button.
i think colours are a great idea!!!!!!!
and can you only use this kinda new adition to blender in LINUX.
should i get linux with my new machine?