BlenderDev/icon

Wikipedia,自由的百科全书

All icons are stored in a file called blenderbuttons in

release/datafiles. The file is a png image, with the icons arranged on

a grid; to use it just rename to file to blenderbuttons.png. The png

has an alpha channel, so transparency shouldn't be a problem.


To add new icons, use the blank gridspaces (start with the *second* one)

as defined in the icon enumeration in

source/blender/include/BIF_resources.h. The icons are named, starting

from the lower left, left to right. There are six blank icons you can

use at the moment as defined in the enum; except you cannot use the

first one. I believe the idea is you fill in the blanks (starting with

the second one) and replace the ICON_BLANKxxx with your icon name as you

go. I *think* you can add new rows to the blenderbuttons file if you

have to, but if you do then you want to add ICON_BLANKXX to the

enumeration for all the blank icons in the row you added.


There's another file, datatoc.c, which must be compiled into a program

and used to turn blenderbuttons (renamed to not have the .png) into a .c

file which can be compiled into Blender. To use datatoc, it should be

as easy as (if you use gcc):


gcc datatoc.c -o datatoc[.exe on windows]

./datatoc blenderbuttons


Datatoc will spit out blenderbuttons.c, which goes in

source/blender/src. Note if your using windows: datatoc is best run on

the command line, since simply dragging the file onto it ends up with

the whole pathname being compiled as the filename, rather then just the

filename.

Personal tools