4 * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version. The Blender
10 * Foundation also sells licenses for use in proprietary software under
11 * the Blender License. See http://www.blender.org/BL/ for information
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software Foundation,
21 * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24 * All rights reserved.
26 * The Original Code is: all of this file.
28 * Contributor(s): none yet.
30 * ***** END GPL/BL DUAL LICENSE BLOCK *****
38 #include "MEM_guardedalloc.h"
39 #include "DNA_screen_types.h"
40 #include "DNA_space_types.h"
41 #include "DNA_scene_types.h"
42 #include "DNA_sound_types.h"
43 #include "DNA_userdef_types.h"
44 #include "DNA_packedFile_types.h"
46 #include "BKE_global.h"
48 #include "BKE_library.h"
49 #include "BKE_sound.h"
50 #include "BKE_packedFile.h"
51 #include "BKE_utildefines.h"
53 #include "BLI_blenlib.h"
55 #include "BSE_filesel.h"
58 #include "BIF_graphics.h"
59 #include "BIF_glutil.h"
60 #include "BIF_interface.h"
61 #include "BIF_keyval.h"
62 #include "BIF_mainqueue.h"
63 #include "BIF_mywindow.h"
64 #include "BIF_resources.h"
65 #include "BIF_renderwin.h"
66 #include "BIF_screen.h"
67 #include "BIF_space.h"
68 #include "BIF_toolbox.h"
70 #include "BIF_butspace.h"
75 /* -----includes for this file specific----- */
77 #include "DNA_image_types.h"
78 #include "BKE_writeavi.h"
79 #include "BKE_image.h"
80 #include "BIF_writeimage.h"
81 #include "BIF_writeavicodec.h"
82 #include "BIF_editsound.h"
83 #include "BSE_seqaudio.h"
84 #include "BSE_headerbuttons.h"
86 #include "butspace.h" // own module
89 #include "quicktime_export.h"
93 /* here the calls for scene buttons
96 - anim settings, audio
100 void playback_anim(void);
102 /* ************************ SOUND *************************** */
103 static void load_new_sample(char *str) /* called from fileselect */
105 char name[FILE_MAXDIR+FILE_MAXFILE];
107 bSample *sample, *newsample;
109 sound = G.buts->lockpoin;
113 sample = sound->sample;
114 strcpy(name, sound->sample->name);
116 strcpy(sound->name, str);
117 sound_set_sample(sound, NULL);
118 sound_initialize_sample(sound);
120 if (sound->sample->type == SAMPLE_INVALID) {
121 error("Not a valid sample: %s", str);
123 newsample = sound->sample;
126 strcpy(sound->name, name);
127 sound_set_sample(sound, sample);
129 // remove invalid sample
131 sound_free_sample(newsample);
132 BLI_remlink(samples, newsample);
133 MEM_freeN(newsample);
137 BIF_undo_push("Load new audio file");
138 allqueue(REDRAWBUTSSCENE, 0);
143 void do_soundbuts(unsigned short event)
145 char name[FILE_MAXDIR+FILE_MAXFILE];
151 sound = G.buts->lockpoin;
155 allqueue(REDRAWBUTSSCENE, 0);
158 case B_SOUND_LOAD_SAMPLE:
159 if (sound) strcpy(name, sound->name);
160 else strcpy(name, U.sounddir);
162 activate_fileselect(FILE_SPECIAL, "SELECT WAV FILE", name, load_new_sample);
165 case B_SOUND_PLAY_SAMPLE:
167 if (sound->sample->type != SAMPLE_INVALID) {
168 sound_play_sound(sound);
169 allqueue(REDRAWBUTSSCENE, 0);
174 case B_SOUND_MENU_SAMPLE:
175 if (G.buts->menunr == -2) {
177 activate_databrowse((ID *)sound->sample, ID_SAMPLE, 0, B_SOUND_MENU_SAMPLE, &G.buts->menunr, do_soundbuts);
179 } else if (G.buts->menunr > 0) {
180 sample = BLI_findlink(samples, G.buts->menunr - 1);
181 if (sample && sound) {
182 BLI_strncpy(sound->name, sample->name, sizeof(sound->name));
183 sound_set_sample(sound, sample);
184 do_soundbuts(B_SOUND_REDRAW);
189 case B_SOUND_NAME_SAMPLE:
190 load_new_sample(sound->name);
193 case B_SOUND_UNPACK_SAMPLE:
194 if(sound && sound->sample) {
195 sample = sound->sample;
197 if (sample->packedfile) {
198 if (G.fileflags & G_AUTOPACK) {
199 if (okee("Disable AutoPack ?")) {
200 G.fileflags &= ~G_AUTOPACK;
204 if ((G.fileflags & G_AUTOPACK) == 0) {
205 unpackSample(sample, PF_ASK);
208 sound_set_packedfile(sample, newPackedFile(sample->name));
210 allqueue(REDRAWHEADERS, 0);
211 do_soundbuts(B_SOUND_REDRAW);
215 case B_SOUND_COPY_SOUND:
217 tempsound = sound_make_copy(sound);
220 G.buts->lockpoin = (bSound*)id;
221 BIF_undo_push("Copy sound");
222 do_soundbuts(B_SOUND_REDRAW);
228 sound = G.main->sound.first;
232 audio_makestream(sound);
233 sound = (bSound *) sound->id.next;
236 allqueue(REDRAWSEQ, 0);
239 case B_SOUND_RATECHANGED:
241 allqueue(REDRAWBUTSSCENE, 0);
242 allqueue(REDRAWSEQ, 0);
245 case B_SOUND_MIXDOWN:
251 printf("do_soundbuts: unhandled event %d\n", event);
257 static void sound_panel_listener(void)
260 int xco= 100, yco=100, mixrate;
261 char mixrateinfo[256];
263 block= uiNewBlock(&curarea->uiblocks, "sound_panel_listener", UI_EMBOSS, UI_HELV, curarea->win);
264 if(uiNewPanel(curarea, block, "Listener", "Sound", 320, 0, 318, 204)==0) return;
266 mixrate = sound_get_mixrate();
267 sprintf(mixrateinfo, "Game Mixrate: %d Hz", mixrate);
268 uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, "");
271 uiDefBut(block, LABEL, 0, "Game listener settings:",xco,yco,195,20, 0, 0, 0, 0, 0, "");
274 uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Volume: ",
275 xco,yco,195,24,&G.listener->gain, 0.0, 1.0, 1.0, 0, "Sets the maximum volume for the overall sound");
278 uiDefBut(block, LABEL, 0, "Game Doppler effect settings:",xco,yco,195,20, 0, 0, 0, 0, 0, "");
281 uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Doppler: ",
282 xco,yco,195,24,&G.listener->dopplerfactor, 0.0, 10.0, 1.0, 0, "Use this for scaling the doppler effect");
285 uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Velocity: ",
286 xco,yco,195,24,&G.listener->dopplervelocity,0.0,10000.0, 1.0,0, "Sets the propagation speed of sound");
291 static void sound_panel_sequencer(void)
295 char mixrateinfo[256];
297 block= uiNewBlock(&curarea->uiblocks, "sound_panel_sequencer", UI_EMBOSS, UI_HELV, curarea->win);
298 if(uiNewPanel(curarea, block, "Sequencer", "Sound", 640, 0, 318, 204)==0) return;
300 /* audio sequence engine settings ------------------------------------------------------------------ */
305 uiDefBut(block, LABEL, 0, "Audio sequencer settings", xco,yco,295,20, 0, 0, 0, 0, 0, "");
308 sprintf(mixrateinfo, "Mixing/Sync (latency: %d ms)", (int)( (((float)U.mixbufsize)/(float)G.scene->audio.mixrate)*1000.0 ) );
309 uiDefBut(block, LABEL, 0, mixrateinfo, xco,yco,295,20, 0, 0, 0, 0, 0, "");
312 uiDefButI(block, ROW, B_SOUND_RATECHANGED, "44.1 kHz", xco,yco,75,20, &G.scene->audio.mixrate, 2.0, 44100.0, 0, 0, "Mix at 44.1 kHz");
313 uiDefButI(block, ROW, B_SOUND_RATECHANGED, "48.0 kHz", xco+80,yco,75,20, &G.scene->audio.mixrate, 2.0, 48000.0, 0, 0, "Mix at 48 kHz");
314 uiDefBut(block, BUT, B_SOUND_RECALC, "Recalc", xco+160,yco,75,20, 0, 0, 0, 0, 0, "Recalculate samples");
317 uiDefButBitS(block, TOG, AUDIO_SYNC, B_SOUND_CHANGED, "Sync", xco,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio");
318 uiDefButBitS(block, TOG, AUDIO_SCRUB, B_SOUND_CHANGED, "Scrub", xco+120,yco,115,20, &G.scene->audio.flag, 0, 0, 0, 0, "Scrub when changing frames");
321 uiDefBut(block, LABEL, 0, "Main mix", xco,yco,295,20, 0, 0, 0, 0, 0, "");
324 uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Main (dB): ",
325 xco,yco,235,24,&G.scene->audio.main, -24.0, 6.0, 0, 0, "Set the audio master gain/attenuation in dB");
328 uiDefButBitS(block, TOG, AUDIO_MUTE, 0, "Mute", xco,yco,235,24, &G.scene->audio.flag, 0, 0, 0, 0, "Mute audio from sequencer");
331 uiDefBut(block, BUT, B_SOUND_MIXDOWN, "MIXDOWN", xco,yco,235,24, 0, 0, 0, 0, 0, "Create WAV file from sequenced audio");
335 static void sound_panel_sound(bSound *sound)
337 static int packdummy=0;
341 char *strp, str[32], ch[256];
343 block= uiNewBlock(&curarea->uiblocks, "sound_panel_sound", UI_EMBOSS, UI_HELV, curarea->win);
344 if(uiNewPanel(curarea, block, "Sound", "Sound", 0, 0, 318, 204)==0) return;
346 uiDefBut(block, LABEL, 0, "Blender Sound block",10,180,195,20, 0, 0, 0, 0, 0, "");
348 // warning: abuse of texnr here! (ton didnt code!)
349 buttons_active_id(&id, &idfrom);
350 std_libbuttons(block, 10, 160, 0, NULL, B_SOUNDBROWSE2, ID_SO, 0, id, idfrom, &(G.buts->texnr), 1, 0, 0, 0, 0);
354 uiDefBut(block, BUT, B_SOUND_COPY_SOUND, "Copy sound", 220,160,90,20, 0, 0, 0, 0, 0, "Make another copy (duplicate) of the current sound");
356 uiSetButLock(sound->id.lib!=0, "Can't edit library data");
357 sound_initialize_sample(sound);
358 sample = sound->sample;
361 if (sound->sample && sound->sample->len) {
363 if (sound->sample->channels == 1) tmp= "Mono";
364 else if (sound->sample->channels == 2) tmp= "Stereo";
367 sprintf(ch, "Sample: %s, %d bit, %d Hz, %d samples", tmp, sound->sample->bits, sound->sample->rate, (sound->sample->len/(sound->sample->bits/8)/sound->sample->channels));
368 uiDefBut(block, LABEL, 0, ch, 35,140,225,20, 0, 0, 0, 0, 0, "");
371 uiDefBut(block, LABEL, 0, "Sample: No sample info available.",35,140,225,20, 0, 0, 0, 0, 0, "");
374 /* sample browse buttons */
376 id= (ID *)sound->sample;
377 IDnames_to_pupstring(&strp, NULL, NULL, samples, id, &(G.buts->menunr));
378 if (strp[0]) uiDefButS(block, MENU, B_SOUND_MENU_SAMPLE, strp, 10,120,23,20, &(G.buts->menunr), 0, 0, 0, 0, "Select another loaded sample");
381 uiDefBut(block, TEX, B_SOUND_NAME_SAMPLE, "", 35,120,225,20, sound->name, 0.0, 79.0, 0, 0, "The sample file used by this Sound");
383 sprintf(str, "%d", sample->id.us);
384 uiDefBut(block, BUT, B_SOUND_UNLINK_SAMPLE, str, 260,120,25,20, 0, 0, 0, 0, 0, "The number of users");
386 if (sound->sample->packedfile) packdummy = 1;
389 uiDefIconButBitI(block, TOG, 1, B_SOUND_UNPACK_SAMPLE, ICON_PACKAGE,
390 285, 120,25,24, &packdummy, 0, 0, 0, 0,"Pack/Unpack this sample");
392 uiDefBut(block, BUT, B_SOUND_LOAD_SAMPLE, "Load sample", 10, 95,150,24, 0, 0, 0, 0, 0, "Load a different sample file");
394 uiDefBut(block, BUT, B_SOUND_PLAY_SAMPLE, "Play", 160, 95, 150, 24, 0, 0.0, 0, 0, 0, "Playback sample using settings below");
396 uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Volume: ",
397 10,70,150,20, &sound->volume, 0.0, 1.0, 0, 0, "Game engine only: Set the volume of this sound");
399 uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Pitch: ",
400 160,70,150,20, &sound->pitch, -12.0, 12.0, 0, 0, "Game engine only: Set the pitch of this sound");
403 uiDefButBitI(block, TOG, SOUND_FLAGS_LOOP, B_SOUND_REDRAW, "Loop",
404 10, 50, 95, 20, &sound->flags, 0.0, 0.0, 0, 0, "Game engine only: Toggle between looping on/off");
406 if (sound->flags & SOUND_FLAGS_LOOP) {
407 uiDefButBitI(block, TOG, SOUND_FLAGS_BIDIRECTIONAL_LOOP, B_SOUND_REDRAW, "Ping Pong",
408 105, 50, 95, 20, &sound->flags, 0.0, 0.0, 0, 0, "Game engine only: Toggle between A->B and A->B->A looping");
413 /* 3D settings ------------------------------------------------------------------ */
415 if (sound->sample->channels == 1) {
416 uiDefButBitI(block, TOG, SOUND_FLAGS_3D, B_SOUND_REDRAW, "3D Sound",
417 10, 10, 90, 20, &sound->flags, 0, 0, 0, 0, "Game engine only: Turns 3D sound on");
419 if (sound->flags & SOUND_FLAGS_3D) {
420 uiDefButF(block, NUMSLI, B_SOUND_CHANGED, "Scale: ",
421 100,10,210,20, &sound->attenuation, 0.0, 5.0, 1.0, 0, "Game engine only: Sets the surround scaling factor for this sound");
429 /* ************************* SCENE *********************** */
432 static void output_pic(char *name)
434 strcpy(G.scene->r.pic, name);
435 allqueue(REDRAWBUTSSCENE, 0);
436 BIF_undo_push("Change output picture directory");
439 static void backbuf_pic(char *name)
443 strcpy(G.scene->r.backbuf, name);
444 allqueue(REDRAWBUTSSCENE, 0);
446 ima= add_image(name);
448 free_image_buffers(ima); /* force read again */
451 BIF_undo_push("Change background picture");
454 static void ftype_pic(char *name)
456 strcpy(G.scene->r.ftype, name);
457 allqueue(REDRAWBUTSSCENE, 0);
460 static void scene_chain_cleanup(Scene *sc) {
462 sc->dirty = SCE_CLEAN;
467 static void scene_change_set(Scene *sc, Scene *set) {
468 Scene *scene = G.main->scene.first;
469 int clean = SCE_CLEAN;
473 while(breakout==0 && scene) {
474 Scene *setchain = scene;
475 while(breakout==0 && setchain) {
476 clean = setchain->dirty;
477 if(clean == SCE_DIRTY) {
478 /* we have not reached yet end of chain, and we
479 * encountered dirty node - we have a cycle.
480 * sc->set = 0, clean the chain and break out.
482 error("Can't change set. It would create a loop!");
485 scene_chain_cleanup(scene);
490 setchain->dirty = SCE_DIRTY;
491 setchain = setchain->set;
496 scene_chain_cleanup(scene);
497 scene = scene->id.next;
501 allqueue(REDRAWBUTSSCENE, 0);
502 allqueue(REDRAWVIEW3D, 0);
503 BIF_undo_push("Change set Scene");
507 static void run_playanim(char *file) {
508 extern char bprogname[]; /* usiblender.c */
509 char str[FILE_MAXDIR+FILE_MAXFILE];
512 /* image size not so relevant for now */
513 calc_renderwin_rectangle(640, 480, G.winpos, pos, size);
515 sprintf(str, "%s -a -p %d %d \"%s\"", bprogname, pos[0], pos[1], file);
519 void playback_anim(void)
521 char file[FILE_MAXDIR+FILE_MAXFILE];
523 #ifdef WITH_QUICKTIME
524 if(G.scene->r.imtype == R_QUICKTIME)
528 makeavistring(&G.scene->r, file);
529 if(BLI_exist(file)) {
533 BKE_makepicstring(file, G.scene->r.sfra);
534 if(BLI_exist(file)) {
537 else error("Can't find image: %s", file);
541 void do_render_panels(unsigned short event)
552 allqueue(REDRAWALL, 0);
555 /* new panels added, so... */
557 allqueue(REDRAWBUTSSCENE, 0);
568 sa= closest_bigger_area();
570 if(G.qual == LR_CTRLKEY)
571 activate_imageselect(FILE_SPECIAL, "SELECT OUTPUT PICTURES", G.scene->r.pic, output_pic);
573 activate_fileselect(FILE_SPECIAL, "SELECT OUTPUT PICTURES", G.scene->r.pic, output_pic);
577 sa= closest_bigger_area();
579 if(G.qual == LR_CTRLKEY)
580 activate_imageselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic);
582 activate_fileselect(FILE_SPECIAL, "SELECT BACKBUF PICTURE", G.scene->r.backbuf, backbuf_pic);
586 sa= closest_bigger_area();
588 if(G.qual == LR_CTRLKEY)
589 activate_imageselect(FILE_SPECIAL, "SELECT FTYPE", G.scene->r.ftype, ftype_pic);
591 activate_fileselect(FILE_SPECIAL, "SELECT FTYPE", G.scene->r.ftype, ftype_pic);
595 G.scene->r.xsch= 720;
596 G.scene->r.ysch= 576;
599 G.scene->r.size= 100;
600 G.scene->r.frs_sec= 25;
601 G.scene->r.mode &= ~R_PANORAMA;
602 G.scene->r.xparts= G.scene->r.yparts= 4;
604 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
605 BIF_undo_push("Set PAL");
606 allqueue(REDRAWBUTSSCENE, 0);
607 allqueue(REDRAWVIEWCAM, 0);
611 allqueue(REDRAWBUTSSCENE, 0);
612 #if defined (_WIN32) || defined (__APPLE__)
613 // fall through to codec settings if this is the first
614 // time R_AVICODEC is selected for this scene.
615 if (((G.scene->r.imtype == R_AVICODEC)
616 && (G.scene->r.avicodecdata == NULL)) ||
617 ((G.scene->r.imtype == R_QUICKTIME)
618 && (G.scene->r.qtcodecdata == NULL))) {
622 #endif /*_WIN32 || __APPLE__ */
625 #if defined (_WIN32) || defined (__APPLE__)
626 if ((G.scene->r.imtype == R_QUICKTIME)) { /* || (G.scene->r.qtcodecdata)) */
627 #ifdef WITH_QUICKTIME
628 get_qtcodec_settings();
629 #endif /* WITH_QUICKTIME */
631 #if defined (_WIN32) && !defined(FREE_WINDOWS)
633 get_avicodec_settings();
634 #endif /* _WIN32 && !FREE_WINDOWS */
635 #endif /* _WIN32 || __APPLE__ */
639 G.scene->r.xsch= 1280;
640 G.scene->r.ysch= 1024;
643 G.scene->r.size= 100;
644 G.scene->r.mode &= ~R_PANORAMA;
645 G.scene->r.xparts= G.scene->r.yparts= 4;
647 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
648 BIF_undo_push("Set FULL");
649 allqueue(REDRAWBUTSSCENE, 0);
650 allqueue(REDRAWVIEWCAM, 0);
653 G.scene->r.xsch= 640;
654 G.scene->r.ysch= 512;
658 G.scene->r.mode &= ~R_PANORAMA;
659 G.scene->r.xparts= G.scene->r.yparts= 4;
661 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
662 allqueue(REDRAWVIEWCAM, 0);
663 allqueue(REDRAWBUTSSCENE, 0);
666 G.scene->r.xsch= 384;
667 G.scene->r.ysch= 280;
670 G.scene->r.size= 100;
671 G.scene->r.mode &= ~R_PANORAMA;
672 G.scene->r.xparts= G.scene->r.yparts= 4;
674 BLI_init_rctf(&G.scene->r.safety, 0.15, 0.85, 0.15, 0.85);
675 allqueue(REDRAWVIEWCAM, 0);
676 allqueue(REDRAWBUTSSCENE, 0);
679 G.scene->r.xsch= 720;
680 G.scene->r.ysch= 576;
683 G.scene->r.size= 100;
684 G.scene->r.frs_sec= 25;
685 G.scene->r.mode &= ~R_PANORAMA;
686 G.scene->r.xparts= G.scene->r.yparts= 4;
688 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
689 BIF_undo_push("Set PAL 16/9");
690 allqueue(REDRAWVIEWCAM, 0);
691 allqueue(REDRAWBUTSSCENE, 0);
694 G.scene->r.xsch= 1024;
695 G.scene->r.ysch= 576;
699 G.scene->r.mode &= ~R_PANORAMA;
700 G.scene->r.xparts= G.scene->r.yparts= 4;
702 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
703 allqueue(REDRAWVIEWCAM, 0);
704 allqueue(REDRAWBUTSSCENE, 0);
707 G.scene->r.xsch= 368;
708 G.scene->r.ysch= 272;
709 G.scene->r.xasp= 105;
710 G.scene->r.yasp= 100;
711 G.scene->r.size= 100;
712 G.scene->r.mode &= ~R_PANORAMA;
713 G.scene->r.xparts= G.scene->r.yparts= 4;
715 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
716 allqueue(REDRAWVIEWCAM, 0);
717 allqueue(REDRAWBUTSSCENE, 0);
720 G.scene->r.xsch= 640;
721 G.scene->r.ysch= 480;
722 G.scene->r.xasp= 100;
723 G.scene->r.yasp= 100;
724 G.scene->r.size= 100;
725 G.scene->r.mode &= ~R_PANORAMA;
726 G.scene->r.xparts= G.scene->r.yparts= 4;
728 BLI_init_rctf(&G.scene->r.safety, 0.0, 1.0, 0.0, 1.0);
729 BIF_undo_push("Set PC");
730 allqueue(REDRAWVIEWCAM, 0);
731 allqueue(REDRAWBUTSSCENE, 0);
734 G.scene->r.xsch= 720;
735 G.scene->r.ysch= 576;
738 G.scene->r.size= 100;
739 G.scene->r.mode= R_OSA+R_SHADOW+R_FIELDS;
740 G.scene->r.imtype= R_TARGA;
741 G.scene->r.xparts= G.scene->r.yparts= 4;
743 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
744 BIF_undo_push("Set Default");
745 allqueue(REDRAWVIEWCAM, 0);
746 allqueue(REDRAWBUTSSCENE, 0);
750 G.scene->r.ysch= 176;
751 G.scene->r.xasp= 115;
752 G.scene->r.yasp= 100;
753 G.scene->r.size= 100;
754 G.scene->r.mode |= R_PANORAMA;
755 G.scene->r.xparts= 16;
756 G.scene->r.yparts= 1;
758 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
759 BIF_undo_push("Set Panorama");
760 allqueue(REDRAWVIEWCAM, 0);
761 allqueue(REDRAWBUTSSCENE, 0);
764 G.scene->r.xsch= 720;
765 G.scene->r.ysch= 480;
768 G.scene->r.size= 100;
769 G.scene->r.frs_sec= 30;
770 G.scene->r.mode &= ~R_PANORAMA;
771 G.scene->r.xparts= G.scene->r.yparts= 2;
773 BLI_init_rctf(&G.scene->r.safety, 0.1, 0.9, 0.1, 0.9);
774 BIF_undo_push("Set NTSC");
775 allqueue(REDRAWBUTSSCENE, 0);
776 allqueue(REDRAWVIEWCAM, 0);
780 id= (ID*) G.scene->set;
782 if (G.buts->menunr==-2) {
783 activate_databrowse(id, ID_SCE, 0, B_SETBROWSE, &G.buts->menunr, do_render_panels);
784 } else if (G.buts->menunr>0) {
785 Scene *newset= (Scene*) BLI_findlink(&G.main->scene, G.buts->menunr-1);
788 error("Not allowed");
790 scene_change_set(G.scene, newset);
794 scene_change_set(G.scene, NULL);
798 /* copy is needed... not so nice, but how better? */
799 // R.r.postgamma= G.scene->r.postgamma;
800 // R.r.postigamma= 1.0/R.r.postgamma;
801 // R.r.postadd= G.scene->r.postadd;
802 // R.r.postmul= G.scene->r.postmul;
803 // R.r.posthue= G.scene->r.posthue;
804 // R.r.postsat= G.scene->r.postsat;
805 // R.r.dither_intensity= G.scene->r.dither_intensity;
807 // _floatbuffer_to_output();
808 // BIF_redraw_render_rect();
812 G.scene->r.mode &= ~R_ZBLUR;
813 allqueue(REDRAWBUTSSCENE, 0);
816 G.scene->r.mode &= ~R_EDGE;
817 allqueue(REDRAWBUTSSCENE, 0);
822 /* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
823 static uiBlock *edge_render_menu(void *arg_unused)
827 block= uiNewBlock(&curarea->uiblocks, "edge render", UI_EMBOSS, UI_HELV, curarea->win);
829 /* use this for a fake extra empy space around the buttons */
830 uiDefBut(block, LABEL, 0, "", 290, -15, 220, 115, NULL, 0, 0, 0, 0, "");
832 uiBlockBeginAlign(block);
833 uiDefButS(block, NUM, 0,"Eint:", 370,75,135,19, &G.scene->r.edgeint, 0.0, 255.0, 0, 0,
834 "Sets edge intensity for Toon shading");
835 uiDefButS(block, NUM, 0,"AntiShift",370,55,135,19, &(G.scene->r.same_mat_redux), 0, 255.0, 0, 0,
836 "For unified renderer: reduce intensity on boundaries "
837 "with identical materials with this number.");
839 uiBlockBeginAlign(block);
840 uiDefButI(block, TOG, 0,"Shift", 295,75,70,19, &G.compat, 0, 0, 0, 0,
841 "For unified renderer: use old offsets for edges");
842 uiDefButI(block, TOG, 0,"All", 295,55,70,19, &G.notonlysolid, 0, 0, 0, 0,
843 "For unified renderer: also consider transparent faces for toon shading");
844 uiBlockEndAlign(block);
846 /* colour settings for the toon shading */
847 uiDefButF(block, COL, 0, "", 295,-10,30,60, &(G.scene->r.edgeR), 0, 0, 0, B_EDGECOLSLI, "");
849 uiBlockBeginAlign(block);
850 uiDefButF(block, NUMSLI, 0, "R ", 330, 30, 175,19, &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0,
851 "For unified renderer: Colour for edges in toon shading mode.");
852 uiDefButF(block, NUMSLI, 0, "G ", 330, 10, 175,19, &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0,
853 "For unified renderer: Colour for edges in toon shading mode.");
854 uiDefButF(block, NUMSLI, 0, "B ", 330, -10, 175,19, &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0,
855 "For unified renderer: Colour for edges in toon shading mode.");
858 uiBlockSetDirection(block, UI_TOP);
863 /* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
864 static uiBlock *post_render_menu(void *arg_unused)
868 block= uiNewBlock(&curarea->uiblocks, "post render", UI_EMBOSS, UI_HELV, curarea->win);
870 /* use this for a fake extra empy space around the buttons */
871 uiDefBut(block, LABEL, 0, "", -10, -10, 200, 120, NULL, 0, 0, 0, 0, "");
872 uiBlockBeginAlign(block);
873 uiDefButF(block, NUMSLI, 0, "Add:", 0,80,180,19, &G.scene->r.postadd, -1.0, 1.0, 0, 0, "");
874 uiDefButF(block, NUMSLI, 0, "Mul:", 0,60,180,19, &G.scene->r.postmul, 0.01, 4.0, 0, 0, "");
875 uiDefButF(block, NUMSLI, 0, "Gamma:", 0,40,180,19, &G.scene->r.postgamma, 0.1, 4.0, 0, 0, "");
876 uiDefButF(block, NUMSLI, 0, "Hue:", 0,20,180,19, &G.scene->r.posthue, -0.5, 0.5, 0, 0, "");
877 uiDefButF(block, NUMSLI, 0, "Sat:", 0, 0,180,19, &G.scene->r.postsat, 0.0, 4.0, 0, 0, "");
879 uiBlockSetDirection(block, UI_TOP);
881 addqueue(curarea->win, UI_BUT_EVENT, B_FBUF_REDO);
886 /* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
887 static uiBlock *framing_render_menu(void *arg_unused)
890 short yco = 190, xco = 0;
891 int randomcolorindex = 1234;
893 block= uiNewBlock(&curarea->uiblocks, "framing_options", UI_EMBOSS, UI_HELV, curarea->win);
895 /* use this for a fake extra empy space around the buttons */
896 uiDefBut(block, LABEL, 0, "", -5, -10, 295, 224, NULL, 0, 0, 0, 0, "");
898 uiDefBut(block, LABEL, 0, "Framing:", xco, yco, 68,19, 0, 0, 0, 0, 0, "");
899 uiBlockBeginAlign(block);
900 uiDefButC(block, ROW, 0, "Stretch", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_SCALE , 0, 0, "Stretch or squeeze the viewport to fill the display window");
901 uiDefButC(block, ROW, 0, "Expose", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_EXTEND, 0, 0, "Show the entire viewport in the display window, viewing more horizontally or vertically");
902 uiDefButC(block, ROW, 0, "Letterbox", xco += 70, yco, 68, 19, &G.scene->framing.type, 1.0, SCE_GAMEFRAMING_BARS , 0, 0, "Show the entire viewport in the display window, using bar horizontally or vertically");
903 uiBlockEndAlign(block);
908 uiDefButF(block, COL, 0, "", 0, yco - 58 + 18, 33, 58, &G.scene->framing.col[0], 0, 0, 0, randomcolorindex, "");
910 uiBlockBeginAlign(block);
911 uiDefButF(block, NUMSLI, 0, "R ", xco,yco,243,18, &G.scene->framing.col[0], 0.0, 1.0, randomcolorindex, 0, "Set the red component of the bars");
913 uiDefButF(block, NUMSLI, 0, "G ", xco,yco,243,18, &G.scene->framing.col[1], 0.0, 1.0, randomcolorindex, 0, "Set the green component of the bars");
915 uiDefButF(block, NUMSLI, 0, "B ", xco,yco,243,18, &G.scene->framing.col[2], 0.0, 1.0, randomcolorindex, 0, "Set the blue component of the bars");
916 uiBlockEndAlign(block);
919 uiDefBut(block, LABEL, 0, "Fullscreen:", xco, yco-=30, 100, 19, 0, 0.0, 0.0, 0, 0, "");
920 uiDefButS(block, TOG, 0, "Fullscreen", xco+70, yco, 68, 19, &G.scene->r.fullscreen, 0.0, 0.0, 0, 0, "Starts player in a new fullscreen display");
921 uiBlockBeginAlign(block);
922 uiDefButS(block, NUM, 0, "X:", xco+40, yco-=27, 100, 19, &G.scene->r.xplay, 10.0, 2000.0, 0, 0, "Displays current X screen/window resolution. Click to change.");
923 uiDefButS(block, NUM, 0, "Y:", xco+140, yco, 100, 19, &G.scene->r.yplay, 10.0, 2000.0, 0, 0, "Displays current Y screen/window resolution. Click to change.");
924 uiDefButS(block, NUM, 0, "Freq:", xco+40, yco-=21, 100, 19, &G.scene->r.freqplay, 10.0, 2000.0, 0, 0, "Displays clock frequency of fullscreen display. Click to change.");
925 uiDefButS(block, NUM, 0, "Bits:", xco+140, yco, 100, 19, &G.scene->r.depth, 8.0, 32.0, 800.0, 0, "Displays bit depth of full screen display. Click to change.");
926 uiBlockEndAlign(block);
928 /* stereo settings */
929 /* can't use any definition from the game engine here so hardcode it. Change it here when it changes there!
930 * RAS_IRasterizer has definitions:
931 * RAS_STEREO_NOSTEREO 1
932 * RAS_STEREO_QUADBUFFERED 2
933 * RAS_STEREO_ABOVEBELOW 3
934 * RAS_STEREO_INTERLACED 4 future
935 * RAS_STEREO_ANAGLYPH 5
936 * RAS_STEREO_SIDEBYSIDE 6
937 * RAS_STEREO_VINTERLACE 7
939 uiBlockBeginAlign(block);
940 uiDefButS(block, ROW, 0, "No Stereo", xco, yco-=30, 88, 19, &(G.scene->r.stereomode), 7.0, 1.0, 0, 0, "Disables stereo");
941 uiDefButS(block, ROW, 0, "Pageflip", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 2.0, 0, 0, "Enables hardware pageflip stereo method");
942 uiDefButS(block, ROW, 0, "Syncdouble", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 3.0, 0, 0, "Enables syncdoubling stereo method");
943 uiDefButS(block, ROW, 0, "Anaglyph", xco-=180, yco-=21, 88, 19, &(G.scene->r.stereomode), 7.0, 5.0, 0, 0, "Enables anaglyph (Red-Blue) stereo method");
944 uiDefButS(block, ROW, 0, "Side by Side", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 6.0, 0, 0, "Enables side by side left and right images");
945 uiDefButS(block, ROW, 0, "V Interlace", xco+=90, yco, 88, 19, &(G.scene->r.stereomode), 7.0, 7.0, 0, 0, "Enables interlaced vertical strips for autostereo display");
947 uiBlockEndAlign(block);
949 uiBlockSetDirection(block, UI_TOP);
955 static char *imagetype_pup(void)
957 static char string[1024];
958 char formatstring[1024];
959 char appendstring[1024];
961 strcpy(formatstring, "Save image as: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
964 strcat(formatstring, "|%s %%x%d"); // add space for Movie
967 strcat(formatstring, "|%s %%x%d"); // add space for PNG
968 strcat(formatstring, "|%s %%x%d"); // add space for BMP
969 strcat(formatstring, "|%s %%x%d"); // add space for Radiance HDR
972 strcat(formatstring, "|%s %%x%d"); // add space for AVI Codec
975 #ifdef WITH_QUICKTIME
977 strcat(formatstring, "|%s %%x%d"); // add space for Quicktime
980 if(G.have_quicktime) {
981 sprintf(string, formatstring,
983 "AVI Jpeg", R_AVIJPEG,
985 "AVI Codec", R_AVICODEC,
987 #ifdef WITH_QUICKTIME
988 "QuickTime", R_QUICKTIME,
991 "Targa Raw", R_RAWTGA,
997 "Iris + Zbuffer", R_IRIZ,
998 "Radiance HDR", R_RADHDR
1004 sprintf(string, formatstring,
1005 "AVI Raw", R_AVIRAW,
1006 "AVI Jpeg", R_AVIJPEG,
1008 "AVI Codec", R_AVICODEC,
1011 "Targa Raw", R_RAWTGA,
1017 "Iris + Zbuffer", R_IRIZ,
1018 "Radiance HDR", R_RADHDR
1026 strcpy(formatstring, "|%s %%x%d");
1027 sprintf(appendstring, formatstring, "OpenEXR", R_OPENEXR);
1028 strcat(string, appendstring);
1031 if (G.have_libtiff) {
1032 strcpy(formatstring, "|%s %%x%d");
1033 sprintf(appendstring, formatstring, "TIFF", R_TIFF);
1034 strcat(string, appendstring);
1041 static char *avicodec_str(void)
1043 static char string[1024];
1045 sprintf(string, "Codec: %s", G.scene->r.avicodecdata->avicodecname);
1051 static void render_panel_output(void)
1059 block= uiNewBlock(&curarea->uiblocks, "render_panel_output", UI_EMBOSS, UI_HELV, curarea->win);
1060 if(uiNewPanel(curarea, block, "Output", "Render", 0, 0, 318, 204)==0) return;
1062 uiBlockBeginAlign(block);
1063 uiDefIconBut(block, BUT, B_FS_PIC, ICON_FILESEL, 10, 190, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name");
1064 uiDefBut(block, TEX,0,"", 31, 190, 279, 20,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save rendered Pics to");
1065 uiDefIconBut(block, BUT,B_FS_BACKBUF, ICON_FILESEL, 10, 168, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
1066 uiDefBut(block, TEX,0,"", 31, 168, 279, 20,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering");
1067 uiDefIconBut(block, BUT,B_FS_FTYPE, ICON_FILESEL, 10, 146, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image");
1068 uiDefBut(block, TEX,0,"", 31, 146, 279, 20,G.scene->r.ftype,0.0,79.0, 0, 0, "Image to use with FTYPE Image type");
1069 uiBlockEndAlign(block);
1073 uiBlockBeginAlign(block);
1074 id= (ID *)G.scene->set;
1075 IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), id, &(G.buts->menunr));
1077 uiDefButS(block, MENU, B_SETBROWSE, strp, 10, 120, 20, 20, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set");
1081 uiSetButLock(1, NULL);
1082 uiDefIDPoinBut(block, test_scenepoin_but, ID_SCE, 0, "", 31, 120, 100, 20, &(G.scene->set), "Name of the Set");
1084 uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 132, 120, 20, 20, 0, 0, 0, 0, 0, "Remove Set link");
1086 uiBlockEndAlign(block);
1088 uiBlockSetCol(block, TH_BUT_SETTING1);
1089 uiDefButBitS(block, TOG, R_BACKBUF, B_NOP,"Backbuf", 10, 94, 80, 20, &G.scene->r.bufflag, 0, 0, 0, 0, "Enable/Disable use of Backbuf image");
1090 uiDefButBitI(block, TOG, R_THREADS, B_NOP,"Threads", 10, 68, 80, 20, &G.scene->r.mode, 0, 0, 0, 0, "Enable/Disable render in two threads");
1091 uiBlockSetCol(block, TH_AUTO);
1093 uiBlockBeginAlign(block);
1096 uiDefButBitS(block, TOG, 1<<(3*b+a), 800,"", (short)(10+18*a),(short)(10+14*b),16,12, &G.winpos, 0, 0, 0, 0, "Render window placement on screen");
1097 uiBlockEndAlign(block);
1099 uiBlockBeginAlign(block);
1100 uiDefButS(block, ROW, B_REDR, "DispWin", 72, 10, 60, 20, &G.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output to display in a seperate window");
1101 uiDefButS(block, ROW, B_REDR, "DispView", 134, 10, 60, 20, &G.displaymode, 0.0, (float)R_DISPLAYVIEW, 0, 0, "Sets render output to display in 3D view");
1102 uiBlockEndAlign(block);
1104 uiDefButBitS(block, TOG, R_EXTENSION, 0, "Extensions", 205, 10, 105, 19, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds extensions to the output when rendering animations");
1106 /* Dither control */
1107 uiDefButF(block, NUM,B_DIFF, "Dither:", 205,31,105,19, &G.scene->r.dither_intensity, 0.0, 2.0, 0, 0, "The amount of dithering noise present in the output image (0.0 = no dithering)");
1109 /* Toon shading buttons */
1110 uiBlockBeginAlign(block);
1111 uiDefButBitI(block, TOG, R_EDGE, 0,"Edge", 100, 94, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon edge shading");
1112 uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings", 170, 94, 140, 20, "Display edge settings");
1114 /* postprocess render buttons */
1115 uiBlockBeginAlign(block);
1117 // uiDefIconTextButBitI(block, TOG, R_FBUF, B_NOP, ICON_IMAGE_DEHLT," Fbuf", 100, 68, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render; buffer available");
1119 // uiDefButBitI(block, TOG, R_FBUF, 0,"Fbuf", 100, 68, 70, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render, no buffer available now");
1120 uiDefBlockBut(block, post_render_menu, NULL, "Post process", 170, 68, 140, 20, "Applies on RGBA floats while render or with Fbuf available");
1121 uiBlockEndAlign(block);
1123 /* removed, for time being unified and normal render will use same gamma for blending (2.0) */
1124 //if (G.scene->r.mode & R_GAMMA) {
1125 // uiDefButF(block, NUMSLI, B_NOP,"Gamma:", 10, 68, 142, 20,
1126 // &(G.scene->r.gamma), 0.2, 5.0, B_GAMMASLI, 0,
1127 // "The gamma value for blending oversampled images (1.0 = no correction).");
1131 static void render_panel_render(void)
1136 block= uiNewBlock(&curarea->uiblocks, "render_panel_render", UI_EMBOSS, UI_HELV, curarea->win);
1137 if(uiNewPanel(curarea, block, "Render", "Render", 320, 0, 318, 204)==0) return;
1139 uiBlockBeginAlign(block);
1140 uiDefBut(block, BUT,B_DORENDER,"RENDER", 369, 164, 191,37, 0, 0, 0, 0, 0, "Start the rendering");
1141 /* yafray: on request, render engine menu is back again, and moved to Render panel */
1142 uiDefButS(block, MENU, B_SWITCHRENDER, "Rendering Engine %t|Blender Internal %x0|YafRay %x1",
1143 369, 142, 191, 20, &G.scene->r.renderer, 0, 0, 0, 0, "Choose rendering engine");
1145 uiBlockBeginAlign(block);
1146 uiDefButBitI(block, TOG, R_OSA, 0, "OSA", 369,109,122,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
1147 uiDefButS(block, ROW,B_DIFF,"5", 369,88,29,20,&G.scene->r.osa,2.0,5.0, 0, 0, "Sets oversample level to 5");
1148 uiDefButS(block, ROW,B_DIFF,"8", 400,88,29,20,&G.scene->r.osa,2.0,8.0, 0, 0, "Sets oversample level to 8 (Recommended)");
1149 uiDefButS(block, ROW,B_DIFF,"11", 431,88,29,20,&G.scene->r.osa,2.0,11.0, 0, 0, "Sets oversample level to 11");
1150 uiDefButS(block, ROW,B_DIFF,"16", 462,88,29,20,&G.scene->r.osa,2.0,16.0, 0, 0, "Sets oversample level to 16");
1151 uiBlockEndAlign(block);
1153 uiBlockBeginAlign(block);
1154 uiDefButBitI(block, TOG, R_MBLUR, 0, "MBLUR", 496,109,64,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Motion Blur calculation");
1155 uiDefButF(block, NUM,B_DIFF,"Bf:", 496,88,64,20,&G.scene->r.blurfac, 0.01, 5.0, 10, 2, "Sets motion blur factor");
1156 uiBlockEndAlign(block);
1158 uiBlockBeginAlign(block);
1159 uiDefButS(block, NUM,B_DIFF,"Xparts:", 369,46,95,29,&G.scene->r.xparts,2.0, 64.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)");
1160 uiDefButS(block, NUM,B_DIFF,"Yparts:", 465,46,95,29,&G.scene->r.yparts,2.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in");
1161 uiBlockEndAlign(block);
1163 uiBlockBeginAlign(block);
1164 uiDefButS(block, ROW,800,"Sky", 369,13,35,20,&G.scene->r.alphamode,3.0,0.0, 0, 0, "Fill background with sky");
1165 uiDefButS(block, ROW,800,"Premul", 405,13,50,20,&G.scene->r.alphamode,3.0,1.0, 0, 0, "Multiply alpha in advance");
1166 uiDefButS(block, ROW,800,"Key", 456,13,35,20,&G.scene->r.alphamode,3.0,2.0, 0, 0, "Alpha and colour values remain unchanged");
1167 uiBlockEndAlign(block);
1169 if(G.scene->r.mode & R_RAYTRACE)
1170 uiDefButS(block, MENU, B_DIFF,"Octree resolution %t|64 %x64|128 %x128|256 %x256|512 %x512", 496,13,64,20,&G.scene->r.ocres,0.0,0.0, 0, 0, "Octree resolution for ray tracing");
1172 uiBlockBeginAlign(block);
1173 uiDefButBitI(block, TOG, R_SHADOW, 0,"Shadow", 565,172,60,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable shadow calculation");
1174 uiDefButBitI(block, TOG, R_ENVMAP, 0,"EnvMap", 627,172,60,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable environment map rendering");
1175 uiDefButBitI(block, TOG, R_PANORAMA, 0,"Pano", 565,142,40,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)");
1176 uiDefButBitI(block, TOG, R_RAYTRACE, B_REDR,"Ray",606,142,40,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable ray tracing");
1177 uiDefButBitI(block, TOG, R_RADIO, 0,"Radio", 647,142,40,29, &G.scene->r.mode, 0, 0, 0, 0, "Enable radiosity rendering");
1178 uiBlockEndAlign(block);
1180 uiBlockBeginAlign(block);
1181 uiDefButS(block, ROW,B_DIFF,"100%", 565,109,122,20,&G.scene->r.size,1.0,100.0, 0, 0, "Set render size to defined size");
1182 uiDefButS(block, ROW,B_DIFF,"75%", 565,88,40,20,&G.scene->r.size,1.0,75.0, 0, 0, "Set render size to 3/4 of defined size");
1183 uiDefButS(block, ROW,B_DIFF,"50%", 606,88,40,20,&G.scene->r.size,1.0,50.0, 0, 0, "Set render size to 1/2 of defined size");
1184 uiDefButS(block, ROW,B_DIFF,"25%", 647,88,40,20,&G.scene->r.size,1.0,25.0, 0, 0, "Set render size to 1/4 of defined size");
1185 uiBlockEndAlign(block);
1187 uiBlockBeginAlign(block);
1188 uiDefButBitI(block, TOG, R_FIELDS, 0,"Fields", 565,55,60,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables field rendering");
1189 uiDefButBitI(block, TOG, R_ODDFIELD, 0,"Odd", 627,55,39,20,&G.scene->r.mode, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)");
1190 uiDefButBitI(block, TOG, R_FIELDSTILL, 0,"X", 668,55,19,20,&G.scene->r.mode, 0, 0, 0, 0, "Disables time difference in field calculations");
1192 sprintf(str, "Filter%%t|Box %%x%d|Tent %%x%d|Quad %%x%d|Cubic %%x%d|Gauss %%x%d|CatRom %%x%d|Mitch %%x%d", R_FILTER_BOX, R_FILTER_TENT, R_FILTER_QUAD, R_FILTER_CUBIC, R_FILTER_GAUSS, R_FILTER_CATROM, R_FILTER_MITCH);
1193 uiDefButS(block, MENU, B_DIFF,str, 565,34,60,20, &G.scene->r.filtertype, 0, 0, 0, 0, "Set sampling filter for antialiasing");
1194 uiDefButF(block, NUM,B_DIFF,"", 627,34,60,20,&G.scene->r.gauss,0.5, 1.5, 10, 2, "Sets the filter size");
1196 uiDefButBitI(block, TOG, R_BORDER, REDRAWVIEWCAM, "Border", 565,13,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image");
1197 uiDefButBitI(block, TOG, R_GAMMA, B_REDR, "Gamma", 627,13,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction");
1198 uiBlockEndAlign(block);
1202 static void render_panel_anim(void)
1207 block= uiNewBlock(&curarea->uiblocks, "render_panel_anim", UI_EMBOSS, UI_HELV, curarea->win);
1208 if(uiNewPanel(curarea, block, "Anim", "Render", 640, 0, 318, 204)==0) return;
1211 uiDefBut(block, BUT,B_DOANIM,"ANIM", 692,142,192,47, 0, 0, 0, 0, 0, "Start rendering a sequence");
1213 uiBlockSetCol(block, TH_BUT_SETTING1);
1214 uiBlockBeginAlign(block);
1215 uiDefButBitS(block, TOG, R_DOSEQ, B_NOP, "Do Sequence",692,114,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Enables sequence output rendering (Default: 3D rendering)");
1216 uiDefButBitS(block, TOG, R_DOCOMP, B_NOP, "Do Composit",692,90,192,20, &G.scene->r.scemode, 0, 0, 0, 0, "Uses compositing nodes for output rendering");
1217 uiBlockEndAlign(block);
1219 uiBlockSetCol(block, TH_AUTO);
1220 uiDefBut(block, BUT,B_PLAYANIM, "PLAY",692,40,94,33, 0, 0, 0, 0, 0, "Play animation of rendered images/avi (searches Pics: field)");
1221 uiDefButS(block, NUM, B_RTCHANGED, "rt:",789,40,95,33, &G.rt, -1000.0, 1000.0, 0, 0, "General testing/debug button");
1223 uiBlockBeginAlign(block);
1224 uiDefButS(block, NUM,REDRAWSEQ,"Sta:",692,10,94,24, &G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "The start frame of the animation");
1225 uiDefButS(block, NUM,REDRAWSEQ,"End:",789,10,95,24, &G.scene->r.efra,1.0,MAXFRAMEF, 0, 0, "The end frame of the animation");
1226 uiBlockEndAlign(block);
1229 static void render_panel_format(void)
1235 block= uiNewBlock(&curarea->uiblocks, "render_panel_format", UI_EMBOSS, UI_HELV, curarea->win);
1236 if(uiNewPanel(curarea, block, "Format", "Render", 960, 0, 318, 204)==0) return;
1237 uiDefBlockBut(block, framing_render_menu, NULL,
1238 "Game framing settings",
1239 892, 169, 227, 20, "Display game framing settings");
1240 /* uiDefIconTextBlockBut(block, framing_render_menu, NULL,
1241 ICON_BLOCKBUT_CORNER,
1242 "Game framing settings",
1244 "Display game framing settings"); */
1246 uiBlockBeginAlign(block);
1247 uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeX:", 892 ,136,112,27, &G.scene->r.xsch, 4.0, 10000.0, 0, 0, "The image width in pixels");
1248 uiDefButS(block, NUM,REDRAWVIEWCAM,"SizeY:", 1007,136,112,27, &G.scene->r.ysch, 4.0,10000.0, 0, 0, "The image height in scanlines");
1249 uiDefButS(block, NUM,REDRAWVIEWCAM,"AspX:", 892 ,114,112,20, &G.scene->r.xasp, 1.0,200.0, 0, 0, "The horizontal aspect ratio");
1250 uiDefButS(block, NUM,REDRAWVIEWCAM,"AspY:", 1007,114,112,20, &G.scene->r.yasp, 1.0,200.0, 0, 0, "The vertical aspect ratio");
1251 uiBlockEndAlign(block);
1257 uiDefButS(block, NUM,B_DIFF,"MaxSize:", 892,32,165,20, &G.scene->r.maximsize, 0.0, 500.0, 0, 0, "Maximum size per frame to save in an SGI movie");
1258 uiDefButBitI(block, TOG, R_COSMO, 0,"Cosmo", 1059,32,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Attempt to save SGI movies using Cosmo hardware");
1262 uiDefButS(block, MENU,B_FILETYPEMENU,imagetype_pup(), 892,yofs,174,20, &G.scene->r.imtype, 0, 0, 0, 0, "Images are saved in this file format");
1263 uiDefButBitI(block, TOG, R_MOVIECROP, B_DIFF, "Crop", 1068,yofs,51,20, &G.scene->r.mode, 0, 0, 0, 0, "Exclude border rendering from total image");
1267 if(G.scene->r.quality==0) G.scene->r.quality= 90;
1269 #ifdef WITH_QUICKTIME
1270 if (G.scene->r.imtype == R_AVICODEC || G.scene->r.imtype == R_QUICKTIME) {
1271 #else /* WITH_QUICKTIME */
1274 if(G.scene->r.imtype == R_QUICKTIME) {
1275 #ifdef WITH_QUICKTIME
1276 #if defined (_WIN32) || defined (__APPLE__)
1277 //glColor3f(0.65, 0.65, 0.7);
1278 //glRecti(892,yofs+46,892+225,yofs+45+20);
1279 if(G.scene->r.qtcodecdata == NULL)
1280 uiDefBut(block, LABEL, 0, "Codec: not set", 892,yofs+44,225,20, 0, 0, 0, 0, 0, "");
1282 uiDefBut(block, LABEL, 0, G.scene->r.qtcodecdata->qtcodecname, 892,yofs+44,225,20, 0, 0, 0, 0, 0, "");
1283 uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime");
1285 #endif /* WITH_QUICKTIME */
1288 //glColor3f(0.65, 0.65, 0.7);
1289 //glRecti(892,yofs+46,892+225,yofs+45+20);
1290 if(G.scene->r.avicodecdata == NULL)
1291 uiDefBut(block, LABEL, 0, "Codec: not set.", 892,yofs+43,225,20, 0, 0, 0, 0, 0, "");
1293 uiDefBut(block, LABEL, 0, avicodec_str(), 892,yofs+43,225,20, 0, 0, 0, 0, 0, "");
1295 uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI");
1299 else if (G.scene->r.imtype == R_OPENEXR ) {
1300 if (G.scene->r.quality > 5) G.scene->r.quality = 0;
1302 uiBlockBeginAlign(block);
1303 uiDefButBitS(block, TOG, R_OPENEXR_HALF, B_NOP,"Half", 892,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Use 16 bits float 'Half' type");
1304 uiDefButBitS(block, TOG, R_OPENEXR_ZBUF, B_NOP,"Zbuf", 952,yofs+44,60,20, &G.scene->r.subimtype, 0, 0, 0, 0, "Save the zbuffer as 32 bits unsigned int");
1305 uiBlockEndAlign(block);
1307 uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4",
1308 892,yofs,112,20, &G.scene->r.quality, 0, 0, 0, 0, "Set codec settings for OpenEXR");
1312 if(G.scene->r.quality < 5) G.scene->r.quality = 90; /* restore from openexr */
1314 uiDefButS(block, NUM,B_DIFF, "Quality:", 892,yofs,112,20, &G.scene->r.quality, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies");
1316 uiDefButS(block, NUM,B_FRAMEMAP,"Frs/sec:", 1006,yofs,113,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second");
1319 uiBlockBeginAlign(block);
1320 uiDefButS(block, ROW,B_DIFF,"BW", 892, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANESBW, 0, 0, "Images are saved with BW (grayscale) data");
1321 uiDefButS(block, ROW,B_DIFF,"RGB", 968, 10,74,19, &G.scene->r.planes, 5.0,(float)R_PLANES24, 0, 0, "Images are saved with RGB (color) data");
1322 uiDefButS(block, ROW,B_DIFF,"RGBA", 1044, 10,75,19, &G.scene->r.planes, 5.0,(float)R_PLANES32, 0, 0, "Images are saved with RGB and Alpha data (if supported)");
1324 uiBlockBeginAlign(block);
1325 uiDefBut(block, BUT,B_PR_PAL, "PAL", 1146,170,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 54x51, 25 fps");
1326 uiDefBut(block, BUT,B_PR_NTSC, "NTSC", 1146,150,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x480, Aspect ratio - 10x11, 30 fps");
1327 uiDefBut(block, BUT,B_PR_PRESET, "Default", 1146,130,100,18, 0, 0, 0, 0, 0, "Same as PAL, with render settings (OSA, Shadows, Fields)");
1328 uiDefBut(block, BUT,B_PR_PRV, "Preview", 1146,110,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x512, Render size 50%");
1329 uiDefBut(block, BUT,B_PR_PC, "PC", 1146,90,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x480, Aspect ratio - 100x100");
1330 uiDefBut(block, BUT,B_PR_PAL169, "PAL 16:9",1146,70,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 64x45");
1331 uiDefBut(block, BUT,B_PR_PANO, "PANO", 1146,50,100,18, 0, 0, 0, 0, 0, "Standard panorama settings");
1332 uiDefBut(block, BUT,B_PR_FULL, "FULL", 1146,30,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1280x1024, Aspect ratio - 1x1");
1333 uiDefButBitI(block, TOG, R_UNIFIED, B_REDR, "Unified Renderer", 1146,10,100,18, &G.scene->r.mode, 0, 0, 0, 0, "Use the unified renderer.");
1334 uiBlockEndAlign(block);
1338 /* yafray: global illumination options panel */
1339 static void render_panel_yafrayGI()
1343 block= uiNewBlock(&curarea->uiblocks, "render_panel_yafrayGI", UI_EMBOSS, UI_HELV, curarea->win);
1344 uiNewPanelTabbed("Render", "Render");
1345 if(uiNewPanel(curarea, block, "YafRay GI", "Render", 320, 0, 318, 204)==0) return;
1347 // label to force a boundbox for buttons not to be centered
1348 uiDefBut(block, LABEL, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, "");
1350 uiDefBut(block, LABEL, 0, "Method", 5,175,70,20, 0, 1.0, 0, 0, 0, "");
1351 uiDefButS(block, MENU, B_REDR, "GiMethod %t|None %x0|SkyDome %x1|Full %x2", 70,175,89,20, &G.scene->r.GImethod, 0, 0, 0, 0, "Global Illumination Method");
1353 uiDefBut(block, LABEL, 0, "Quality", 5,150,70,20, 0, 1.0, 0, 0, 0, "");
1354 uiDefButS(block, MENU, B_REDR, "GiQuality %t|None %x0|Low %x1|Medium %x2 |High %x3|Higher %x4|Best %x5|Use Blender AO settings %x6", 70,150,89,20, &G.scene->r.GIquality, 0, 0, 0, 0, "Global Illumination Quality");
1356 if (G.scene->r.GImethod>0) {
1357 uiDefButF(block, NUM, B_DIFF, "EmitPwr:", 5,35,154,20, &G.scene->r.GIpower, 0.01, 100.0, 10, 0, "arealight, material emit and background intensity scaling, 1 is normal");
1358 if (G.scene->r.GImethod==2) uiDefButF(block, NUM, B_DIFF, "GI Pwr:", 5,10,154,20, &G.scene->r.GIindirpower, 0.01, 100.0, 10, 0, "GI indirect lighting intensity scaling, 1 is normal");
1361 if (G.scene->r.GImethod>0)
1363 if (G.scene->r.GIdepth==0) G.scene->r.GIdepth=2;
1365 if (G.scene->r.GImethod==2) {
1366 uiDefButI(block, NUM, B_DIFF, "Depth:", 180,175,110,20, &G.scene->r.GIdepth, 1.0, 100.0, 10, 10, "Number of bounces of the indirect light");
1367 uiDefButI(block, NUM, B_DIFF, "CDepth:", 180,150,110,20, &G.scene->r.GIcausdepth, 1.0, 100.0, 10, 10, "Number of bounces inside objects (for caustics)");
1368 uiDefButBitS(block, TOG, 1, B_REDR, "Photons",210,125,100,20, &G.scene->r.GIphotons, 0, 0, 0, 0, "Use global photons to help in GI");
1371 uiDefButBitS(block, TOG, 1, B_REDR, "Cache",6,125,95,20, &G.scene->r.GIcache, 0, 0, 0, 0, "Cache occlusion/irradiance samples (faster)");
1372 if (G.scene->r.GIcache)
1374 uiDefButBitS(block,TOG, 1, B_REDR, "NoBump",108,125,95,20, &G.scene->r.YF_nobump, 0, 0, 0, 0, "Don't use bumpnormals for cache (faster, but no bumpmapping in total indirectly lit areas)");
1375 uiDefBut(block, LABEL, 0, "Cache parameters:", 5,105,130,20, 0, 1.0, 0, 0, 0, "");
1376 if (G.scene->r.GIshadowquality==0.0) G.scene->r.GIshadowquality=0.9;
1377 uiDefButF(block, NUM, B_DIFF,"ShadQu:", 5,85,154,20, &(G.scene->r.GIshadowquality), 0.01, 1.0 ,1,0, "Sets the shadow quality, keep it under 0.95 :-) ");
1378 if (G.scene->r.GIpixelspersample==0) G.scene->r.GIpixelspersample=10;
1379 uiDefButI(block, NUM, B_DIFF, "Prec:", 5,60,75,20, &G.scene->r.GIpixelspersample, 1, 50, 10, 10, "Maximum number of pixels without samples, the lower the better and slower");
1380 if (G.scene->r.GIrefinement==0) G.scene->r.GIrefinement=1.0;
1381 uiDefButF(block, NUM, B_DIFF, "Ref:", 84,60,75,20, &G.scene->r.GIrefinement, 0.001, 1.0, 1, 0, "Threshold to refine shadows EXPERIMENTAL. 1 = no refinement");
1384 if (G.scene->r.GImethod==2) {
1385 if (G.scene->r.GIphotons)
1387 uiDefBut(block, LABEL, 0, "Photon parameters:", 170,105,130,20, 0, 1.0, 0, 0, 0, "");
1388 if(G.scene->r.GIphotoncount==0) G.scene->r.GIphotoncount=100000;
1389 uiDefButI(block, NUM, B_DIFF, "Count:", 170,85,140,20, &G.scene->r.GIphotoncount,
1390 0, 10000000, 10, 10, "Number of photons to shoot");
1391 if(G.scene->r.GIphotonradius==0.0) G.scene->r.GIphotonradius=1.0;
1392 uiDefButF(block, NUMSLI, B_DIFF,"Radius:", 170,60,140,20, &(G.scene->r.GIphotonradius),
1393 0.00001, 100.0 ,0,0, "Radius to search for photons to mix (blur)");
1394 if(G.scene->r.GImixphotons==0) G.scene->r.GImixphotons=100;
1395 uiDefButI(block, NUM, B_DIFF, "MixCount:", 170,35,140,20, &G.scene->r.GImixphotons,
1396 0, 1000, 10, 10, "Number of photons to mix");
1397 uiDefButBitS(block, TOG, 1, B_REDR, "Tune Photons",170,10,140,20, &G.scene->r.GIdirect,
1398 0, 0, 0, 0, "Show the photonmap directly in the render for tuning");
1405 /* yafray: global options panel */
1406 static void render_panel_yafrayGlobal()
1410 block= uiNewBlock(&curarea->uiblocks, "render_panel_yafrayGlobal", UI_EMBOSS, UI_HELV, curarea->win);
1411 uiNewPanelTabbed("Render", "Render");
1412 if(uiNewPanel(curarea, block, "YafRay", "Render", 320, 0, 318, 204)==0) return;
1414 // label to force a boundbox for buttons not to be centered
1415 uiDefBut(block, LABEL, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, "");
1417 uiDefButBitS(block, TOGN, 1, B_REDR, "xml", 5,180,75,20, &G.scene->r.YFexportxml,
1418 0, 0, 0, 0, "Export to an xml file and call yafray instead of plugin");
1420 uiDefButF(block, NUMSLI, B_DIFF,"Bi ", 5,35,150,20, &(G.scene->r.YF_raybias),
1421 0.0, 10.0 ,0,0, "Shadow ray bias to avoid self shadowing");
1422 uiDefButI(block, NUM, B_DIFF, "Raydepth ", 5,60,150,20,
1423 &G.scene->r.YF_raydepth, 1.0, 80.0, 10, 10, "Maximum render ray depth from the camera");
1424 uiDefButF(block, NUMSLI, B_DIFF, "Gam ", 5,10,150,20, &G.scene->r.YF_gamma, 0.001, 5.0, 0, 0, "Gamma correction, 1 is off");
1425 uiDefButF(block, NUMSLI, B_DIFF, "Exp ", 160,10,150,20,&G.scene->r.YF_exposure, 0.0, 10.0, 0, 0, "Exposure adjustment, 0 is off");
1427 uiDefButI(block, NUM, B_DIFF, "Processors:", 160,60,150,20, &G.scene->r.YF_numprocs, 1.0, 8.0, 10, 10, "Number of processors to use");
1430 uiDefButBitS(block, TOGN, 1, B_REDR, "Auto AA", 5,140,150,20, &G.scene->r.YF_AA,
1431 0, 0, 0, 0, "Set AA using OSA and GI quality, disable for manual control");
1432 uiDefButBitS(block, TOGN, 1, B_DIFF, "Clamp RGB", 160,140,150,20, &G.scene->r.YF_clamprgb, 1.0, 8.0, 10, 10, "For AA on fast high contrast changes. Not advisable for Bokeh! Dulls lens shape detail.");
1433 if(G.scene->r.YF_AA){
1434 uiDefButI(block, NUM, B_DIFF, "AA Passes ", 5,115,150,20, &G.scene->r.YF_AApasses, 0, 64, 10, 10, "Number of AA passes (0 is no AA)");
1435 uiDefButI(block, NUM, B_DIFF, "AA Samples ", 160,115,150,20, &G.scene->r.YF_AAsamples, 0, 2048, 10, 10, "Number of samples per pass");
1436 uiDefButF(block, NUMSLI, B_DIFF, "Psz ", 5,90,150,20, &G.scene->r.YF_AApixelsize, 1.0, 2.0, 0, 0, "AA pixel filter size");
1437 uiDefButF(block, NUMSLI, B_DIFF, "Thr ", 160,90,150,20, &G.scene->r.YF_AAthreshold, 0.000001, 1.0, 0, 0, "AA threshold");
1442 static void render_panel_sfx(void)
1446 block= uiNewBlock(&curarea->uiblocks, "editing_panel_camera_dof", UI_EMBOSS, UI_HELV, curarea->win);
1447 uiNewPanelTabbed("Output", "Render");
1448 if(uiNewPanel(curarea, block, "Post Effects", "Render", 320, 0, 318, 204)==0) return;
1450 uiBlockBeginAlign(block);
1451 uiDefButBitI(block, TOG, R_ZBLUR,B_SET_ZBLUR,"Zblur", 10,180,140,20,&G.scene->r.mode,0,0, 0, 0, "Apply blur based on depth values in z-buffer");
1452 uiDefButF(block, NUM,B_DIFF, "ZMin:", 10,160,140,20, &G.scene->r.zmin, 0.0, 1.0, 0, 0, "Specify the start distance with maximum blur");
1453 uiDefButF(block, NUM,B_DIFF, "Focus:", 10,140,140,20, &G.scene->r.focus, 0.0, 1.0, 0, 0, "Specify the focus distance (not blurred)");
1454 uiDefButF(block, NUM,B_DIFF, "Blur:", 10,120,140,20, &G.scene->r.zblur, 1.0, 100.0, 0, 0, "Specify the maximum blur radius");
1455 uiDefButF(block, NUM,B_DIFF, "Gamma:", 10,100,140,20, &G.scene->r.zgamma, 0.05, 2.0, 0, 0, "Use Gamma corrected addition of colors");
1456 uiDefButF(block, NUM,B_DIFF, "Sigma:", 10,80,140,20, &G.scene->r.zsigma, 1.0, 20.0, 0, 0, "Filter type control, higher value is stronger gaussian");
1458 /* Toon shading buttons */
1459 uiBlockBeginAlign(block);
1460 uiDefButBitI(block, TOG, R_EDGE, B_SET_EDGE, "Edge", 160, 180, 150, 20, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon edge shading");
1461 uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings", 160, 160, 150, 20, "Display edge settings");
1463 /* postprocess render buttons */
1464 uiBlockBeginAlign(block);
1466 uiDefIconTextButI(block, TOG, R_FBUF, B_NOP, ICON_IMAGE_DEHLT," Fbuf", 160, 130, 150, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render; buffer available");
1468 uiDefButBitI(block, TOG, R_FBUF, 0,"Fbuf", 160, 130, 150, 20, &G.scene->r.mode, 0, 0, 0, 0, "Keep RGBA float buffer after render, no buffer available now");
1469 uiDefBlockBut(block, post_render_menu, NULL, "Post process", 160, 110, 150, 20, "Applies on RGBA floats while render or with Fbuf available");
1470 uiBlockEndAlign(block);
1472 /* Dither control */
1473 uiDefButF(block, NUM,B_DIFF, "Dither:", 160,80,150,20, &G.scene->r.dither_intensity, 0.0, 2.0, 0, 0, "The amount of dithering noise present in the output image (0.0 = no dithering)");
1479 void render_panels()
1482 render_panel_output();
1483 // render_panel_sfx();
1484 render_panel_render();
1485 render_panel_anim();
1486 render_panel_format();
1487 /* yafray: GI & Global panel, only available when yafray enabled for rendering */
1488 if (G.scene->r.renderer==R_YAFRAY) {
1489 if (G.scene->r.YF_gamma==0.0) G.scene->r.YF_gamma=1.0;
1490 if (G.scene->r.YF_raybias==0.0) G.scene->r.YF_raybias=0.001;
1491 if (G.scene->r.YF_raydepth==0) G.scene->r.YF_raydepth=5;
1492 if (G.scene->r.YF_AApixelsize==0.0) G.scene->r.YF_AApixelsize=1.5;
1493 if (G.scene->r.YF_AAthreshold==0.0) G.scene->r.YF_AAthreshold=0.05;
1494 if (G.scene->r.GIpower==0.0) G.scene->r.GIpower=1.0;
1495 if (G.scene->r.GIindirpower==0.0) G.scene->r.GIindirpower=1.0;
1496 render_panel_yafrayGlobal();
1497 render_panel_yafrayGI();
1502 /* --------------------------------------------- */
1508 block= uiNewBlock(&curarea->uiblocks, "anim_panel", UI_EMBOSS, UI_HELV, curarea->win);
1509 if(uiNewPanel(curarea, block, "Anim", "Anim", 0, 0, 318, 204)==0) return;
1511 uiBlockBeginAlign(block);
1512 uiDefButS(block, NUM,B_FRAMEMAP,"Map Old:", 10,160,150,20,&G.scene->r.framapto,1.0,900.0, 0, 0, "Specify old mapping value in frames");
1513 uiDefButS(block, NUM,B_FRAMEMAP,"Map New:", 160,160,150,20,&G.scene->r.images,1.0,900.0, 0, 0, "Specify how many frames the Map Old will last");
1515 uiBlockBeginAlign(block);
1516 uiDefButS(block, NUM,B_FRAMEMAP,"Frs/sec:", 10,130,150,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second");
1517 uiDefButBitS(block, TOG, AUDIO_SYNC, B_SOUND_CHANGED, "Sync",160,130,150,20, &G.scene->audio.flag, 0, 0, 0, 0, "Use sample clock for syncing animation to audio");
1519 uiBlockBeginAlign(block);
1520 uiDefButS(block, NUM,REDRAWSEQ,"Sta:", 10,100,150,20,&G.scene->r.sfra,1.0,MAXFRAMEF, 0, 0, "Specify the start frame of the animation");
1521 uiDefButS(block, NUM,REDRAWSEQ,"End:", 160,100,150,20,&G.scene->r.efra,1.0,MAXFRAMEF, 0, 0, "Specify the end frame of the animation");
1527 /* --------------------------------------------- */
1533 /* paranoia check */
1534 sound = G.buts->lockpoin;
1535 if(sound && GS(sound->id.name)!=ID_SO) {
1537 G.buts->lockpoin= NULL;
1540 sound_panel_sound(sound);
1541 sound_panel_listener();
1542 sound_panel_sequencer();