Colored wireframes

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

Moderators: jesterKing, stiv

tinus
Posts: 10
Joined: Tue Oct 29, 2002 4:50 pm

Colored wireframes

Postby tinus » Tue Oct 29, 2002 5:00 pm

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

Bab
Posts: 34
Joined: Fri Oct 25, 2002 3:40 pm
Location: France

Postby Bab » Tue Oct 29, 2002 6:05 pm

I think color wireframe is very usefull when you have a big scene. Good idea

sten
Posts: 329
Joined: Sun Oct 13, 2002 7:47 pm

Postby sten » Tue Oct 29, 2002 7:37 pm

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 !

matt_e
Posts: 898
Joined: Mon Oct 14, 2002 4:32 am
Location: Sydney, Australia
Contact:

Postby matt_e » Wed Oct 30, 2002 4:51 am

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.

tinus
Posts: 10
Joined: Tue Oct 29, 2002 4:50 pm

Postby tinus » Wed Oct 30, 2002 3:19 pm

Well actually the current color is just taken from the material being assigned to the object. This seems kind of logical to me.

--
tinus

tinus
Posts: 10
Joined: Tue Oct 29, 2002 4:50 pm

Postby tinus » Wed Oct 30, 2002 3:20 pm

Well actually the current color is just taken from the material being assigned to the object. This seems kind of logical to me.

--
tinus

tinus
Posts: 10
Joined: Tue Oct 29, 2002 4:50 pm

Postby tinus » Wed Oct 30, 2002 3:20 pm

Well actually the current color is just taken from the material being assigned to the object. This seems kind of logical to me.

--
tinus

harkyman
Posts: 278
Joined: Fri Oct 18, 2002 2:47 pm
Location: Pennsylvania, USA
Contact:

Postby harkyman » Wed Oct 30, 2002 7:00 pm

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!

tinus
Posts: 10
Joined: Tue Oct 29, 2002 4:50 pm

Postby tinus » Thu Oct 31, 2002 12:02 am

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: Select all

Material ma*;
int color;

in same function, just after:

Code: Select all

mymultmatrix(ob->obmat);

define:

Code: Select all

    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: Select all

col = colortab[colindex];
cpack(col);

should get:

Code: Select all

        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:

Code: Select all

short color;

to the typedef struct View3D in blender/makesdna/include/DNA_view3d_types.h and edit blender/src/space.c:633 to be like:

Code: Select all

                    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

Code: Select all

        if (colindex == 0)

into

Code: Select all

        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

ton
Site Admin
Posts: 525
Joined: Wed Oct 16, 2002 12:13 am
Contact:

Postby ton » Sat Nov 02, 2002 2:11 pm

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.

markluffel
Posts: 13
Joined: Sun Oct 20, 2002 12:16 am
Location: Georgia Tech, Atlanta
Contact:

Postby markluffel » Sat Nov 02, 2002 11:49 pm

Code: Select all

#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]

theeth
Posts: 1184
Joined: Wed Oct 16, 2002 5:47 am
Location: Montreal
Contact:

Postby theeth » Mon Nov 04, 2002 4:55 am

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

alltaken
Posts: 127
Joined: Mon Oct 14, 2002 7:08 am

Postby alltaken » Thu Nov 07, 2002 12:45 pm

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?


Return to “Interface & Tools”

Who is online

Users browsing this forum: Bing [Bot] and 1 guest