tornavis/source/blender/makesdna/DNA_scene_types.h

389 lines
9.2 KiB
C
Raw Normal View History

2002-10-12 13:37:38 +02:00
/**
* blenlib/DNA_scene_types.h (mar-2001 nzc)
*
* Renderrecipe and scene decription. The fact that there is a
* hierarchy here is a bit strange, and not desirable.
*
* $Id$
*
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. The Blender
* Foundation also sells licenses for use in proprietary software under
* the Blender License. See http://www.blender.org/BL/ for information
* about this.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
* All rights reserved.
*
* The Original Code is: all of this file.
*
* Contributor(s): none yet.
*
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef DNA_SCENE_TYPES_H
#define DNA_SCENE_TYPES_H
#ifdef __cplusplus
extern "C" {
#endif
#include "DNA_vec_types.h"
#include "DNA_listBase.h"
#include "DNA_scriptlink_types.h"
#include "DNA_ID.h"
#include "DNA_scriptlink_types.h"
struct FreeCamera;
struct Radio;
struct Object;
struct World;
struct Scene;
struct Image;
struct Group;
typedef struct Base {
struct Base *next, *prev;
unsigned int lay, selcol;
int flag;
short sx, sy;
struct Object *object;
} Base;
typedef struct AviCodecData {
void *lpFormat; /* save format */
void *lpParms; /* compressor options */
unsigned int cbFormat; /* size of lpFormat buffer */
unsigned int cbParms; /* size of lpParms buffer */
unsigned int fccType; /* stream type, for consistency */
unsigned int fccHandler; /* compressor */
unsigned int dwKeyFrameEvery; /* keyframe rate */
unsigned int dwQuality; /* compress quality 0-10,000 */
unsigned int dwBytesPerSecond; /* bytes per second */
unsigned int dwFlags; /* flags... see below */
unsigned int dwInterleaveEvery; /* for non-video streams only */
unsigned int pad;
char avicodecname[128];
2002-10-12 13:37:38 +02:00
} AviCodecData;
typedef struct QuicktimeCodecData {
void *cdParms; /* codec/compressor options */
void *pad; /* padding */
unsigned int cdSize; /* size of cdParms buffer */
unsigned int pad2; /* padding */
char qtcodecname[128];
} QuicktimeCodecData;
Commit message and the brunt of the code courtesy of intrr, apologies for the size of this; Finally, the Sequencer audio support and global audio/animation sync stuff! (See http://intrr.org/blender/audiosequencer.html) Stuff that has been done: ./source/blender/blenloader/intern/writefile.c ./source/blender/blenloader/intern/readfile.c Added code to make it handle sounds used by audio strips, and to convert Scene data from older (<2.28) versions to init Scene global audio settings (Scene->audio) to defaults. ./source/blender/include/BSE_seqaudio.h ./source/blender/src/seqaudio.c The main audio routines that start/stop/scrub the audio stream at a certain frame position, provide the frame reference for the current stream position, mix the audio, convert the audio, mixdown the audio into a file. ./source/blender/makesdna/DNA_sound_types.h Introduced new variables in the bSound struct to accomodate the sample data after converted to the scene's global mixing format (stream, streamlen). Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound belongs to a sequence strip. ./source/blender/makesdna/DNA_scene_types.h Added AudioData struct, which holds scene-global audio settings. ./source/blender/makesdna/DNA_sequence_types.h Added support for audio strips. Some variables to hold Panning/Attenuation information, position information, reference to the sample, and some flags. ./source/blender/makesdna/DNA_userdef_types.h ./source/blender/src/usiblender.c Added a "Mixing buffer size" userpref. Made the versions stuff initialize it to a default for versions <2.28. ./source/blender/makesdna/DNA_space_types.h ./source/blender/src/filesel.c Added a Cyan dot to .WAV files. Any other suggestions on a better color? :) ./source/blender/src/editsound.c Changes (fixes) to the WAV file loader, re-enabled some gameengine code that is needed for dealing with bSounds and bSamples. ./source/blender/src/editipo.c ./source/blender/src/drawseq.c ./source/blender/src/editnla.c ./source/blender/src/space.c ./source/blender/src/drawview.c ./source/blender/src/renderwin.c ./source/blender/src/headerbuttons.c - Created two different wrappers for update_for_newframe(), one which scrubs the audio, one which doesn't. - Replaced some of the occurences of update_for_newframe() with update_for_newframe_muted(), which doesn't scrub the audio. - In drawview.c: Changed the synchronization scheme to get the current audio position from the audio engine, and use that as a reference for setting CFRA. Implements a/v sync and framedrop. - In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as volume envelopes. - In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing (update_for_newframe()) for moving the sequence editor framebar. ./source/blender/src/editseq.c Added support for audio strips and a default directory for WAV files which gets saved from the last Shift-A operation. ./source/blender/src/buttons.c Added Scene-global audio sequencer settings in Sound buttons. ./source/blender/src/sequence.c Various stuff that deals with handling audio strips differently than usual strips.
2003-07-13 22:16:56 +02:00
typedef struct AudioData {
int mixrate;
float main; /* Main mix in dB */
short flag;
short pad[3];
} AudioData;
2002-10-12 13:37:38 +02:00
typedef struct RenderData {
struct AviCodecData *avicodecdata;
struct QuicktimeCodecData *qtcodecdata;
short cfra, sfra, efra; /* fames as in 'images' */
2002-10-12 13:37:38 +02:00
short images, framapto, flag;
float ctime; /* use for calcutions */
2002-10-12 13:37:38 +02:00
float framelen, blurfac;
/** For UR edge rendering: give the edges this colour */
float edgeR, edgeG, edgeB;
short fullscreen, xplay, yplay, freqplay; /* standalone player */
short depth, attrib, rt1, rt2; /* standalone player */
short stereomode; /* standalone player stereo settings */
short pad[3];
short size, maximsize; /* size in %, max in Kb */
/* from buttons: */
2002-10-12 13:37:38 +02:00
/**
* The desired number of pixels in the x direction
*/
short xsch;
/**
* The desired number of pixels in the y direction
*/
short ysch;
/**
* Adjustment factors for the aspect ratio in the x direction
*/
short xasp;
/**
* Adjustment factors for the aspect ratio in the x direction
*/
short yasp;
/**
* The number of part to use in the x direction
*/
short xparts;
/**
* The number of part to use in the y direction
*/
short yparts;
/* should rewrite this I think... */
rctf safety, border;
short winpos, planes, imtype;
/** Mode bits: */
/* 0: Enable backbuffering for images */
short bufflag;
short quality;
/**
* Flags for render settings. Use bit-masking to access the settings.
* 0: enable sequence output rendering
* 1: render daemon
* 4: add extensions to filenames
*/
short scemode;
/**
* Flags for render settings. Use bit-masking to access the settings.
* The bits have these meanings:
* 0: do oversampling
* 1: do shadows
* 2: do gamma correction
* 3: ortho (not used?)
* 4: do envmap
* 5: edge shading
* 6: field rendering
* 7: Disables time difference in field calculations
* 8: radio rendering
* 9: borders
* 10: panorama
* 11: crop
* 12: save SGI movies with Cosmo hardware
* 13: odd field first rendering
* 14: motion blur
* 15: use unified renderer for this pic
* 16: enable raytracing
* 18: use YafRay for rendering
2002-10-12 13:37:38 +02:00
*/
int mode;
2002-10-12 13:37:38 +02:00
/**
* What to do with the sky/background. Picks sky/premul/key
* blending for the background
*/
short alphamode;
/**
* Toggles whether to apply a gamma correction for subpixel to
* pixel blending
*/
short dogamma;
/**
* The number of samples to use per pixel.
*/
short osa;
short frs_sec, edgeint;
/** For unified renderer: reduce intensity on boundaries with
* identical materials with this number.*/
short same_mat_redux;
2002-10-12 13:37:38 +02:00
/**
* The gamma for the normal rendering. Used when doing
* oversampling, to correctly blend subpixels to pixels. */
float gamma, gauss;
2002-10-12 13:37:38 +02:00
/** post-production settings. Don't really belong here */
float postmul, postgamma, postadd, postigamma;
/* yafray: global panel params */
short GIquality, GIcache, GImethod, GIgradient;
int GIdepth, GIpixelspersample;
int YF_numprocs;
float GIshadowquality, GIpower, YF_gamma, YF_exposure;
2002-10-12 13:37:38 +02:00
char backbuf[160], pic[160], ftype[160];
int pad1;
2002-10-12 13:37:38 +02:00
} RenderData;
typedef struct GameFraming {
float col[3];
char type, pad1, pad2, pad3;
} GameFraming;
#define SCE_GAMEFRAMING_BARS 0
#define SCE_GAMEFRAMING_EXTEND 1
#define SCE_GAMEFRAMING_SCALE 2
typedef struct Scene {
ID id;
struct Object *camera;
struct World *world;
struct Scene *set;
struct Image *ima;
ListBase base;
struct Base *basact;
struct Group *group;
float cursor[3];
unsigned int lay;
/* some realtime vars */
struct FreeCamera *fcam; /* old, can be removed (ton) */
2002-10-12 13:37:38 +02:00
void *ed;
struct Radio *radio;
void *sumohandle;
struct GameFraming framing;
/* migrate or replace? depends on some internal things... */
/* no, is on the right place (ton) */
struct RenderData r;
Commit message and the brunt of the code courtesy of intrr, apologies for the size of this; Finally, the Sequencer audio support and global audio/animation sync stuff! (See http://intrr.org/blender/audiosequencer.html) Stuff that has been done: ./source/blender/blenloader/intern/writefile.c ./source/blender/blenloader/intern/readfile.c Added code to make it handle sounds used by audio strips, and to convert Scene data from older (<2.28) versions to init Scene global audio settings (Scene->audio) to defaults. ./source/blender/include/BSE_seqaudio.h ./source/blender/src/seqaudio.c The main audio routines that start/stop/scrub the audio stream at a certain frame position, provide the frame reference for the current stream position, mix the audio, convert the audio, mixdown the audio into a file. ./source/blender/makesdna/DNA_sound_types.h Introduced new variables in the bSound struct to accomodate the sample data after converted to the scene's global mixing format (stream, streamlen). Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound belongs to a sequence strip. ./source/blender/makesdna/DNA_scene_types.h Added AudioData struct, which holds scene-global audio settings. ./source/blender/makesdna/DNA_sequence_types.h Added support for audio strips. Some variables to hold Panning/Attenuation information, position information, reference to the sample, and some flags. ./source/blender/makesdna/DNA_userdef_types.h ./source/blender/src/usiblender.c Added a "Mixing buffer size" userpref. Made the versions stuff initialize it to a default for versions <2.28. ./source/blender/makesdna/DNA_space_types.h ./source/blender/src/filesel.c Added a Cyan dot to .WAV files. Any other suggestions on a better color? :) ./source/blender/src/editsound.c Changes (fixes) to the WAV file loader, re-enabled some gameengine code that is needed for dealing with bSounds and bSamples. ./source/blender/src/editipo.c ./source/blender/src/drawseq.c ./source/blender/src/editnla.c ./source/blender/src/space.c ./source/blender/src/drawview.c ./source/blender/src/renderwin.c ./source/blender/src/headerbuttons.c - Created two different wrappers for update_for_newframe(), one which scrubs the audio, one which doesn't. - Replaced some of the occurences of update_for_newframe() with update_for_newframe_muted(), which doesn't scrub the audio. - In drawview.c: Changed the synchronization scheme to get the current audio position from the audio engine, and use that as a reference for setting CFRA. Implements a/v sync and framedrop. - In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as volume envelopes. - In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing (update_for_newframe()) for moving the sequence editor framebar. ./source/blender/src/editseq.c Added support for audio strips and a default directory for WAV files which gets saved from the last Shift-A operation. ./source/blender/src/buttons.c Added Scene-global audio sequencer settings in Sound buttons. ./source/blender/src/sequence.c Various stuff that deals with handling audio strips differently than usual strips.
2003-07-13 22:16:56 +02:00
struct AudioData audio;
2002-10-12 13:37:38 +02:00
ScriptLink scriptlink;
} Scene;
/* **************** RENDERDATA ********************* */
/* bufflag */
#define R_BACKBUF 1
#define R_BACKBUFANIM 2
#define R_FRONTBUF 4
#define R_FRONTBUFANIM 8
/* mode (int now) */
#define R_OSA 0x0001
#define R_SHADOW 0x0002
2002-10-12 13:37:38 +02:00
#define R_GAMMA 0x0004
#define R_ORTHO 0x0008
#define R_ENVMAP 0x0010
2002-10-12 13:37:38 +02:00
#define R_EDGE 0x0020
#define R_FIELDS 0x0040
#define R_FIELDSTILL 0x0080
So, for the platform managers to check: - the link order for Blender has changed, the libradiosity.a has to be moved after the librender.a (obviously for a new dependency!). Check blender/source/Makefile - there's a new file: blender/source/radiosity/intern/source/radrender.c Here's what the new code does: Using the core routines of the Radiosity tool, each renderface with 'emit material' and each renderface with 'radio material flag' set will be used to itterate to a global illumination solution. Per face with high energy (emit) little images are rendered (hemicubes) which makes up lookup tables to 'shoot' its energy to other faces. In the end this energy - color - then is directly added to the pixel colors while rendering, Gouraud shaded. Since it's done with renderfaces, it works for all primitives in Blender. What is doesn't do yet: - take into account textured color of faces. Currently it uses the material RGB color for filtering distributed energy. - do some smart pre-subdividing. I don't know yet if this is useful... Right now it means that you'll have to balance the models yourself, to deliver small faces where you want a high accuracy for shadowing. - unified render (is at my todo list) User notes: - per Material you want to have included in radiosity render: set the 'radio' flag. For newly added Materials it is ON by default now. - the Ambient slider in Material controls the amount of radiosity color. - for enabling radiosity rendering, set the F10 "Radio" button. - the Radiosity buttons now only show the relevant radiosity rendering options. Pressing "collect meshes" will show all buttons again. - for meshes, the faces who use Radio material always call the 'autosmooth' routine, this to make sure sharp angles (like corners in a room) do not have shared vertices. For some smooth models (like the raptor example) you might increase the standard smoothing angle from 30 to 45 degree. Technical notes: - I had to expand the renderface and rendervertices for it... shame on me! Faces have one pointer extra, render vertices four floats... - The size of the hemicubes is now based at the boundbox of the entire scene (0.002 of it). This should be more reliable... to be done - I fixed a bug in radiosity render, where sometimes backfaces where lit In general: I'd like everyone to play a bit with this system. It's not easy to get good results with it. A simple "hit and go" isn't there... maybe some good suggestions?
2003-08-31 22:33:46 +02:00
#define R_RADIO 0x0100
2002-10-12 13:37:38 +02:00
#define R_BORDER 0x0200
#define R_PANORAMA 0x0400
#define R_MOVIECROP 0x0800
#define R_COSMO 0x1000
#define R_ODDFIELD 0x2000
#define R_MBLUR 0x4000
#define R_UNIFIED 0x8000
#define R_RAYTRACE 0x10000
#define R_GAUSS 0x20000
/* yafray: render flag */
#define R_YAFRAY 0x40000
2002-10-12 13:37:38 +02:00
/* scemode */
#define R_DOSEQ 0x0001
#define R_BG_RENDER 0x0002
#define R_EXTENSION 0x0010
#define R_OGL 0x0020
/* alphamode */
#define R_ADDSKY 0
#define R_ALPHAPREMUL 1
#define R_ALPHAKEY 2
/* planes */
#define R_PLANES24 24
#define R_PLANES32 32
#define R_PLANESBW 8
/* imtype */
#define R_TARGA 0
#define R_IRIS 1
#define R_HAMX 2
#define R_FTYPE 3
#define R_JPEG90 4
#define R_MOVIE 5
#define R_IRIZ 7
#define R_RAWTGA 14
#define R_AVIRAW 15
#define R_AVIJPEG 16
#define R_PNG 17
#define R_AVICODEC 18
#define R_QUICKTIME 19
2002-10-12 13:37:38 +02:00
/* **************** RENDER ********************* */
/* mode flag is same as for renderdata */
/* flag */
#define R_ZTRA 1
#define R_HALO 2
#define R_SEC_FIELD 4
#define R_LAMPHALO 8
#define R_RENDERING 16
#define R_ANIMRENDER 32
/* vlakren->flag (vlak = face in dutch) */
2002-10-12 13:37:38 +02:00
#define R_SMOOTH 1
#define R_VISIBLE 2
#define R_NOPUNOFLIP 8
#define R_CMAPCODE 16
#define R_FACE_SPLIT 32
#define R_DIVIDE_24 64 /* Tells render to divide face other way. */
2002-10-12 13:37:38 +02:00
/* vertren->texofs (texcoordinate offset relative to vertren->orco */
2002-10-12 13:37:38 +02:00
#define R_UVOFS3 1
/* **************** SCENE ********************* */
#define RAD_PHASE_PATCHES 1
#define RAD_PHASE_FACES 2
/* base->flag and ob->flag */
2002-10-12 13:37:38 +02:00
#define BA_WASSEL 2
#define BA_PARSEL 4
#define BA_WHERE_UPDATE 8
#define BA_DISP_UPDATE 16
#define BA_DO_IPO 32
#define BA_FROMSET 128
#define OB_DO_IMAT 256
#define OB_FROMDUPLI 512
#define OB_DONE 1024
#define OB_RADIO 2048
#define OB_FROMGROUP 4096
/* sce->flag */
#define SCE_ADDSCENAME 1
/* return flag next_object function */
#define F_START 0
#define F_SCENE 1
#define F_SET 2
#define F_DUPLI 3
Commit message and the brunt of the code courtesy of intrr, apologies for the size of this; Finally, the Sequencer audio support and global audio/animation sync stuff! (See http://intrr.org/blender/audiosequencer.html) Stuff that has been done: ./source/blender/blenloader/intern/writefile.c ./source/blender/blenloader/intern/readfile.c Added code to make it handle sounds used by audio strips, and to convert Scene data from older (<2.28) versions to init Scene global audio settings (Scene->audio) to defaults. ./source/blender/include/BSE_seqaudio.h ./source/blender/src/seqaudio.c The main audio routines that start/stop/scrub the audio stream at a certain frame position, provide the frame reference for the current stream position, mix the audio, convert the audio, mixdown the audio into a file. ./source/blender/makesdna/DNA_sound_types.h Introduced new variables in the bSound struct to accomodate the sample data after converted to the scene's global mixing format (stream, streamlen). Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound belongs to a sequence strip. ./source/blender/makesdna/DNA_scene_types.h Added AudioData struct, which holds scene-global audio settings. ./source/blender/makesdna/DNA_sequence_types.h Added support for audio strips. Some variables to hold Panning/Attenuation information, position information, reference to the sample, and some flags. ./source/blender/makesdna/DNA_userdef_types.h ./source/blender/src/usiblender.c Added a "Mixing buffer size" userpref. Made the versions stuff initialize it to a default for versions <2.28. ./source/blender/makesdna/DNA_space_types.h ./source/blender/src/filesel.c Added a Cyan dot to .WAV files. Any other suggestions on a better color? :) ./source/blender/src/editsound.c Changes (fixes) to the WAV file loader, re-enabled some gameengine code that is needed for dealing with bSounds and bSamples. ./source/blender/src/editipo.c ./source/blender/src/drawseq.c ./source/blender/src/editnla.c ./source/blender/src/space.c ./source/blender/src/drawview.c ./source/blender/src/renderwin.c ./source/blender/src/headerbuttons.c - Created two different wrappers for update_for_newframe(), one which scrubs the audio, one which doesn't. - Replaced some of the occurences of update_for_newframe() with update_for_newframe_muted(), which doesn't scrub the audio. - In drawview.c: Changed the synchronization scheme to get the current audio position from the audio engine, and use that as a reference for setting CFRA. Implements a/v sync and framedrop. - In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as volume envelopes. - In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing (update_for_newframe()) for moving the sequence editor framebar. ./source/blender/src/editseq.c Added support for audio strips and a default directory for WAV files which gets saved from the last Shift-A operation. ./source/blender/src/buttons.c Added Scene-global audio sequencer settings in Sound buttons. ./source/blender/src/sequence.c Various stuff that deals with handling audio strips differently than usual strips.
2003-07-13 22:16:56 +02:00
/* audio->flag */
#define AUDIO_MUTE 1
#define AUDIO_SYNC 2
#define AUDIO_SCRUB 4
2002-10-12 13:37:38 +02:00
#ifdef __cplusplus
}
#endif
#endif