[tuhopuu-devel] GUI skins

Daniel Fairhead tuhopuu-devel@blender.org
Wed, 30 Jul 2003 23:58:08 +0300


Hi,

Thanks Chris for forwarding it on...

> car wrote:
> 
>  > Wichy! .
>  >
>  > They are very neat, buuuuuuuttttttt.
>  >
> >> It makes the interface slow . The scrolling and panning the buttons is  
> >> to clipy slow now.
> >> Even with the basic setting put back on.
> 
> Is it slow even with the draw-style set to the
> default blender look?

Well, I have tested quite extensively on bf-blender, with and without my
patch, and also (not so extensively) on tuhpuu. I have not had any problems
with blender being slower at all, with any variable settings of colours, button-types, etc. Just now, I opened up a bf-blender, then
a tuhopuu, then an older blender (2.23) and tried zooming in 5 times (+++++)
to the render-buttons, and dragging about madly with the middle button,
and had no problems at all. In fact, in my bf-blender, it actually is smoother
than the 2.23 blender. This would be because of ton's improvements to interface.c
and such, I would guess.

I'm not quite sure how my patch can be made any faster, as it is all done (pretty much)
the same way the current buttons work, when the button is defined, its embossfunction
property (a function pointer) is pointed at whichever function wanted for doing the actual
drawing, then at draw time, it just calls it. At draw time it should be exactly the same as
before, as it points at the same function.

It could be something hardware related, I guess. I'm using a Celeron 500, Nvidia
TNT2M64 (16meg ram), 128meg of "real" memory. Gentoo Linux, 2.4.20-ck6 kernel.

Or something in the way opengl is implimented, or how apple machines cope with functions
and function pointers that is different to x86 machines, or how tired the imps who do the 
painting of stuff on screen are, and how long its been since their last coffee break, etc.

I need more people to test though, still. I may well have done something stupid somewhere. :)

Please do tell of any (particually speed related) problems with this patch. Speed being
slowed is one of the major "worries" people have had about "skins" in blender, and I
am trying/did try to make it as un-noticable as possible.

car wrote:

>Besides that. Feature request!

>Armatures! both for select and deselect. I have been building tuhopuu  
>with red and yellow,, Much Better to see and edit for meee.
>everything else is your call, and there are a lot of them. Or just tell  
>me and I will try to hack in your code system to the armature place.

Not a problem. If you want to take a dekko, the place to check first is in 

source/blender/include/BIF_resources.h

Here you should find a whole bunch of colours in an enum. Just add another
colourname in, appros to armatures.

source/blender/src/space.c

Find the preferences area, and then the menu in there. Kind of ugly, I know.
If you add the correct item in there, in the same way the others are, good.

source/blender/src/resources.c (I think)

there is a function somewhere with all the definitions of the actual colours
used... search for "def_col" or so. Again, add yours in the same way as the
others.

>Oh and see if you can remove the borders to as an option, As I did with  
>your previous code, That made it look realy slick !

source/blender/makesdan/DNA_userpref.h

add a new #define for the new type of button drawing. (with the others)

source/blender/src/interface.c

add a new button draw function, along where the others are, and find
where the "if" statement is which sets which one to use, and add yours
in there as well.

source/blender/src/space.c

in the userpreferences area, again in the correct tab, add a new button
as the others are, with the correct new value (the value you #define'd
in DNA_userpref.h

Anyway... hope thats been of some help, 

Happy hacking,

Dan