1 The following 4 steps to adding a new image format to blender, its
2 probably easiest to look at the png code for a clean clear example,
3 animation formats are a bit more complicated but very similar:
6 create a new file named after the format for example lets say we were
7 creating an openexr read/writer use openexr.c
8 It should contain functions to match the following prototypes:
10 struct ImBuf *imb_loadopenexr(unsigned char *mem,int size,int flags);
11 /* Use one of the following depending on whats easyer for your file format */
12 short imb_saveopenexr(struct ImBuf *ibuf, FILE myfile, int flags);
13 short imb_saveopenexr(struct ImBuf *ibuf, char *myfile, int flags);
15 /* Used to test if its the correct format
16 int IMB_is_openexr(void *buf);
19 Add your hooks to read and write the image format these go in
20 writeimage.c and readimage.c just look at how the others are done
23 Add in IS_openexr to blender/source/blender/imbuf/IMB_imbuf_types.h
24 Add in R_openexr to source/blender/makesdna/DNA_scene_types.h
27 Add your hooks to the gui.
28 source/blender/src/buttons_scene.c
29 source/blender/src/toets.c
30 source/blender/src/writeimage.c
33 edit the following files:
34 blender/source/blender/imbuf/intern/util.c
35 blender/source/blender/src/filesel.c
36 blender/source/blender/src/screendump.c
37 and add your extension so that your format gets recognized in the thumbnails.
40 Alter the build process:
41 For scons you need to edit blender/source/blender/imbuf/SConscript
42 and add in your additional files to source_files.
43 For msvp you need to edit blender/projectfiles/blender/imbuf/BL_imbuf.dsp
44 and add in your additional files.
45 If you have any external library info you will also need to add that
46 to the various build processes.
49 Its also good to add your image format to:
50 makepicstring in blender/source/blender/blenkernel/intern/image.c