2 * $Id: buttons_scene.c 13010 2007-12-26 19:30:49Z schlaile $
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_node_types.h"
40 #include "DNA_screen_types.h"
41 #include "DNA_space_types.h"
42 #include "DNA_scene_types.h"
43 #include "DNA_sound_types.h"
44 #include "DNA_sequence_types.h"
45 #include "DNA_userdef_types.h"
46 #include "DNA_packedFile_types.h"
47 #include "DNA_world_types.h" /* need for AO toggle. */
49 #include "BKE_global.h"
52 #include "BKE_library.h"
53 #include "BKE_scene.h"
54 #include "BKE_sound.h"
55 #include "BKE_packedFile.h"
56 #include "BKE_utildefines.h"
58 #include "BLI_blenlib.h"
60 #include "BSE_filesel.h"
63 #include "BIF_graphics.h"
64 #include "BIF_glutil.h"
65 #include "BIF_interface.h"
66 #include "BIF_keyval.h"
67 #include "BIF_mainqueue.h"
68 #include "BIF_mywindow.h"
69 #include "BIF_meshtools.h"
70 #include "BIF_resources.h"
71 #include "BIF_renderwin.h"
72 #include "BIF_screen.h"
73 #include "BIF_space.h"
74 #include "BIF_toolbox.h"
75 #include "BIF_editseq.h"
77 #include "BIF_butspace.h"
82 /* -----includes for this file specific----- */
84 #include "DNA_image_types.h"
86 #include "BKE_writeavi.h"
87 #include "BKE_writeffmpeg.h"
88 #include "BKE_image.h"
89 #include "BKE_plugin_types.h"
91 #include "BLI_threads.h"
93 #include "BIF_editsound.h"
94 #include "BIF_writeimage.h"
95 #include "BIF_writeavicodec.h"
97 #include "BSE_headerbuttons.h"
98 #include "BSE_sequence.h"
99 #include "BSE_seqeffects.h"
100 #include "BSE_seqscopes.h"
101 #include "BSE_seqaudio.h"
103 #include "RE_pipeline.h"
105 #include "butspace.h" // own module
107 #ifdef WITH_QUICKTIME
108 #include "quicktime_export.h"
113 #include <ffmpeg/avcodec.h> /* for PIX_FMT_* and CODEC_ID_* */
114 #include <ffmpeg/avformat.h>
116 static int ffmpeg_preset_sel
= 0;
118 extern int is_container(int);
120 extern void makeffmpegstring(char* string
);
124 /* here the calls for scene buttons
127 - anim settings, audio
131 void playback_anim(void);
133 /* ************************ SOUND *************************** */
134 static void load_new_sample(char *str
) /* called from fileselect */
138 bSample
*sample
, *newsample
;
140 sound
= G
.buts
->lockpoin
;
144 sample
= sound
->sample
;
145 strcpy(name
, sound
->sample
->name
);
147 strcpy(sound
->name
, str
);
148 sound_set_sample(sound
, NULL
);
149 sound_initialize_sample(sound
);
151 if (sound
->sample
->type
== SAMPLE_INVALID
) {
152 error("Not a valid sample: %s", str
);
154 newsample
= sound
->sample
;
157 strcpy(sound
->name
, name
);
158 sound_set_sample(sound
, sample
);
160 // remove invalid sample
162 sound_free_sample(newsample
);
163 BLI_remlink(samples
, newsample
);
164 MEM_freeN(newsample
);
168 BIF_undo_push("Load new audio file");
169 allqueue(REDRAWBUTSSCENE
, 0);
174 void do_soundbuts(unsigned short event
)
182 sound
= G
.buts
->lockpoin
;
186 allqueue(REDRAWBUTSSCENE
, 0);
189 case B_SOUND_LOAD_SAMPLE
:
190 if (sound
) strcpy(name
, sound
->name
);
191 else strcpy(name
, U
.sounddir
);
193 activate_fileselect(FILE_SPECIAL
, "SELECT WAV FILE", name
, load_new_sample
);
196 case B_SOUND_PLAY_SAMPLE
:
198 if (sound
->sample
->type
!= SAMPLE_INVALID
) {
199 sound_play_sound(sound
);
200 allqueue(REDRAWBUTSSCENE
, 0);
205 case B_SOUND_MENU_SAMPLE
:
206 if (G
.buts
->menunr
> 0) {
207 sample
= BLI_findlink(samples
, G
.buts
->menunr
- 1);
208 if (sample
&& sound
) {
209 BLI_strncpy(sound
->name
, sample
->name
, sizeof(sound
->name
));
210 sound_set_sample(sound
, sample
);
211 do_soundbuts(B_SOUND_REDRAW
);
216 case B_SOUND_NAME_SAMPLE
:
217 load_new_sample(sound
->name
);
220 case B_SOUND_UNPACK_SAMPLE
:
221 if(sound
&& sound
->sample
) {
222 sample
= sound
->sample
;
224 if (sample
->packedfile
) {
225 if (G
.fileflags
& G_AUTOPACK
) {
226 if (okee("Disable AutoPack ?")) {
227 G
.fileflags
&= ~G_AUTOPACK
;
231 if ((G
.fileflags
& G_AUTOPACK
) == 0) {
232 unpackSample(sample
, PF_ASK
);
235 sound_set_packedfile(sample
, newPackedFile(sample
->name
));
237 allqueue(REDRAWHEADERS
, 0);
238 do_soundbuts(B_SOUND_REDRAW
);
242 case B_SOUND_COPY_SOUND
:
244 tempsound
= sound_make_copy(sound
);
247 G
.buts
->lockpoin
= (bSound
*)id
;
248 BIF_undo_push("Copy sound");
249 do_soundbuts(B_SOUND_REDRAW
);
255 sound
= G
.main
->sound
.first
;
259 audio_makestream(sound
);
260 sound
= (bSound
*) sound
->id
.next
;
263 allqueue(REDRAWSEQ
, 0);
266 case B_SOUND_RATECHANGED
:
268 allqueue(REDRAWBUTSSCENE
, 0);
269 allqueue(REDRAWSEQ
, 0);
272 case B_SOUND_MIXDOWN
:
278 printf("do_soundbuts: unhandled event %d\n", event
);
284 static void sound_panel_listener(void)
287 int xco
= 100, yco
=100, mixrate
;
288 char mixrateinfo
[256];
290 block
= uiNewBlock(&curarea
->uiblocks
, "sound_panel_listener", UI_EMBOSS
, UI_HELV
, curarea
->win
);
291 if(uiNewPanel(curarea
, block
, "Listener", "Sound", 320, 0, 318, 204)==0) return;
293 mixrate
= sound_get_mixrate();
294 sprintf(mixrateinfo
, "Game Mixrate: %d Hz", mixrate
);
295 uiDefBut(block
, LABEL
, 0, mixrateinfo
, xco
,yco
,295,20, 0, 0, 0, 0, 0, "");
298 uiDefBut(block
, LABEL
, 0, "Game listener settings:",xco
,yco
,195,20, 0, 0, 0, 0, 0, "");
301 uiDefButF(block
, NUMSLI
, B_SOUND_CHANGED
, "Volume: ",
302 xco
,yco
,195,24,&G
.listener
->gain
, 0.0, 1.0, 1.0, 0, "Sets the maximum volume for the overall sound");
305 uiDefBut(block
, LABEL
, 0, "Game Doppler effect settings:",xco
,yco
,195,20, 0, 0, 0, 0, 0, "");
308 uiDefButF(block
, NUMSLI
, B_SOUND_CHANGED
, "Doppler: ",
309 xco
,yco
,195,24,&G
.listener
->dopplerfactor
, 0.0, 10.0, 1.0, 0, "Use this for scaling the doppler effect");
312 uiDefButF(block
, NUMSLI
, B_SOUND_CHANGED
, "Velocity: ",
313 xco
,yco
,195,24,&G
.listener
->dopplervelocity
,0.0,10000.0, 1.0,0, "Sets the propagation speed of sound");
318 static void sound_panel_sequencer(void)
322 char mixrateinfo
[256];
324 block
= uiNewBlock(&curarea
->uiblocks
, "sound_panel_sequencer", UI_EMBOSS
, UI_HELV
, curarea
->win
);
325 if(uiNewPanel(curarea
, block
, "Sequencer", "Sound", 640, 0, 318, 204)==0) return;
327 /* audio sequence engine settings ------------------------------------------------------------------ */
332 uiDefBut(block
, LABEL
, 0, "Audio sequencer settings", xco
,yco
,295,20, 0, 0, 0, 0, 0, "");
335 sprintf(mixrateinfo
, "Mixing/Sync (latency: %d ms)", (int)( (((float)U
.mixbufsize
)/(float)G
.scene
->audio
.mixrate
)*1000.0 ) );
336 uiDefBut(block
, LABEL
, 0, mixrateinfo
, xco
,yco
,295,20, 0, 0, 0, 0, 0, "");
339 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");
340 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");
341 uiDefBut(block
, BUT
, B_SOUND_RECALC
, "Recalc", xco
+160,yco
,75,20, 0, 0, 0, 0, 0, "Recalculate samples");
344 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");
345 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");
348 uiDefBut(block
, LABEL
, 0, "Main mix", xco
,yco
,295,20, 0, 0, 0, 0, 0, "");
351 uiDefButF(block
, NUMSLI
, B_SOUND_CHANGED
, "Main (dB): ",
352 xco
,yco
,235,24,&G
.scene
->audio
.main
, -24.0, 6.0, 0, 0, "Set the audio master gain/attenuation in dB");
355 uiDefButBitS(block
, TOG
, AUDIO_MUTE
, 0, "Mute", xco
,yco
,235,24, &G
.scene
->audio
.flag
, 0, 0, 0, 0, "Mute audio from sequencer");
358 uiDefBut(block
, BUT
, B_SOUND_MIXDOWN
, "MIXDOWN", xco
,yco
,235,24, 0, 0, 0, 0, 0, "Create WAV file from sequenced audio (output goes to render output dir)");
362 static char *make_sample_menu(void)
364 int len
= BLI_countlist(samples
); /* BKE_sound.h */
371 str
= MEM_callocN(32*len
, "menu");
373 for(nr
=1, sample
= samples
->first
; sample
; sample
= sample
->id
.next
, nr
++) {
374 a
+= sprintf(str
+a
, "|%s %%x%d", sample
->id
.name
+2, nr
);
381 static void sound_panel_sound(bSound
*sound
)
383 static int packdummy
=0;
389 block
= uiNewBlock(&curarea
->uiblocks
, "sound_panel_sound", UI_EMBOSS
, UI_HELV
, curarea
->win
);
390 if(uiNewPanel(curarea
, block
, "Sound", "Sound", 0, 0, 318, 204)==0) return;
392 uiDefBut(block
, LABEL
, 0, "Blender Sound block",10,180,195,20, 0, 0, 0, 0, 0, "");
394 // warning: abuse of texnr here! (ton didnt code!)
395 buttons_active_id(&id
, &idfrom
);
396 std_libbuttons(block
, 10, 160, 0, NULL
, B_SOUNDBROWSE2
, ID_SO
, 0, id
, idfrom
, &(G
.buts
->texnr
), 1, 0, 0, 0, 0);
400 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");
402 uiSetButLock(sound
->id
.lib
!=0, ERROR_LIBDATA_MESSAGE
);
403 sound_initialize_sample(sound
);
404 sample
= sound
->sample
;
407 if (sound
->sample
&& sound
->sample
->len
) {
409 if (sound
->sample
->channels
== 1) tmp
= "Mono";
410 else if (sound
->sample
->channels
== 2) tmp
= "Stereo";
413 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
));
414 uiDefBut(block
, LABEL
, 0, ch
, 35,140,225,20, 0, 0, 0, 0, 0, "");
417 uiDefBut(block
, LABEL
, 0, "Sample: No sample info available.",35,140,225,20, 0, 0, 0, 0, 0, "");
420 /* sample browse buttons */
421 uiBlockBeginAlign(block
);
422 strp
= make_sample_menu();
424 uiDefButS(block
, MENU
, B_SOUND_MENU_SAMPLE
, strp
, 10,120,23,20, &(G
.buts
->menunr
), 0, 0, 0, 0, "Select another loaded sample");
427 uiDefBut(block
, TEX
, B_SOUND_NAME_SAMPLE
, "", 35,120,250,20, sound
->name
, 0.0, 79.0, 0, 0, "The sample file used by this Sound");
429 if (sound
->sample
->packedfile
) packdummy
= 1;
432 uiDefIconButBitI(block
, TOG
, 1, B_SOUND_UNPACK_SAMPLE
, ICON_PACKAGE
,
433 285, 120,25,20, &packdummy
, 0, 0, 0, 0,"Pack/Unpack this sample");
435 uiBlockBeginAlign(block
);
436 uiDefBut(block
, BUT
, B_SOUND_LOAD_SAMPLE
, "Load sample", 10, 95,150,24, 0, 0, 0, 0, 0, "Load a different sample file");
438 uiDefBut(block
, BUT
, B_SOUND_PLAY_SAMPLE
, "Play", 160, 95, 150, 24, 0, 0.0, 0, 0, 0, "Playback sample using settings below");
440 uiBlockBeginAlign(block
);
441 uiDefButF(block
, NUMSLI
, B_SOUND_CHANGED
, "Volume: ",
442 10,70,150,20, &sound
->volume
, 0.0, 1.0, 0, 0, "Game engine only: Set the volume of this sound");
444 uiDefButF(block
, NUMSLI
, B_SOUND_CHANGED
, "Pitch: ",
445 160,70,150,20, &sound
->pitch
, -12.0, 12.0, 0, 0, "Game engine only: Set the pitch of this sound");
448 uiBlockBeginAlign(block
);
449 uiDefButBitI(block
, TOG
, SOUND_FLAGS_LOOP
, B_SOUND_REDRAW
, "Loop",
450 10, 50, 95, 20, &sound
->flags
, 0.0, 0.0, 0, 0, "Game engine only: Toggle between looping on/off");
452 if (sound
->flags
& SOUND_FLAGS_LOOP
) {
453 uiDefButBitI(block
, TOG
, SOUND_FLAGS_BIDIRECTIONAL_LOOP
, B_SOUND_REDRAW
, "Ping Pong",
454 105, 50, 95, 20, &sound
->flags
, 0.0, 0.0, 0, 0, "Game engine only: Toggle between A->B and A->B->A looping");
459 /* 3D settings ------------------------------------------------------------------ */
460 uiBlockBeginAlign(block
);
462 if (sound
->sample
->channels
== 1) {
463 uiDefButBitI(block
, TOG
, SOUND_FLAGS_3D
, B_SOUND_REDRAW
, "3D Sound",
464 10, 10, 90, 20, &sound
->flags
, 0, 0, 0, 0, "Game engine only: Turns 3D sound on");
466 if (sound
->flags
& SOUND_FLAGS_3D
) {
467 uiDefButF(block
, NUMSLI
, B_SOUND_CHANGED
, "Scale: ",
468 100,10,210,20, &sound
->attenuation
, 0.0, 5.0, 1.0, 0, "Game engine only: Sets the surround scaling factor for this sound");
475 /* ************************* Sequencer *********************** */
477 #define SEQ_PANEL_EDITING 1
478 #define SEQ_PANEL_INPUT 2
479 #define SEQ_PANEL_FILTER 4
480 #define SEQ_PANEL_EFFECT 8
481 #define SEQ_PANEL_PROXY 16
483 static char* seq_panel_blend_modes()
485 static char string
[2048];
486 char formatstring
[2048];
488 strcpy(formatstring
, "Blend mode: %%t|%s %%x%d|%s %%x%d");
489 sprintf(string
, formatstring
,
490 "REPLACE", SEQ_BLEND_REPLACE
,
491 "TODO: ALPHA OVER", SEQ_BLEND_ALPHA_OVER
);
496 static void seq_panel_editing()
498 Sequence
*last_seq
= get_last_seq();
499 char * seq_names
[] = { "Image", "Meta", "Scene", "Movie",
503 static char strdata
[1024];
504 char * str
= strdata
;
508 block
= uiNewBlock(&curarea
->uiblocks
, "seq_panel_editing",
509 UI_EMBOSS
, UI_HELV
, curarea
->win
);
511 if(uiNewPanel(curarea
, block
, "Edit", "Sequencer",
512 10, 230, 318, 204) == 0) return;
514 uiDefBut(block
, LABEL
,
515 0, (last_seq
->type
>= SEQ_EFFECT
) ?
516 "Effect" : seq_names
[last_seq
->type
],
522 70,140,180,19, last_seq
->name
+2,
523 0.0, 21.0, 100, 0, "");
525 uiDefButI(block
, MENU
, B_SEQ_BUT_RELOAD
, seq_panel_blend_modes(),
526 10, 120, 120, 19, &last_seq
->blend_mode
,
527 0,0,0,0, "Strip Blend Mode");
529 if (last_seq
->blend_mode
> 0) {
530 uiDefButF(block
, NUM
, B_SEQ_BUT_RELOAD
, "Blend:",
531 130, 120, 120, 19, &last_seq
->blend_opacity
,
532 0.0, 100.0, 100.0, 0,
536 uiDefButBitI(block
, TOG
, SEQ_MUTE
,
537 B_SEQ_BUT_RELOAD_ALL
, "Mute",
538 10,100,60,19, &last_seq
->flag
,
540 "Mute the current strip.");
542 uiDefButBitI(block
, TOG
, SEQ_LOCK
,
544 70,100,60,19, &last_seq
->flag
,
546 "Lock strip, so that it can't be transformed.");
548 uiDefButBitI(block
, TOG
, SEQ_IPO_FRAME_LOCKED
,
549 B_SEQ_BUT_RELOAD_ALL
, "IPO Frame locked",
550 130,100,120,19, &last_seq
->flag
,
552 "Lock the IPO coordinates to the "
553 "global frame counter.");
555 if (!(last_seq
->flag
& SEQ_LOCK
)) {
556 uiDefButI(block
, NUM
,
557 B_SEQ_BUT_TRANSFORM
, "Start",
558 10, 80, 120, 20, &last_seq
->start
,
559 -MAXFRAMEF
, MAXFRAMEF
, 0.0, 0.0, "Start of strip");
560 uiDefButI(block
, NUM
,
561 B_SEQ_BUT_TRANSFORM
, "Chan",
562 130, 80, 120, 20, &last_seq
->machine
,
563 0.0, MAXSEQ
, 0.0, 0.0, "Channel used (Y position)");
565 if (last_seq
->type
== SEQ_IMAGE
) {
566 uiDefButI(block
, NUM
,
567 B_SEQ_BUT_TRANSFORM
, "Start-Still",
568 10, 60, 120, 20, &last_seq
->startstill
,
569 0.0, MAXFRAMEF
, 0.0, 0.0, "Start still");
570 uiDefButI(block
, NUM
,
571 B_SEQ_BUT_TRANSFORM
, "End-Still",
572 130, 60, 120, 19, &last_seq
->endstill
,
573 0.0, MAXFRAMEF
, 0.0, 0.0, "End still");
575 uiDefButI(block
, NUM
,
576 B_SEQ_BUT_TRANSFORM
, "Start-Ofs",
577 10, 60, 120, 20, &last_seq
->startofs
,
578 0.0, last_seq
->len
, 0.0, 0.0, "Start offset");
579 uiDefButI(block
, NUM
,
580 B_SEQ_BUT_TRANSFORM
, "End-Ofs",
581 130, 60, 120, 19, &last_seq
->endofs
,
582 0.0, last_seq
->len
, 0.0, 0.0, "End offset");
587 if(last_seq
->type
& SEQ_EFFECT
)
588 sprintf(str
, "Len: %d\nFrom %d - %d\n", last_seq
->len
, last_seq
->startdisp
, last_seq
->enddisp
-1);
590 sprintf(str
, "Len: %d(%d)\n", last_seq
->enddisp
-last_seq
->startdisp
, last_seq
->len
);
594 if(last_seq
->type
==SEQ_IMAGE
) {
595 if (last_seq
->len
> 1) {
597 StripElem
* se
= give_stripelem(last_seq
, CFRA
);
602 if(last_seq
->strip
) {
603 se
= last_seq
->strip
->stripdata
;
604 last
= se
+last_seq
->len
-1;
605 if(last_seq
->startofs
) se
+= last_seq
->startofs
;
606 if(last_seq
->endofs
) last
-= last_seq
->endofs
;
608 sprintf(str
, "First: %s at %d\nLast: %s at %d\n", se
->name
, last_seq
->startdisp
, last
->name
, last_seq
->enddisp
-1);
610 } else { /* single image */
611 if (last_seq
->strip
) {
612 sprintf(str
, "Len: %d\n", last_seq
->enddisp
-last_seq
->startdisp
);
619 if(last_seq
->strip
) {
620 sprintf(str
, "OrigSize: %d x %d\n", last_seq
->strip
->orx
, last_seq
->strip
->ory
);
623 else if(last_seq
->type
==SEQ_MOVIE
) {
624 int sta
= last_seq
->startofs
;
625 int end
= last_seq
->len
-1-last_seq
->endofs
;
627 sprintf(str
, "First: %d at %d\nLast: %d at %d\nCur: %d\n",
628 sta
, last_seq
->startdisp
, end
, last_seq
->enddisp
-1,
629 (G
.scene
->r
.cfra
)-last_seq
->startdisp
);
631 else if(last_seq
->type
==SEQ_SCENE
) {
632 TStripElem
* se
= give_tstripelem(last_seq
, (G
.scene
->r
.cfra
));
633 if(se
&& last_seq
->scene
) {
634 sprintf(str
, "First: %d\nLast: %d\nCur: %d\n", last_seq
->sfra
+se
->nr
, last_seq
->sfra
, last_seq
->sfra
+last_seq
->len
-1);
637 else if(last_seq
->type
==SEQ_RAM_SOUND
638 || last_seq
->type
== SEQ_HD_SOUND
) {
640 int sta
= last_seq
->startofs
;
641 int end
= last_seq
->len
-1-last_seq
->endofs
;
643 sprintf(str
, "First: %d at %d\nLast: %d at %d\nCur: %d\n",
644 sta
, last_seq
->startdisp
, end
, last_seq
->enddisp
-1,
645 (G
.scene
->r
.cfra
)-last_seq
->startdisp
);
647 else if(last_seq
->type
== SEQ_SPEED
) {
648 SpeedControlVars
* vars
=
649 (SpeedControlVars
*) last_seq
->effectdata
;
652 sprintf(str
, "Last mapped frame: %d at %d\n",
653 vars
->lastValidFrame
,
655 + last_seq
->startdisp
);
662 while ((p
= strchr(str
, '\n'))) {
664 uiDefBut(block
, LABEL
, 0, str
, 10,yco
,240,19, 0,
671 static void seq_panel_input()
673 Sequence
*last_seq
= get_last_seq();
675 block
= uiNewBlock(&curarea
->uiblocks
, "seq_panel_input",
676 UI_EMBOSS
, UI_HELV
, curarea
->win
);
678 if(uiNewPanel(curarea
, block
, "Input", "Sequencer",
679 10, 230, 318, 204) == 0) return;
682 B_SEQ_BUT_RELOAD_FILE
, "Dir: ",
683 10,140,240,19, last_seq
->strip
->dir
,
684 0.0, 160.0, 100, 0, "");
686 if (last_seq
->type
== SEQ_IMAGE
) {
687 StripElem
* se
= give_stripelem(last_seq
, CFRA
);
691 B_SEQ_BUT_RELOAD_FILE
, "File: ",
692 10, 120, 240,19, se
->name
,
693 0.0, 80.0, 100, 0, "");
696 } else if (last_seq
->type
== SEQ_MOVIE
||
697 last_seq
->type
== SEQ_HD_SOUND
||
698 last_seq
->type
== SEQ_RAM_SOUND
) {
700 B_SEQ_BUT_RELOAD_FILE
, "File: ",
701 10,120,240,19, last_seq
->strip
->stripdata
->name
,
702 0.0, 80.0, 100, 0, "");
705 uiDefButBitI(block
, TOG
, SEQ_USE_CROP
,
706 B_SEQ_BUT_RELOAD
, "Use Crop",
707 10,100,240,19, &last_seq
->flag
,
709 "Crop image before processing.");
711 if (last_seq
->flag
& SEQ_USE_CROP
) {
712 if (!last_seq
->strip
->crop
) {
713 last_seq
->strip
->crop
=
714 MEM_callocN(sizeof(struct StripCrop
),
717 uiDefButI(block
, NUM
,
718 B_SEQ_BUT_RELOAD
, "Top",
719 10, 80, 120, 20, &last_seq
->strip
->crop
->top
,
720 0.0, 4096, 0.0, 0.0, "Top of source image");
721 uiDefButI(block
, NUM
,
722 B_SEQ_BUT_RELOAD
, "Bottom",
723 130, 80, 120, 20, &last_seq
->strip
->crop
->bottom
,
724 0.0, 4096, 0.0, 0.0, "Bottom of source image");
726 uiDefButI(block
, NUM
,
727 B_SEQ_BUT_RELOAD
, "Left",
728 10, 60, 120, 20, &last_seq
->strip
->crop
->left
,
729 0.0, 4096, 0.0, 0.0, "Left");
730 uiDefButI(block
, NUM
,
731 B_SEQ_BUT_RELOAD
, "Right",
732 130, 60, 120, 19, &last_seq
->strip
->crop
->right
,
733 0.0, 4096, 0.0, 0.0, "Right");
736 uiDefButBitI(block
, TOG
, SEQ_USE_TRANSFORM
,
737 B_SEQ_BUT_RELOAD
, "Use Translate",
738 10,40,240,19, &last_seq
->flag
,
740 "Translate image before processing.");
742 if (last_seq
->flag
& SEQ_USE_TRANSFORM
) {
743 if (!last_seq
->strip
->transform
) {
744 last_seq
->strip
->transform
=
745 MEM_callocN(sizeof(struct StripTransform
),
748 uiDefButI(block
, NUM
,
749 B_SEQ_BUT_RELOAD
, "X-Ofs",
750 10, 20, 120, 20, &last_seq
->strip
->transform
->xofs
,
751 0.0, 4096, 0.0, 0.0, "X Offset");
752 uiDefButI(block
, NUM
,
753 B_SEQ_BUT_RELOAD
, "Y-Ofs",
754 130, 20, 120, 20, &last_seq
->strip
->transform
->yofs
,
755 0.0, 4096, 0.0, 0.0, "Y Offset");
759 uiDefButI(block
, NUM
,
760 B_SEQ_BUT_RELOAD_FILE
, "A-Start",
761 10, 0, 120, 20, &last_seq
->anim_startofs
,
762 0.0, MAXFRAMEF
, 0.0, 0.0, "Animation start offset in file");
763 uiDefButI(block
, NUM
,
764 B_SEQ_BUT_RELOAD_FILE
, "A-End",
765 130, 0, 120, 20, &last_seq
->anim_endofs
,
766 0.0, MAXFRAMEF
, 0.0, 0.0, "Animation end offset in file");
769 uiDefButI(block
, NUM
, B_SEQ_BUT_RELOAD
, "MPEG-Preseek:",
770 10, -20, 240,19, &last_seq
->anim_preseek
,
771 0.0, 50.0, 100,0,"On MPEG-seeking preseek this many frames");
775 static void seq_panel_filter_video()
777 Sequence
*last_seq
= get_last_seq();
779 block
= uiNewBlock(&curarea
->uiblocks
, "seq_panel_filter",
780 UI_EMBOSS
, UI_HELV
, curarea
->win
);
782 if(uiNewPanel(curarea
, block
, "Filter", "Sequencer",
783 10, 230, 318, 204) == 0) return;
786 uiBlockBeginAlign(block
);
789 uiDefButBitI(block
, TOG
, SEQ_MAKE_PREMUL
,
790 B_SEQ_BUT_RELOAD
, "Convert to Premul",
791 10,110,150,19, &last_seq
->flag
,
793 "Converts RGB values to become premultiplied with Alpha");
795 uiDefButBitI(block
, TOG
, SEQ_FILTERY
,
796 B_SEQ_BUT_RELOAD
, "FilterY",
797 10,90,75,19, &last_seq
->flag
,
799 "For video movies to remove fields");
801 uiDefButBitI(block
, TOG
, SEQ_MAKE_FLOAT
,
802 B_SEQ_BUT_RELOAD
, "Make Float",
803 85,90,75,19, &last_seq
->flag
,
805 "Convert input to float data");
807 uiDefButBitI(block
, TOG
, SEQ_FLIPX
,
808 B_SEQ_BUT_RELOAD
, "FlipX",
809 10,70,75,19, &last_seq
->flag
,
811 "Flip on the X axis");
812 uiDefButBitI(block
, TOG
, SEQ_FLIPY
,
813 B_SEQ_BUT_RELOAD
, "FlipY",
814 85,70,75,19, &last_seq
->flag
,
816 "Flip on the Y axis");
818 uiDefButF(block
, NUM
, B_SEQ_BUT_RELOAD
, "Mul:",
819 10,50,150,19, &last_seq
->mul
,
823 uiDefButBitI(block
, TOG
, SEQ_REVERSE_FRAMES
,
824 B_SEQ_BUT_RELOAD
, "Reverse Frames",
825 10,30,150,19, &last_seq
->flag
,
827 "Reverse frame order");
829 uiDefButF(block
, NUM
, B_SEQ_BUT_RELOAD
, "Strobe:",
830 10,10,150,19, &last_seq
->strobe
,
832 "Only display every nth frame");
834 uiBlockEndAlign(block
);
839 static void seq_panel_filter_audio()
841 Sequence
*last_seq
= get_last_seq();
843 block
= uiNewBlock(&curarea
->uiblocks
, "seq_panel_filter",
844 UI_EMBOSS
, UI_HELV
, curarea
->win
);
846 if(uiNewPanel(curarea
, block
, "Filter", "Sequencer",
847 10, 230, 318, 204) == 0) return;
849 uiBlockBeginAlign(block
);
850 uiDefButF(block
, NUM
, B_SEQ_BUT_RELOAD
, "Gain (dB):", 10,50,150,19, &last_seq
->level
, -96.0, 6.0, 100, 0, "");
851 uiDefButF(block
, NUM
, B_SEQ_BUT_RELOAD
, "Pan:", 10,30,150,19, &last_seq
->pan
, -1.0, 1.0, 100, 0, "");
852 uiBlockEndAlign(block
);
855 static void seq_panel_effect()
857 Sequence
*last_seq
= get_last_seq();
859 block
= uiNewBlock(&curarea
->uiblocks
, "seq_panel_effect",
860 UI_EMBOSS
, UI_HELV
, curarea
->win
);
862 if(uiNewPanel(curarea
, block
, "Effect", "Sequencer",
863 10, 230, 318, 204) == 0) return;
865 if(last_seq
->type
== SEQ_PLUGIN
) {
870 get_sequence_effect(last_seq
);/* make sure, plugin is loaded */
872 pis
= last_seq
->plugin
;
873 if(pis
->vars
==0) return;
877 for(a
=0; a
<pis
->vars
; a
++, varstr
++) {
879 yco
= 125 - 20*(a
% 6)+1;
880 uiDefBut(block
, varstr
->type
, B_SEQ_BUT_PLUGIN
, varstr
->name
, xco
,yco
,150,19, &(pis
->data
[a
]), varstr
->min
, varstr
->max
, 100, 0, varstr
->tip
);
887 uiBlockBeginAlign(block
);
889 if(last_seq
->type
==SEQ_WIPE
){
890 WipeVars
*wipe
= (WipeVars
*)last_seq
->effectdata
;
891 char formatstring
[256];
893 strncpy(formatstring
, "Transition Type %t|Single Wipe%x0|Double Wipe %x1|Iris Wipe %x4|Clock Wipe %x5", 255);
894 uiDefButS(block
, MENU
,B_SEQ_BUT_EFFECT
, formatstring
, 10,65,220,22, &wipe
->wipetype
, 0, 0, 0, 0, "What type of wipe should be performed");
895 uiDefButF(block
, NUM
,B_SEQ_BUT_EFFECT
,"Blur:", 10,40,220,22, &wipe
->edgeWidth
,0.0,1.0, 1, 2, "The percent width of the blur edge");
896 switch(wipe
->wipetype
){ /*Skip Types that do not require angle*/
902 uiDefButF(block
, NUM
,B_SEQ_BUT_EFFECT
,"Angle:", 10,15,220,22, &wipe
->angle
,-90.0,90.0, 1, 2, "The Angle of the Edge");
904 uiDefButS(block
, TOG
,B_SEQ_BUT_EFFECT
,"Wipe In", 10,-10,220,22, &wipe
->forward
,0,0, 0, 0, "Controls Primary Direction of Wipe");
905 } else if(last_seq
->type
==SEQ_GLOW
){
906 GlowVars
*glow
= (GlowVars
*)last_seq
->effectdata
;
908 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "Threshold:", 10,70,150,19, &glow
->fMini
, 0.0, 1.0, 0, 0, "Trigger Intensity");
909 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "Clamp:", 10,50,150,19, &glow
->fClamp
, 0.0, 1.0, 0, 0, "Brightness limit of intensity");
910 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "Boost factor:", 10,30,150,19, &glow
->fBoost
, 0.0, 10.0, 0, 0, "Brightness multiplier");
911 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "Blur distance:", 10,10,150,19, &glow
->dDist
, 0.5, 20.0, 0, 0, "Radius of glow effect");
912 uiDefButI(block
, NUM
, B_NOP
, "Quality:", 10,-5,150,19, &glow
->dQuality
, 1.0, 5.0, 0, 0, "Accuracy of the blur effect");
913 uiDefButI(block
, TOG
, B_NOP
, "Only boost", 10,-25,150,19, &glow
->bNoComp
, 0.0, 0.0, 0, 0, "Show the glow buffer only");
915 else if(last_seq
->type
==SEQ_TRANSFORM
){
916 TransformVars
*transform
= (TransformVars
*)last_seq
->effectdata
;
918 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "xScale Start:", 10,70,150,19, &transform
->ScalexIni
, 0.0, 10.0, 0, 0, "X Scale Start");
919 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "xScale End:", 160,70,150,19, &transform
->ScalexFin
, 0.0, 10.0, 0, 0, "X Scale End");
920 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "yScale Start:", 10,50,150,19, &transform
->ScaleyIni
, 0.0, 10.0, 0, 0, "Y Scale Start");
921 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "yScale End:", 160,50,150,19, &transform
->ScaleyFin
, 0.0, 10.0, 0, 0, "Y Scale End");
923 uiDefButI(block
, ROW
, B_SEQ_BUT_EFFECT
, "Percent", 10, 30, 150, 19, &transform
->percent
, 0.0, 1.0, 0.0, 0.0, "Percent Translate");
924 uiDefButI(block
, ROW
, B_SEQ_BUT_EFFECT
, "Pixels", 160, 30, 150, 19, &transform
->percent
, 0.0, 0.0, 0.0, 0.0, "Pixels Translate");
925 if(transform
->percent
==1){
926 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "x Start:", 10,10,150,19, &transform
->xIni
, -500.0, 500.0, 0, 0, "X Position Start");
927 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "x End:", 160,10,150,19, &transform
->xFin
, -500.0, 500.0, 0, 0, "X Position End");
928 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "y Start:", 10,-10,150,19, &transform
->yIni
, -500.0, 500.0, 0, 0, "Y Position Start");
929 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "y End:", 160,-10,150,19, &transform
->yFin
, -500.0, 500.0, 0, 0, "Y Position End");
931 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "x Start:", 10,10,150,19, &transform
->xIni
, -10000.0, 10000.0, 0, 0, "X Position Start");
932 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "x End:", 160,10,150,19, &transform
->xFin
, -10000.0, 10000.0, 0, 0, "X Position End");
933 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "y Start:", 10,-10,150,19, &transform
->yIni
, -10000.0, 10000.0, 0, 0, "Y Position Start");
934 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "y End:", 160,-10,150,19, &transform
->yFin
, -10000.0, 10000.0, 0, 0, "Y Position End");
940 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "rot Start:",10,-30,150,19, &transform
->rotIni
, 0.0, 360.0, 0, 0, "Rotation Start");
941 uiDefButF(block
, NUM
, B_SEQ_BUT_EFFECT
, "rot End:",160,-30,150,19, &transform
->rotFin
, 0.0, 360.0, 0, 0, "Rotation End");
943 uiDefButI(block
, ROW
, B_SEQ_BUT_EFFECT
, "No Interpolat", 10, -50, 100, 19, &transform
->interpolation
, 0.0, 0.0, 0.0, 0.0, "No interpolation");
944 uiDefButI(block
, ROW
, B_SEQ_BUT_EFFECT
, "Bilinear", 101, -50, 100, 19, &transform
->interpolation
, 0.0, 1.0, 0.0, 0.0, "Bilinear interpolation");
945 uiDefButI(block
, ROW
, B_SEQ_BUT_EFFECT
, "Bicubic", 202, -50, 100, 19, &transform
->interpolation
, 0.0, 2.0, 0.0, 0.0, "Bicubic interpolation");
946 } else if(last_seq
->type
==SEQ_COLOR
) {
947 SolidColorVars
*colvars
= (SolidColorVars
*)last_seq
->effectdata
;
948 uiDefButF(block
, COL
, B_SEQ_BUT_RELOAD
, "",10,90,150,19, colvars
->col
, 0, 0, 0, 0, "");
949 } else if(last_seq
->type
==SEQ_SPEED
){
950 SpeedControlVars
*sp
=
951 (SpeedControlVars
*)last_seq
->effectdata
;
953 uiDefButF(block
, NUM
, B_SEQ_BUT_RELOAD
, "Global Speed:", 10,70,150,19, &sp
->globalSpeed
, 0.0, 100.0, 0, 0, "Global Speed");
955 uiDefButBitI(block
, TOG
, SEQ_SPEED_INTEGRATE
,
958 10,50,150,19, &sp
->flags
,
960 "Interpret the IPO value as a "
961 "velocity instead of a frame number");
963 uiDefButBitI(block
, TOG
, SEQ_SPEED_BLEND
,
965 "Enable frame blending",
966 10,30,150,19, &sp
->flags
,
968 "Blend two frames into the "
969 "target for a smoother result");
971 uiDefButBitI(block
, TOG
, SEQ_SPEED_COMPRESS_IPO_Y
,
973 "IPO value runs from [0..1]",
974 10,10,150,19, &sp
->flags
,
976 "Scale IPO value to get the "
977 "target frame number.");
980 uiBlockEndAlign(block
);
983 static void seq_panel_proxy()
985 Sequence
*last_seq
= get_last_seq();
987 block
= uiNewBlock(&curarea
->uiblocks
, "seq_panel_proxy",
988 UI_EMBOSS
, UI_HELV
, curarea
->win
);
990 if(uiNewPanel(curarea
, block
, "Proxy", "Sequencer",
991 10, 230, 318, 204) == 0) return;
993 uiBlockBeginAlign(block
);
995 uiDefButBitI(block
, TOG
, SEQ_USE_PROXY
,
996 B_SEQ_BUT_RELOAD
, "Use Proxy",
997 10,140,150,19, &last_seq
->flag
,
999 "Use a preview proxy for this strip");
1001 if (last_seq
->flag
& SEQ_USE_PROXY
) {
1006 uiBlockEndAlign(block
);
1010 void sequencer_panels()
1012 Sequence
*last_seq
= get_last_seq();
1016 if(last_seq
== NULL
) {
1020 type
= last_seq
->type
;
1022 panels
= SEQ_PANEL_EDITING
;
1024 if (type
== SEQ_MOVIE
|| type
== SEQ_IMAGE
|| type
== SEQ_SCENE
1025 || type
== SEQ_HD_SOUND
) {
1026 panels
|= SEQ_PANEL_INPUT
| SEQ_PANEL_FILTER
| SEQ_PANEL_PROXY
;
1029 if (type
== SEQ_RAM_SOUND
) {
1030 panels
|= SEQ_PANEL_FILTER
;
1033 if (type
== SEQ_PLUGIN
|| type
>= SEQ_EFFECT
) {
1034 panels
|= SEQ_PANEL_EFFECT
| SEQ_PANEL_PROXY
;
1037 if (panels
& SEQ_PANEL_EDITING
) {
1038 seq_panel_editing();
1041 if (panels
& SEQ_PANEL_INPUT
) {
1045 if (panels
& SEQ_PANEL_FILTER
) {
1046 if (type
== SEQ_RAM_SOUND
|| type
== SEQ_HD_SOUND
) {
1047 seq_panel_filter_audio();
1049 seq_panel_filter_video();
1053 if (panels
& SEQ_PANEL_EFFECT
) {
1057 if (panels
& SEQ_PANEL_PROXY
) {
1063 void do_sequencer_panels(unsigned short event
)
1065 Sequence
*last_seq
= get_last_seq();
1068 case B_SEQ_BUT_PLUGIN
:
1069 case B_SEQ_BUT_EFFECT
:
1070 update_changed_seq_and_deps(last_seq
, 0, 1);
1072 case B_SEQ_BUT_RELOAD_FILE
:
1073 reload_sequence_new_file(last_seq
);
1075 case B_SEQ_BUT_RELOAD
:
1076 case B_SEQ_BUT_RELOAD_ALL
:
1077 update_seq_ipo_rect(last_seq
);
1078 update_seq_icu_rects(last_seq
);
1080 free_imbuf_seq(); // frees all
1083 case B_SEQ_BUT_TRANSFORM
:
1084 calc_sequence(last_seq
);
1088 if (event
== B_SEQ_BUT_RELOAD_ALL
) {
1089 allqueue(REDRAWALL
, 0);
1091 allqueue(REDRAWSEQ
, 0);
1096 /* ************************* SCENE *********************** */
1099 static void output_pic(char *name
)
1101 strcpy(G
.scene
->r
.pic
, name
);
1102 allqueue(REDRAWBUTSSCENE
, 0);
1103 BIF_undo_push("Change output picture directory");
1106 static void backbuf_pic(char *name
)
1110 strcpy(G
.scene
->r
.backbuf
, name
);
1111 allqueue(REDRAWBUTSSCENE
, 0);
1113 ima
= BKE_add_image_file(name
);
1115 BKE_image_signal(ima
, NULL
, IMA_SIGNAL_RELOAD
);
1117 BIF_undo_push("Change background picture");
1120 static void ftype_pic(char *name
)
1122 strcpy(G
.scene
->r
.ftype
, name
);
1123 allqueue(REDRAWBUTSSCENE
, 0);
1126 static void run_playanim(char *file
)
1128 extern char bprogname
[]; /* usiblender.c */
1129 char str
[FILE_MAX
*2]; /* FILE_MAX*2 is a bit arbitary, but this should roughly allow for the args + the max-file-length */
1130 int pos
[2], size
[2];
1132 /* use current settings for defining position of window. it actually should test image size */
1133 calc_renderwin_rectangle((G
.scene
->r
.xsch
*G
.scene
->r
.size
)/100,
1134 (G
.scene
->r
.ysch
*G
.scene
->r
.size
)/100, G
.winpos
, pos
, size
);
1136 sprintf(str
, "%s -a -p %d %d -f %d %g \"%s\"", bprogname
, pos
[0], pos
[1], G
.scene
->r
.frs_sec
, G
.scene
->r
.frs_sec_base
, file
);
1138 sprintf(str
, "\"%s\" -a -p %d %d -f %d %g \"%s\"", bprogname
, pos
[0], pos
[1], G
.scene
->r
.frs_sec
, G
.scene
->r
.frs_sec_base
, file
);
1143 void playback_anim(void)
1145 char file
[FILE_MAX
];
1147 if(BKE_imtype_is_movie(G
.scene
->r
.imtype
)) {
1148 switch (G
.scene
->r
.imtype
) {
1149 #ifdef WITH_QUICKTIME
1156 makeffmpegstring(file
);
1160 makeavistring(&G
.scene
->r
, file
);
1163 if(BLI_exist(file
)) {
1166 else error("Can't find movie: %s", file
);
1169 BKE_makepicstring(file
, G
.scene
->r
.pic
, G
.scene
->r
.sfra
, G
.scene
->r
.imtype
);
1170 if(BLI_exist(file
)) {
1173 else error("Can't find image: %s", file
);
1178 static void set_ffmpeg_preset(int preset
);
1181 void do_render_panels(unsigned short event
)
1192 allqueue(REDRAWALL
, 0);
1194 case B_SWITCHRENDER
:
1195 /* new panels added, so... */
1196 G
.buts
->re_align
= 1;
1197 allqueue(REDRAWBUTSSCENE
, 0);
1208 sa
= closest_bigger_area();
1209 areawinset(sa
->win
);
1210 if(G
.qual
== LR_CTRLKEY
)
1211 activate_imageselect(FILE_SPECIAL
, "SELECT OUTPUT PICTURES", G
.scene
->r
.pic
, output_pic
);
1213 activate_fileselect(FILE_SPECIAL
, "SELECT OUTPUT PICTURES", G
.scene
->r
.pic
, output_pic
);
1217 sa
= closest_bigger_area();
1218 areawinset(sa
->win
);
1219 if(G
.qual
== LR_CTRLKEY
)
1220 activate_imageselect(FILE_SPECIAL
, "SELECT BACKBUF PICTURE", G
.scene
->r
.backbuf
, backbuf_pic
);
1222 activate_fileselect(FILE_SPECIAL
, "SELECT BACKBUF PICTURE", G
.scene
->r
.backbuf
, backbuf_pic
);
1226 sa
= closest_bigger_area();
1227 areawinset(sa
->win
);
1228 if(G
.qual
== LR_CTRLKEY
)
1229 activate_imageselect(FILE_SPECIAL
, "SELECT FTYPE", G
.scene
->r
.ftype
, ftype_pic
);
1231 activate_fileselect(FILE_SPECIAL
, "SELECT FTYPE", G
.scene
->r
.ftype
, ftype_pic
);
1235 G
.scene
->r
.xsch
= 720;
1236 G
.scene
->r
.ysch
= 576;
1237 G
.scene
->r
.xasp
= 54;
1238 G
.scene
->r
.yasp
= 51;
1239 G
.scene
->r
.size
= 100;
1240 G
.scene
->r
.frs_sec
= 25;
1241 G
.scene
->r
.frs_sec_base
= 1;
1242 G
.scene
->r
.mode
&= ~R_PANORAMA
;
1243 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 4;
1245 G
.scene
->r
.ffcodecdata
.gop_size
= 15;
1247 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1248 BIF_undo_push("Set PAL");
1249 allqueue(REDRAWBUTSSCENE
, 0);
1250 allqueue(REDRAWVIEWCAM
, 0);
1253 case B_FILETYPEMENU
:
1254 allqueue(REDRAWBUTSSCENE
, 0);
1256 if (G
.scene
->r
.imtype
== R_FFMPEG
) {
1257 if (G
.scene
->r
.ffcodecdata
.type
<= 0 ||
1258 G
.scene
->r
.ffcodecdata
.codec
<= 0 ||
1259 G
.scene
->r
.ffcodecdata
.audio_codec
<= 0 ||
1260 G
.scene
->r
.ffcodecdata
.video_bitrate
<= 1) {
1261 G
.scene
->r
.ffcodecdata
.codec
1262 = CODEC_ID_MPEG2VIDEO
;
1263 set_ffmpeg_preset(FFMPEG_PRESET_DVD
);
1266 if (G
.scene
->r
.ffcodecdata
.audio_codec
<= 0) {
1267 G
.scene
->r
.ffcodecdata
.audio_codec
1269 G
.scene
->r
.ffcodecdata
.audio_bitrate
= 128;
1274 #if defined (_WIN32) || defined (__APPLE__)
1275 // fall through to codec settings if this is the first
1276 // time R_AVICODEC is selected for this scene.
1277 if (((G
.scene
->r
.imtype
== R_AVICODEC
)
1278 && (G
.scene
->r
.avicodecdata
== NULL
)) ||
1279 ((G
.scene
->r
.imtype
== R_QUICKTIME
)
1280 && (G
.scene
->r
.qtcodecdata
== NULL
))) {
1284 #endif /*_WIN32 || __APPLE__ */
1287 #if defined (_WIN32) || defined (__APPLE__)
1288 if ((G
.scene
->r
.imtype
== R_QUICKTIME
)) { /* || (G.scene->r.qtcodecdata)) */
1289 #ifdef WITH_QUICKTIME
1290 get_qtcodec_settings();
1291 #endif /* WITH_QUICKTIME */
1293 #if defined (_WIN32) && !defined(FREE_WINDOWS)
1295 get_avicodec_settings();
1296 #endif /* _WIN32 && !FREE_WINDOWS */
1297 #endif /* _WIN32 || __APPLE__ */
1301 G
.scene
->r
.xsch
= 1920;
1302 G
.scene
->r
.ysch
= 1080;
1305 G
.scene
->r
.size
= 100;
1306 G
.scene
->r
.mode
&= ~R_PANORAMA
;
1307 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 4;
1309 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1310 BIF_undo_push("Set FULL");
1311 allqueue(REDRAWBUTSSCENE
, 0);
1312 allqueue(REDRAWVIEWCAM
, 0);
1315 G
.scene
->r
.xsch
= 1920;
1316 G
.scene
->r
.ysch
= 816;
1319 G
.scene
->r
.size
= 100;
1320 G
.scene
->r
.mode
&= ~R_PANORAMA
;
1321 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 4;
1323 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1324 BIF_undo_push("Set FULL");
1325 allqueue(REDRAWBUTSSCENE
, 0);
1326 allqueue(REDRAWVIEWCAM
, 0);
1329 G
.scene
->r
.xsch
= 960;
1330 G
.scene
->r
.ysch
= 408;
1333 G
.scene
->r
.size
= 100;
1334 G
.scene
->r
.mode
&= ~R_PANORAMA
;
1335 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 4;
1337 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1338 allqueue(REDRAWVIEWCAM
, 0);
1339 allqueue(REDRAWBUTSSCENE
, 0);
1342 G
.scene
->r
.xsch
= 720;
1343 G
.scene
->r
.ysch
= 576;
1344 G
.scene
->r
.xasp
= 64;
1345 G
.scene
->r
.yasp
= 45;
1346 G
.scene
->r
.size
= 100;
1347 G
.scene
->r
.frs_sec
= 25;
1348 G
.scene
->r
.frs_sec_base
= 1;
1349 G
.scene
->r
.mode
&= ~R_PANORAMA
;
1350 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 4;
1352 G
.scene
->r
.ffcodecdata
.gop_size
= 15;
1355 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1356 BIF_undo_push("Set PAL 16/9");
1357 allqueue(REDRAWVIEWCAM
, 0);
1358 allqueue(REDRAWBUTSSCENE
, 0);
1361 G
.scene
->r
.xsch
= 640;
1362 G
.scene
->r
.ysch
= 480;
1363 G
.scene
->r
.xasp
= 100;
1364 G
.scene
->r
.yasp
= 100;
1365 G
.scene
->r
.size
= 100;
1366 G
.scene
->r
.mode
&= ~R_PANORAMA
;
1367 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 4;
1369 BLI_init_rctf(&G
.scene
->r
.safety
, 0.0, 1.0, 0.0, 1.0);
1370 BIF_undo_push("Set PC");
1371 allqueue(REDRAWVIEWCAM
, 0);
1372 allqueue(REDRAWBUTSSCENE
, 0);
1375 G
.scene
->r
.xsch
= 720;
1376 G
.scene
->r
.ysch
= 576;
1377 G
.scene
->r
.xasp
= 54;
1378 G
.scene
->r
.yasp
= 51;
1379 G
.scene
->r
.size
= 100;
1380 G
.scene
->r
.mode
= R_OSA
+R_SHADOW
+R_FIELDS
+R_SSS
;
1381 G
.scene
->r
.imtype
= R_TARGA
;
1382 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 4;
1384 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1385 BIF_undo_push("Set Default");
1386 allqueue(REDRAWVIEWCAM
, 0);
1387 allqueue(REDRAWBUTSSCENE
, 0);
1390 G
.scene
->r
.xsch
= 576;
1391 G
.scene
->r
.ysch
= 176;
1392 G
.scene
->r
.xasp
= 115;
1393 G
.scene
->r
.yasp
= 100;
1394 G
.scene
->r
.size
= 100;
1395 G
.scene
->r
.mode
|= R_PANORAMA
;
1396 G
.scene
->r
.xparts
= 16;
1397 G
.scene
->r
.yparts
= 1;
1399 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1400 BIF_undo_push("Set Panorama");
1401 allqueue(REDRAWVIEWCAM
, 0);
1402 allqueue(REDRAWBUTSSCENE
, 0);
1405 G
.scene
->r
.xsch
= 720;
1406 G
.scene
->r
.ysch
= 480;
1407 G
.scene
->r
.xasp
= 10;
1408 G
.scene
->r
.yasp
= 11;
1409 G
.scene
->r
.size
= 100;
1410 G
.scene
->r
.frs_sec
= 30;
1411 G
.scene
->r
.frs_sec_base
= 1.001;
1412 G
.scene
->r
.mode
&= ~R_PANORAMA
;
1413 G
.scene
->r
.xparts
= G
.scene
->r
.yparts
= 2;
1415 G
.scene
->r
.ffcodecdata
.gop_size
= 18;
1418 BLI_init_rctf(&G
.scene
->r
.safety
, 0.1, 0.9, 0.1, 0.9);
1419 BIF_undo_push("Set NTSC");
1420 allqueue(REDRAWBUTSSCENE
, 0);
1421 allqueue(REDRAWVIEWCAM
, 0);
1425 id
= (ID
*) G
.scene
->set
;
1427 if (G
.buts
->menunr
==-2) {
1428 activate_databrowse(id
, ID_SCE
, 0, B_SETBROWSE
, &G
.buts
->menunr
, do_render_panels
);
1430 else if (G
.buts
->menunr
>0) {
1431 Scene
*newset
= (Scene
*) BLI_findlink(&G
.main
->scene
, G
.buts
->menunr
-1);
1433 if (newset
==G
.scene
)
1434 error("Can't use the same scene as its own set");
1436 G
.scene
->set
= newset
;
1437 if (scene_check_setscene(G
.scene
)==0)
1438 error("This would create a cycle");
1440 allqueue(REDRAWBUTSSCENE
, 0);
1441 allqueue(REDRAWVIEW3D
, 0);
1442 BIF_undo_push("Change Set Scene");
1448 allqueue(REDRAWBUTSSCENE
, 0);
1449 allqueue(REDRAWVIEW3D
, 0);
1450 BIF_undo_push("Clear Set Scene");
1454 allqueue(REDRAWBUTSSCENE
, 0);
1457 G
.scene
->r
.mode
&= ~R_EDGE
;
1458 allqueue(REDRAWBUTSSCENE
, 0);
1460 case B_ADD_RENDERLAYER
:
1461 if(G
.scene
->r
.actlay
==32767) {
1462 scene_add_render_layer(G
.scene
);
1463 G
.scene
->r
.actlay
= BLI_countlist(&G
.scene
->r
.layers
) - 1;
1465 allqueue(REDRAWBUTSSCENE
, 0);
1466 allqueue(REDRAWNODE
, 0);
1469 if(G
.scene
->nodetree
) {
1470 ntreeCompositForceHidden(G
.scene
->nodetree
);
1471 allqueue(REDRAWNODE
, 0);
1473 allqueue(REDRAWBUTSSCENE
, 0);
1474 allqueue(REDRAWOOPS
, 0);
1478 /* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
1479 static uiBlock
*edge_render_menu(void *arg_unused
)
1483 block
= uiNewBlock(&curarea
->uiblocks
, "edge render", UI_EMBOSS
, UI_HELV
, curarea
->win
);
1485 /* use this for a fake extra empy space around the buttons */
1486 uiDefBut(block
, LABEL
, 0, "", 0, 0, 220, 115, NULL
, 0, 0, 0, 0, "");
1488 uiDefButS(block
, NUM
, 0,"Eint:", 45,75,175,19, &G
.scene
->r
.edgeint
, 0.0, 255.0, 0, 0,
1489 "Sets edge intensity for Toon shading");
1491 /* color settings for the toon shading */
1492 uiDefButF(block
, COL
, 0, "", 10, 10,30,60, &(G
.scene
->r
.edgeR
), 0, 0, 0, B_EDGECOLSLI
, "");
1494 uiBlockBeginAlign(block
);
1495 uiDefButF(block
, NUMSLI
, 0, "R ", 45, 50, 175,19, &G
.scene
->r
.edgeR
, 0.0, 1.0, B_EDGECOLSLI
, 0,
1496 "Color for edges in toon shading mode.");
1497 uiDefButF(block
, NUMSLI
, 0, "G ", 45, 30, 175,19, &G
.scene
->r
.edgeG
, 0.0, 1.0, B_EDGECOLSLI
, 0,
1498 "Color for edges in toon shading mode.");
1499 uiDefButF(block
, NUMSLI
, 0, "B ", 45, 10, 175,19, &G
.scene
->r
.edgeB
, 0.0, 1.0, B_EDGECOLSLI
, 0,
1500 "Color for edges in toon shading mode.");
1503 uiBlockSetDirection(block
, UI_TOP
);
1509 /* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */
1510 static uiBlock
*framing_render_menu(void *arg_unused
)
1513 short yco
= 190, xco
= 0;
1514 int randomcolorindex
= 1234;
1516 block
= uiNewBlock(&curarea
->uiblocks
, "framing_options", UI_EMBOSS
, UI_HELV
, curarea
->win
);
1518 /* use this for a fake extra empy space around the buttons */
1519 uiDefBut(block
, LABEL
, 0, "", -5, -10, 295, 224, NULL
, 0, 0, 0, 0, "");
1521 uiDefBut(block
, LABEL
, 0, "Framing:", xco
, yco
, 68,19, 0, 0, 0, 0, 0, "");
1522 uiBlockBeginAlign(block
);
1523 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");
1524 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");
1525 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");
1526 uiBlockEndAlign(block
);
1531 uiDefButF(block
, COL
, 0, "", 0, yco
- 58 + 18, 33, 58, &G
.scene
->framing
.col
[0], 0, 0, 0, randomcolorindex
, "");
1533 uiBlockBeginAlign(block
);
1534 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");
1536 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");
1538 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");
1539 uiBlockEndAlign(block
);
1542 uiDefBut(block
, LABEL
, 0, "Fullscreen:", xco
, yco
-=30, 100, 19, 0, 0.0, 0.0, 0, 0, "");
1543 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");
1544 uiBlockBeginAlign(block
);
1545 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.");
1546 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.");
1547 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.");
1548 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.");
1549 uiBlockEndAlign(block
);
1551 /* stereo settings */
1552 /* can't use any definition from the game engine here so hardcode it. Change it here when it changes there!
1553 * RAS_IRasterizer has definitions:
1554 * RAS_STEREO_NOSTEREO 1
1555 * RAS_STEREO_QUADBUFFERED 2
1556 * RAS_STEREO_ABOVEBELOW 3
1557 * RAS_STEREO_INTERLACED 4 future
1558 * RAS_STEREO_ANAGLYPH 5
1559 * RAS_STEREO_SIDEBYSIDE 6
1560 * RAS_STEREO_VINTERLACE 7
1562 uiBlockBeginAlign(block
);
1563 uiDefButS(block
, ROW
, 0, "No Stereo", xco
, yco
-=30, 88, 19, &(G
.scene
->r
.stereomode
), 7.0, 1.0, 0, 0, "Disables stereo");
1564 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");
1565 uiDefButS(block
, ROW
, 0, "Syncdouble", xco
+=90, yco
, 88, 19, &(G
.scene
->r
.stereomode
), 7.0, 3.0, 0, 0, "Enables syncdoubling stereo method");
1566 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");
1567 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");
1568 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");
1570 uiBlockEndAlign(block
);
1572 uiBlockSetDirection(block
, UI_TOP
);
1579 static char* ffmpeg_format_pup(void)
1581 static char string
[2048];
1582 char formatstring
[2048];
1586 AVOutputFormat
* next
= first_oformat
;
1587 formatstring
= "FFMpeg format: %%t";
1588 sprintf(string
, formatstring
);
1589 formatstring
= "|%s %%x%d";
1590 /* FIXME: This should only be generated once */
1591 while (next
!= NULL
) {
1592 if (next
->video_codec
!= CODEC_ID_NONE
&& !(next
->flags
& AVFMT_NOFILE
)) {
1593 sprintf(string
+stroffs
, formatstring
, next
->name
, i
++);
1594 stroffs
+= strlen(string
+stroffs
);
1600 strcpy(formatstring
, "FFMpeg format: %%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");
1601 sprintf(string
, formatstring
,
1602 "MPEG-1", FFMPEG_MPEG1
,
1603 "MPEG-2", FFMPEG_MPEG2
,
1604 "MPEG-4", FFMPEG_MPEG4
,
1606 "Quicktime", FFMPEG_MOV
,
1608 "H264", FFMPEG_H264
,
1609 "XVid", FFMPEG_XVID
);
1613 static char* ffmpeg_preset_pup(void)
1615 static char string
[2048];
1616 char formatstring
[2048];
1618 strcpy(formatstring
, "FFMpeg preset: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
1619 sprintf(string
, formatstring
,
1620 "", FFMPEG_PRESET_NONE
,
1621 "DVD", FFMPEG_PRESET_DVD
,
1622 "SVCD", FFMPEG_PRESET_SVCD
,
1623 "VCD", FFMPEG_PRESET_VCD
,
1624 "DV", FFMPEG_PRESET_DV
);
1629 static char* ffmpeg_codec_pup(void) {
1630 static char string
[2048];
1631 char formatstring
[2048];
1632 strcpy(formatstring
, "FFMpeg format: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
1633 sprintf(string
, formatstring
,
1634 "MPEG1", CODEC_ID_MPEG1VIDEO
,
1635 "MPEG2", CODEC_ID_MPEG2VIDEO
,
1636 "MPEG4(divx)", CODEC_ID_MPEG4
,
1637 "HuffYUV", CODEC_ID_HUFFYUV
,
1638 "DV", CODEC_ID_DVVIDEO
,
1639 "H264", CODEC_ID_H264
,
1640 "XVid", CODEC_ID_XVID
);
1645 static char* ffmpeg_audio_codec_pup(void) {
1646 static char string
[2048];
1647 char formatstring
[2048];
1648 strcpy(formatstring
, "FFMpeg format: %%t|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d|%s %%x%d");
1649 sprintf(string
, formatstring
,
1650 "MP2", CODEC_ID_MP2
,
1651 "MP3", CODEC_ID_MP3
,
1652 "AC3", CODEC_ID_AC3
,
1653 "AAC", CODEC_ID_AAC
,
1654 "PCM", CODEC_ID_PCM_S16LE
);
1661 static char *imagetype_pup(void)
1663 static char string
[1024];
1664 char formatstring
[1024];
1665 char appendstring
[1024];
1667 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");
1670 strcat(formatstring
, "|%s %%x%d"); // add space for Movie
1673 strcat(formatstring
, "|%s %%x%d"); // add space for PNG
1674 strcat(formatstring
, "|%s %%x%d"); // add space for BMP
1675 strcat(formatstring
, "|%s %%x%d"); // add space for Radiance HDR
1676 strcat(formatstring
, "|%s %%x%d"); // add space for Cineon
1677 strcat(formatstring
, "|%s %%x%d"); // add space for DPX
1680 strcat(formatstring
, "|%s %%x%d"); // add space for AVI Codec
1684 strcat(formatstring
, "|%s %%x%d"); // Add space for ffmpeg
1686 strcat(formatstring
, "|%s %%x%d"); // Add space for frameserver
1688 #ifdef WITH_QUICKTIME
1689 if(G
.have_quicktime
)
1690 strcat(formatstring
, "|%s %%x%d"); // add space for Quicktime
1693 if(G
.have_quicktime
) {
1694 sprintf(string
, formatstring
,
1695 "Frameserver", R_FRAMESERVER
,
1699 "AVI Raw", R_AVIRAW
,
1700 "AVI Jpeg", R_AVIJPEG
,
1702 "AVI Codec", R_AVICODEC
,
1704 #ifdef WITH_QUICKTIME
1705 "QuickTime", R_QUICKTIME
,
1708 "Targa Raw", R_RAWTGA
,
1714 "Radiance HDR", R_RADHDR
,
1722 sprintf(string
, formatstring
,
1723 "Frameserver", R_FRAMESERVER
,
1727 "AVI Raw", R_AVIRAW
,
1728 "AVI Jpeg", R_AVIJPEG
,
1730 "AVI Codec", R_AVICODEC
,
1733 "Targa Raw", R_RAWTGA
,
1739 "Radiance HDR", R_RADHDR
,
1749 strcpy(formatstring
, "|%s %%x%d");
1750 sprintf(appendstring
, formatstring
, "OpenEXR", R_OPENEXR
);
1751 strcat(string
, appendstring
);
1752 sprintf(appendstring
, formatstring
, "MultiLayer", R_MULTILAYER
);
1753 strcat(string
, appendstring
);
1756 if (G
.have_libtiff
) {
1757 strcpy(formatstring
, "|%s %%x%d");
1758 sprintf(appendstring
, formatstring
, "TIFF", R_TIFF
);
1759 strcat(string
, appendstring
);
1766 static char *avicodec_str(void)
1768 static char string
[1024];
1770 sprintf(string
, "Codec: %s", G
.scene
->r
.avicodecdata
->avicodecname
);
1776 static void render_panel_output(void)
1784 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_output", UI_EMBOSS
, UI_HELV
, curarea
->win
);
1785 if(uiNewPanel(curarea
, block
, "Output", "Render", 0, 0, 318, 204)==0) return;
1787 uiBlockBeginAlign(block
);
1788 uiDefIconBut(block
, BUT
, B_FS_PIC
, ICON_FILESEL
, 10, 190, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name");
1789 uiDefBut(block
, TEX
,0,"", 31, 190, 279, 20,G
.scene
->r
.pic
, 0.0,150.0, 0, 0, "Directory/name to save rendered Pics to");
1790 uiDefIconBut(block
, BUT
,B_FS_BACKBUF
, ICON_FILESEL
, 10, 168, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
1791 uiDefBut(block
, TEX
,0,"", 31, 168, 279, 20,G
.scene
->r
.backbuf
, 0.0,150.0, 0, 0, "Image to use as background for rendering");
1792 uiDefIconBut(block
, BUT
,B_FS_FTYPE
, ICON_FILESEL
, 10, 146, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image");
1793 uiDefBut(block
, TEX
,0,"", 31, 146, 279, 20,G
.scene
->r
.ftype
,0.0,150.0, 0, 0, "Image to use with FTYPE Image type");
1794 uiBlockEndAlign(block
);
1798 uiBlockBeginAlign(block
);
1799 id
= (ID
*)G
.scene
->set
;
1800 IDnames_to_pupstring(&strp
, NULL
, NULL
, &(G
.main
->scene
), id
, &(G
.buts
->menunr
));
1802 uiDefButS(block
, MENU
, B_SETBROWSE
, strp
, 10, 120, 20, 20, &(G
.buts
->menunr
), 0, 0, 0, 0, "Scene to link as a Set");
1806 uiSetButLock(1, NULL
);
1807 uiDefIDPoinBut(block
, test_scenepoin_but
, ID_SCE
, B_NOP
, "", 31, 120, 100, 20, &(G
.scene
->set
), "Name of the Set");
1809 uiDefIconBut(block
, BUT
, B_CLEARSET
, ICON_X
, 132, 120, 20, 20, 0, 0, 0, 0, 0, "Remove Set link");
1811 uiBlockEndAlign(block
);
1813 uiBlockSetCol(block
, TH_BUT_SETTING1
);
1814 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");
1815 uiDefButS(block
, NUM
, B_NOP
, "Threads:", 10, 68, 100, 20, &G
.scene
->r
.threads
, 1, BLENDER_MAX_THREADS
, 0, 0, "Amount of threads for render");
1816 uiBlockSetCol(block
, TH_AUTO
);
1818 uiBlockBeginAlign(block
);
1821 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");
1822 uiBlockEndAlign(block
);
1824 uiDefButBitS(block
, TOG
, R_EXR_TILE_FILE
, B_NOP
, "Save Buffers", 72, 31, 120, 19, &G
.scene
->r
.scemode
, 0.0, 0.0, 0, 0, "Save the tiles for all RenderLayers and used SceneNodes to files, to save memory");
1826 uiDefButS(block
, MENU
, B_REDR
, "Render Display %t|Render Window %x1|Image Editor %x0|Full Screen %x2",
1827 72, 10, 120, 19, &G
.displaymode
, 0.0, (float)R_DISPLAYWIN
, 0, 0, "Sets render output display");
1829 uiDefButBitS(block
, TOG
, R_EXTENSION
, B_NOP
, "Extensions", 205, 10, 105, 19, &G
.scene
->r
.scemode
, 0.0, 0.0, 0, 0, "Adds extensions to the output when rendering animations");
1831 /* Dither control */
1832 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)");
1834 /* Toon shading buttons */
1835 uiBlockBeginAlign(block
);
1836 uiDefButBitI(block
, TOG
, R_EDGE
, B_NOP
,"Edge", 100, 94, 70, 20, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Enable Toon Edge-enhance");
1837 uiDefBlockBut(block
, edge_render_menu
, NULL
, "Edge Settings", 170, 94, 140, 20, "Display Edge settings");
1838 uiBlockEndAlign(block
);
1840 uiBlockBeginAlign(block
);
1841 uiDefButBitS(block
, TOG
, R_NO_TEX
, B_NOP
, "Disable Tex", 115, 68, 70, 20, &G
.scene
->r
.scemode
, 0.0, 0.0, 0, 0, "Disables Textures for render");
1842 uiDefButBitS(block
, TOG
, R_FREE_IMAGE
, B_NOP
, "Free Tex Images", 205, 68, 100, 20, &G
.scene
->r
.scemode
, 0.0, 0.0, 0, 0, "Frees all Images used by Textures after each render");
1843 uiBlockEndAlign(block
);
1846 static void do_bake_func(void *unused_v
, void *unused_p
)
1848 objects_bake_render(0);
1851 static void render_panel_bake(void)
1856 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_bake", UI_EMBOSS
, UI_HELV
, curarea
->win
);
1857 uiNewPanelTabbed("Anim", "Render");
1858 if(uiNewPanel(curarea
, block
, "Bake", "Render", 320, 0, 318, 204)==0) return;
1860 but
= uiDefBut(block
, BUT
, B_NOP
, "BAKE", 10, 150, 190,40, 0, 0, 0, 0, 0, "Start the bake render for selected Objects");
1861 uiButSetFunc(but
, do_bake_func
, NULL
, NULL
);
1863 uiBlockBeginAlign(block
);
1864 uiDefButBitS(block
, TOG
, R_BAKE_OSA
, B_DIFF
, "OSA", 10,120,190,20, &G
.scene
->r
.bake_flag
, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
1865 uiDefButS(block
, ROW
,B_DIFF
,"5", 10,100,50,20,&G
.scene
->r
.bake_osa
,2.0,5.0, 0, 0, "Sets oversample level to 5");
1866 uiDefButS(block
, ROW
,B_DIFF
,"8", 60,100,45,20,&G
.scene
->r
.bake_osa
,2.0,8.0, 0, 0, "Sets oversample level to 8");
1867 uiDefButS(block
, ROW
,B_DIFF
,"11", 105,100,45,20,&G
.scene
->r
.bake_osa
,2.0,11.0, 0, 0, "Sets oversample level to 11");
1868 uiDefButS(block
, ROW
,B_DIFF
,"16", 150,100,50,20,&G
.scene
->r
.bake_osa
,2.0,16.0, 0, 0, "Sets oversample level to 16");
1870 uiBlockBeginAlign(block
);
1871 uiDefButS(block
, ROW
,B_DIFF
,"Full Render", 210,170,120,20,&G
.scene
->r
.bake_mode
, 1.0, RE_BAKE_ALL
, 0, 0, "");
1872 uiDefButS(block
, ROW
,B_DIFF
,"Ambient Occlusion",210,150,120,20,&G
.scene
->r
.bake_mode
, 1.0, RE_BAKE_AO
, 0, 0, "");
1873 uiDefButS(block
, ROW
,B_DIFF
,"Normals", 210,130,120,20,&G
.scene
->r
.bake_mode
, 1.0, RE_BAKE_NORMALS
, 0, 0, "");
1874 uiDefButS(block
, ROW
,B_DIFF
,"Textures", 210,110,120,20,&G
.scene
->r
.bake_mode
, 1.0, RE_BAKE_TEXTURE
, 0, 0, "");
1875 uiBlockEndAlign(block
);
1877 uiDefButBitS(block
, TOG
, R_BAKE_CLEAR
, B_DIFF
, "Clear", 210,80,120,20,&G
.scene
->r
.bake_flag
, 0.0, 0, 0, 0, "Clear Images before baking");
1879 uiDefButS(block
, NUM
, B_DIFF
,"Margin:", 210,50,120,20,&G
.scene
->r
.bake_filter
, 0.0, 32.0, 0, 0, "Amount of pixels to extend the baked result with, as post process filter");
1882 /* Note: this is a block menu, need 0 events, otherwise the menu closes */
1883 static uiBlock
*stamp_render_menu(void *arg_unused
)
1887 block
= uiNewBlock(&curarea
->uiblocks
, "stamp render", UI_EMBOSS
, UI_HELV
, curarea
->win
);
1889 /* use this for a fake extra empty space around the buttons. */
1890 uiDefBut(block
, LABEL
, 0, "", 0, 0, 140, 60, NULL
, 0, 0, 0, 0, "");
1892 /* stamp options buttons. */
1893 uiDefButBitI(block
, TOG
, R_STAMP_DATE
, B_REDR
, "Date", 10, 10, 59, 19, &G
.scene
->r
.stamp
, 0, 0, 0, 0, "Stamp Date");
1894 uiDefButBitI(block
, TOG
, R_STAMP_USER
, B_REDR
, "User", 69, 10, 59, 19, &G
.scene
->r
.stamp
, 0, 0, 0, 0, "Stamp User Data");
1895 uiDefButBitI(block
, TOG
, R_STAMP_TIME
, B_REDR
, "Time", 69, 30, 59, 19, &G
.scene
->r
.stamp
, 0, 0, 0, 0, "Stamp Time (HH:MM:SS)");
1896 uiDefButBitI(block
, TOG
, R_STAMP_FRAME
, B_REDR
, "Frame", 10, 30, 59, 19, &G
.scene
->r
.stamp
, 0, 0, 0, 0, "Stamp Frame Number");
1897 uiDefButBitI(block
, TOG
, R_STAMP_CAMERA
, B_REDR
, "Camera", 69, 50, 59, 19, &G
.scene
->r
.stamp
, 0, 0, 0, 0, "Stamp Camera Name");
1898 uiDefButBitI(block
, TOG
, R_STAMP_SCENE
, B_REDR
, "Scene", 10, 50, 59, 19, &G
.scene
->r
.stamp
, 0, 0, 0, 0, "Stamp Scene Name");
1899 uiDefBut(block
, TEX
, B_NOP
, "U:", 10, 70, 118, 19, &G
.scene
->r
.stamp_u_data
, 0.0, 128.0, 100, 0, "");
1900 uiDefButF(block
, COL
, B_NOP
, "", 10, 90, 118, 19, G
.scene
->r
.cstamp
, 0, 0, 0, 0, "Stamp Color");
1901 uiBlockSetDirection(block
, UI_TOP
);
1905 static void render_panel_render(void)
1910 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_render", UI_EMBOSS
, UI_HELV
, curarea
->win
);
1911 if(uiNewPanel(curarea
, block
, "Render", "Render", 320, 0, 318, 204)==0) return;
1913 uiBlockBeginAlign(block
);
1914 uiDefBut(block
, BUT
,B_DORENDER
,"RENDER", 369, 164, 191,37, 0, 0, 0, 0, 0, "Start the rendering");
1915 #ifndef DISABLE_YAFRAY
1916 /* yafray: on request, render engine menu is back again, and moved to Render panel */
1917 uiDefButS(block
, MENU
, B_SWITCHRENDER
, "Rendering Engine %t|Blender Internal %x0|YafRay %x1",
1918 369, 142, 191, 20, &G
.scene
->r
.renderer
, 0, 0, 0, 0, "Choose rendering engine");
1920 uiDefButS(block
, MENU
, B_SWITCHRENDER
, "Rendering Engine %t|Blender Internal %x0",
1921 369, 142, 191, 20, &G
.scene
->r
.renderer
, 0, 0, 0, 0, "Choose rendering engine");
1922 #endif /* disable yafray */
1924 uiBlockBeginAlign(block
);
1925 uiDefButBitI(block
, TOG
, R_OSA
, B_DIFF
, "OSA", 369,110,122,21,&G
.scene
->r
.mode
, 0, 0, 0, 0, "Enables Oversampling (Anti-aliasing)");
1926 uiDefButS(block
, ROW
, B_REDR
, "3", 369, 93, 31, 21, &G
.scene
->r
.osa
, 2.0, 3.0, 0, 0, "Sets oversample level to 2");
1927 uiDefButS(block
, ROW
, B_REDR
, "5", 400, 93, 31, 21, &G
.scene
->r
.osa
, 2.0, 5.0, 0, 0, "Sets oversample level to 5");
1928 uiDefButS(block
, ROW
, B_REDR
, "8", 431, 93, 31, 21, &G
.scene
->r
.osa
, 2.0, 8.0, 0, 0, "Sets oversample level to 8 (Recommended)");
1929 uiDefButS(block
, ROW
, B_REDR
, "16", 461, 93, 30, 21, &G
.scene
->r
.osa
, 2.0, 16.0, 0, 0, "Sets oversample level to 16");
1930 uiDefButS(block
, NUM
, B_REDR
, "", 369, 77, 122, 23, &G
.scene
->r
.osa
, 2.0, 16.0, 0, 0, "");
1931 uiBlockEndAlign(block
);
1933 uiBlockBeginAlign(block
);
1934 uiDefButBitI(block
, TOG
, R_MBLUR
, B_REDR
, "MBLUR", 496,109,64,20,&G
.scene
->r
.mode
, 0, 0, 0, 0, "Enables Motion Blur calculation");
1935 uiDefButF(block
, NUM
,B_DIFF
,"Bf:", 496,88,64,20,&G
.scene
->r
.blurfac
, 0.01, 5.0, 10, 2, "Sets motion blur factor");
1936 uiBlockEndAlign(block
);
1938 uiBlockBeginAlign(block
);
1939 uiDefButS(block
, NUM
,B_DIFF
,"Xparts:", 369,55,96,19,&G
.scene
->r
.xparts
,1.0, 512.0, 0, 0, "Sets the number of horizontal parts to render image in (For panorama sets number of camera slices)");
1940 uiDefButS(block
, NUM
,B_DIFF
,"Yparts:", 465,55,96,19,&G
.scene
->r
.yparts
,1.0, 64.0, 0, 0, "Sets the number of vertical parts to render image in");
1941 uiBlockEndAlign(block
);
1943 uiBlockBeginAlign(block
);
1944 uiDefButBitS(block
, TOG
, R_STAMP_INFO
, B_REDR
, "Stamp", 369, 36, 70, 19, &G
.scene
->r
.scemode
, 0, 0, 0, 0, "Enable/Disable stamp info in render");
1945 uiDefBlockBut(block
, stamp_render_menu
, NULL
, "Stamp settings", 440, 36, 121, 19, "Display Stamp Settings");
1946 uiBlockEndAlign(block
);
1948 uiBlockBeginAlign(block
);
1949 uiDefButS(block
, ROW
,800,"Sky", 369,13,35,20,&G
.scene
->r
.alphamode
,3.0,0.0, 0, 0, "Fill background with sky");
1950 uiDefButS(block
, ROW
,800,"Premul", 405,13,50,20,&G
.scene
->r
.alphamode
,3.0,1.0, 0, 0, "Multiply alpha in advance");
1951 uiDefButS(block
, ROW
,800,"Key", 456,13,35,20,&G
.scene
->r
.alphamode
,3.0,2.0, 0, 0, "Alpha and color values remain unchanged");
1952 uiBlockEndAlign(block
);
1954 if(G
.scene
->r
.mode
& R_RAYTRACE
)
1955 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");
1957 uiBlockBeginAlign(block
);
1958 uiDefButBitI(block
, TOG
, R_SHADOW
, B_REDR
,"Shadow", 565,172,52,29, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Enable shadow calculation");
1959 uiDefButBitI(block
, TOG
, R_SSS
, B_REDR
,"SSS", 617,172,32,29, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Enable subsurface scattering map rendering");
1960 uiDefButBitI(block
, TOG
, R_PANORAMA
, B_REDR
,"Pano", 649,172,38,29, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Enable panorama rendering (output width is multiplied by Xparts)");
1961 uiDefButBitI(block
, TOG
, R_ENVMAP
, B_REDR
,"EnvMap", 565,142,52,29, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Enable environment map rendering");
1962 uiDefButBitI(block
, TOG
, R_RAYTRACE
, B_REDR
,"Ray",617,142,32,29, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Enable ray tracing");
1963 uiDefButBitI(block
, TOG
, R_RADIO
, B_REDR
,"Radio", 649,142,38,29, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Enable radiosity rendering");
1964 uiBlockEndAlign(block
);
1966 uiBlockBeginAlign(block
);
1967 uiDefButS(block
, ROW
, B_REDR
, "100%", 565, 113, 122, 18, &G
.scene
->r
.size
, 1.0, 100.0, 0, 0, "Set render size to defined size");
1968 uiDefButS(block
, ROW
, B_REDR
, "75%", 565, 95, 40, 18, &G
.scene
->r
.size
, 1.0, 75.0, 0, 0, "Set render size to 3/4 of defined size");
1969 uiDefButS(block
, ROW
, B_REDR
, "50%", 606, 95, 40, 18, &G
.scene
->r
.size
, 1.0, 50.0, 0, 0, "Set render size to 1/2 of defined size");
1970 uiDefButS(block
, ROW
, B_REDR
, "25%", 647, 95, 40, 18, &G
.scene
->r
.size
, 1.0, 25.0, 0, 0, "Set render size to 1/4 of defined size");
1971 uiDefButS(block
, NUM
, B_REDR
, "Size %", 565, 77, 122, 18, &G
.scene
->r
.size
, 1.0, 1000.0, 0, 0, "Set render size in percentage");
1972 uiBlockEndAlign(block
);
1974 uiBlockBeginAlign(block
);
1975 uiDefButBitI(block
, TOG
, R_FIELDS
, B_REDR
,"Fields", 565,55,60,20,&G
.scene
->r
.mode
, 0, 0, 0, 0, "Enables field rendering");
1976 uiDefButBitI(block
, TOG
, R_ODDFIELD
, B_REDR
,"Odd", 627,55,39,20,&G
.scene
->r
.mode
, 0, 0, 0, 0, "Enables Odd field first rendering (Default: Even field)");
1977 uiDefButBitI(block
, TOG
, R_FIELDSTILL
, B_REDR
,"X", 668,55,19,20,&G
.scene
->r
.mode
, 0, 0, 0, 0, "Disables time difference in field calculations");
1979 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
);
1980 uiDefButS(block
, MENU
, B_DIFF
,str
, 565,34,60,20, &G
.scene
->r
.filtertype
, 0, 0, 0, 0, "Set sampling filter for antialiasing");
1981 uiDefButF(block
, NUM
,B_DIFF
,"", 627,34,60,20,&G
.scene
->r
.gauss
,0.5, 1.5, 10, 2, "Sets the filter size");
1983 uiDefButBitI(block
, TOG
, R_BORDER
, REDRAWVIEWCAM
, "Border", 565,13,122,20, &G
.scene
->r
.mode
, 0, 0, 0, 0, "Render a small cut-out of the image");
1984 uiBlockEndAlign(block
);
1988 static void render_panel_anim(void)
1993 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_anim", UI_EMBOSS
, UI_HELV
, curarea
->win
);
1994 if(uiNewPanel(curarea
, block
, "Anim", "Render", 640, 0, 318, 204)==0) return;
1997 uiDefBut(block
, BUT
,B_DOANIM
,"ANIM", 692,142,192,47, 0, 0, 0, 0, 0, "Start rendering a sequence");
1999 uiBlockSetCol(block
, TH_BUT_SETTING1
);
2000 uiBlockBeginAlign(block
);
2001 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)");
2002 uiDefButBitS(block
, TOG
, R_DOCOMP
, B_NOP
, "Do Composite",692,90,192,20, &G
.scene
->r
.scemode
, 0, 0, 0, 0, "Uses compositing nodes for output rendering");
2003 uiBlockEndAlign(block
);
2005 uiBlockSetCol(block
, TH_AUTO
);
2006 uiDefBut(block
, BUT
,B_PLAYANIM
, "PLAY",692,50,94,33, 0, 0, 0, 0, 0, "Play animation of rendered images/avi (searches Pics: field)");
2007 uiDefButS(block
, NUM
, B_RTCHANGED
, "rt:",789,50,95,33, &G
.rt
, -1000.0, 1000.0, 0, 0, "General testing/debug button");
2009 uiBlockBeginAlign(block
);
2010 uiDefButI(block
, NUM
,REDRAWSEQ
,"Sta:",692,20,94,24, &G
.scene
->r
.sfra
,1.0,MAXFRAMEF
, 0, 0, "The start frame of the animation");
2011 uiDefButI(block
, NUM
,REDRAWSEQ
,"End:",789,20,95,24, &G
.scene
->r
.efra
,SFRA
,MAXFRAMEF
, 0, 0, "The end frame of the animation");
2012 uiDefButI(block
, NUM
,REDRAWSEQ
,"Step:",692,0,192,18, &G
.scene
->frame_step
,1.0,MAXFRAMEF
, 0, 0, "Frame step");
2013 uiBlockEndAlign(block
);
2016 static char *scene_compo_menu(void)
2019 int len
= 32 + 32*BLI_countlist(&G
.scene
->compo_scenes
);
2021 char *str
= MEM_callocN(len
, "menu plumi compo");
2023 for(nr
= 0, a
= 0, spl
= G
.scene
->compo_scenes
.first
; spl
; spl
= spl
->next
, nr
++) {
2024 a
+= sprintf(str
+a
, "|%s %%x%d", spl
->scene
->id
.name
+2, nr
);
2029 int scene_compo_check(char *name
)
2033 p
= G
.scene
->compo_scenes
.first
;
2035 if(!strcmp (p
->scene
->id
.name
+2, name
))
2042 static void scene_compo_menu_add(void *unused
, void *unused1
)
2045 int len
= 32+ 32*10; /* max number of scene: 10 */
2047 char *str
= MEM_callocN(len
, "menu add plumi compo");
2049 for(nr
= 0, a
= 0, p
= G
.main
->scene
.first
; p
; p
= p
->id
.next
, nr
++) {
2050 if(p
!=G
.scene
) { /* don't show the current scene. */
2051 if(!scene_compo_check(p
->id
.name
+2)) {
2052 a
+= sprintf(str
+a
, "|%s %%x%d", p
->id
.name
+2, nr
);
2066 for(nr
= 0, p
= G
.main
->scene
.first
; p
; p
= p
->id
.next
, nr
++) {
2075 static void scene_compo_menu_del(void *unused
, void *unused1
)
2081 if(!G
.scene
->compo_scenes
.first
)
2084 str
= scene_compo_menu();
2089 for(nr
= 0, spl
= G
.scene
->compo_scenes
.first
; spl
; spl
= spl
->next
, nr
++) {
2091 scene_del_compo(spl
);
2098 static void render_panel_plumiferos(void)
2103 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_plumiferos", UI_EMBOSS
, UI_HELV
, curarea
->win
);
2104 if(uiNewPanel(curarea
, block
, "Plumiferos Render", "Render", 640, 0, 318, 204)==0) return;
2107 uiDefButBitS(block
, TOG
, SCE_USE_COMPO
, B_NOP
, "DEPENDENCE",
2108 692, 142, 192, 47, &G
.scene
->compo_flags
, 0, 0, 0, 0,
2109 "Enable Dependence Render");
2111 uiBlockBeginAlign(block
);
2112 bt
= uiDefBut(block
, BUT
, 1, "Add", 692, 100, 94, 33, NULL
,
2113 0.0, 0.0, 0.0, 0.0, "Add a new scene to the dependence list");
2114 uiButSetFunc(bt
, scene_compo_menu_add
, NULL
, NULL
);
2116 bt
= uiDefBut(block
, BUT
, 2, "Del", 789, 100, 95, 33, NULL
,
2117 0.0, 0.0, 0.0, 0.0, "Remove a scene from the dependence list");
2118 uiButSetFunc(bt
, scene_compo_menu_del
, NULL
, NULL
);
2119 uiBlockEndAlign(block
);
2123 static void set_ffmpeg_preset(int preset
)
2125 int isntsc
= (G
.scene
->r
.frs_sec
!= 25);
2127 case FFMPEG_PRESET_VCD
:
2128 G
.scene
->r
.ffcodecdata
.type
= FFMPEG_MPEG1
;
2129 G
.scene
->r
.ffcodecdata
.video_bitrate
= 1150;
2130 G
.scene
->r
.xsch
= 352;
2131 G
.scene
->r
.ysch
= isntsc
? 240 : 288;
2132 G
.scene
->r
.ffcodecdata
.gop_size
= isntsc
? 18 : 15;
2133 G
.scene
->r
.ffcodecdata
.rc_max_rate
= 1150;
2134 G
.scene
->r
.ffcodecdata
.rc_min_rate
= 1150;
2135 G
.scene
->r
.ffcodecdata
.rc_buffer_size
= 40*8;
2136 G
.scene
->r
.ffcodecdata
.mux_packet_size
= 2324;
2137 G
.scene
->r
.ffcodecdata
.mux_rate
= 2352 * 75 * 8;
2139 case FFMPEG_PRESET_SVCD
:
2140 G
.scene
->r
.ffcodecdata
.type
= FFMPEG_MPEG2
;
2141 G
.scene
->r
.ffcodecdata
.video_bitrate
= 2040;
2142 G
.scene
->r
.xsch
= 480;
2143 G
.scene
->r
.ysch
= isntsc
? 480 : 576;
2144 G
.scene
->r
.ffcodecdata
.gop_size
= isntsc
? 18 : 15;
2145 G
.scene
->r
.ffcodecdata
.rc_max_rate
= 2516;
2146 G
.scene
->r
.ffcodecdata
.rc_min_rate
= 0;
2147 G
.scene
->r
.ffcodecdata
.rc_buffer_size
= 224*8;
2148 G
.scene
->r
.ffcodecdata
.mux_packet_size
= 2324;
2149 G
.scene
->r
.ffcodecdata
.mux_rate
= 0;
2152 case FFMPEG_PRESET_DVD
:
2153 G
.scene
->r
.ffcodecdata
.type
= FFMPEG_MPEG2
;
2154 G
.scene
->r
.ffcodecdata
.video_bitrate
= 6000;
2155 G
.scene
->r
.xsch
= 720;
2156 G
.scene
->r
.ysch
= isntsc
? 480 : 576;
2157 G
.scene
->r
.ffcodecdata
.gop_size
= isntsc
? 18 : 15;
2158 G
.scene
->r
.ffcodecdata
.rc_max_rate
= 9000;
2159 G
.scene
->r
.ffcodecdata
.rc_min_rate
= 0;
2160 G
.scene
->r
.ffcodecdata
.rc_buffer_size
= 224*8;
2161 G
.scene
->r
.ffcodecdata
.mux_packet_size
= 2048;
2162 G
.scene
->r
.ffcodecdata
.mux_rate
= 10080000;
2165 case FFMPEG_PRESET_DV
:
2166 G
.scene
->r
.ffcodecdata
.type
= FFMPEG_DV
;
2167 G
.scene
->r
.xsch
= 720;
2168 G
.scene
->r
.ysch
= isntsc
? 480 : 576;
2173 static void render_panel_ffmpeg_video(void)
2180 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_ffmpeg_video",
2181 UI_EMBOSS
, UI_HELV
, curarea
->win
);
2183 uiNewPanelTabbed("Format", "Render");
2184 if (uiNewPanel(curarea
, block
, "Video", "Render", 960, 0, 318, 204)== 0)
2187 if (ffmpeg_preset_sel
!= 0) {
2188 set_ffmpeg_preset(ffmpeg_preset_sel
);
2189 ffmpeg_preset_sel
= 0;
2190 allqueue(REDRAWBUTSSCENE
, 0);
2197 uiDefBut(block
, LABEL
, B_DIFF
, "Format", xcol1
, yofs
+88,
2198 110, 20, 0, 0, 0, 0, 0, "");
2199 uiDefBut(block
, LABEL
, B_DIFF
, "Preset", xcol2
, yofs
+88,
2200 110, 20, 0, 0, 0, 0, 0, "");
2201 uiDefButI(block
, MENU
, B_DIFF
, ffmpeg_format_pup(),
2202 xcol1
, yofs
+66, 110, 20, &G
.scene
->r
.ffcodecdata
.type
,
2203 0,0,0,0, "output file format");
2204 uiDefButI(block
, NUM
, B_DIFF
, "Bitrate",
2205 xcol1
, yofs
+44, 110, 20,
2206 &G
.scene
->r
.ffcodecdata
.video_bitrate
,
2207 1, 14000, 0, 0, "Video bitrate(kb/s)");
2208 uiDefButI(block
, NUM
, B_DIFF
, "Min Rate",
2209 xcol1
, yofs
+22, 110, 20, &G
.scene
->r
.ffcodecdata
.rc_min_rate
,
2210 0, 14000, 0, 0, "Rate control: min rate(kb/s)");
2211 uiDefButI(block
, NUM
, B_DIFF
, "Max Rate",
2212 xcol1
, yofs
, 110, 20, &G
.scene
->r
.ffcodecdata
.rc_max_rate
,
2213 1, 14000, 0, 0, "Rate control: max rate(kb/s)");
2215 uiDefButI(block
, NUM
, B_DIFF
, "Mux Rate",
2216 xcol1
, yofs
-22, 110, 20,
2217 &G
.scene
->r
.ffcodecdata
.mux_rate
,
2218 0, 100000000, 0, 0, "Mux rate (bits/s(!))");
2221 uiDefButI(block
, MENU
, B_REDR
, ffmpeg_preset_pup(),
2222 xcol2
, yofs
+66, 110, 20, &ffmpeg_preset_sel
,
2223 0,0,0,0, "Output file format preset selection");
2224 uiDefButI(block
, NUM
, B_DIFF
, "GOP Size",
2225 xcol2
, yofs
+44, 110, 20, &G
.scene
->r
.ffcodecdata
.gop_size
,
2226 0, 100, 0, 0, "Distance between key frames");
2227 uiDefButI(block
, NUM
, B_DIFF
, "Buffersize",
2228 xcol2
, yofs
+22, 110, 20,
2229 &G
.scene
->r
.ffcodecdata
.rc_buffer_size
,
2230 0, 2000, 0, 0, "Rate control: buffer size (kb)");
2231 uiDefButI(block
, NUM
, B_DIFF
, "Mux PSize",
2232 xcol2
, yofs
, 110, 20,
2233 &G
.scene
->r
.ffcodecdata
.mux_packet_size
,
2234 0, 16384, 0, 0, "Mux packet size (byte)");
2236 uiDefButBitI(block
, TOG
, FFMPEG_AUTOSPLIT_OUTPUT
, B_NOP
,
2238 xcol2
, yofs
-22, 110, 20,
2239 &G
.scene
->r
.ffcodecdata
.flags
,
2240 0, 1, 0,0, "Autosplit output at 2GB boundary.");
2243 if (ELEM(G
.scene
->r
.ffcodecdata
.type
, FFMPEG_AVI
, FFMPEG_MOV
)) {
2244 uiDefBut(block
, LABEL
, 0, "Codec",
2245 xcol1
, yofs
-44, 110, 20, 0, 0, 0, 0, 0, "");
2246 uiDefButI(block
, MENU
,B_REDR
, ffmpeg_codec_pup(),
2247 xcol1
, yofs
-66, 110, 20,
2248 &G
.scene
->r
.ffcodecdata
.codec
,
2249 0,0,0,0, "FFMpeg codec to use");
2253 static void render_panel_ffmpeg_audio(void)
2259 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_ffmpeg_audio", UI_EMBOSS
, UI_HELV
, curarea
->win
);
2260 uiNewPanelTabbed("Format", "Render");
2261 if (uiNewPanel(curarea
, block
, "Audio", "Render", 960, 0, 318, 204) == 0) return;
2266 uiDefButBitI(block
, TOG
, FFMPEG_MULTIPLEX_AUDIO
, B_NOP
,
2267 "Multiplex audio", xcol
, yofs
, 225, 20,
2268 &G
.scene
->r
.ffcodecdata
.flags
,
2269 0, 1, 0,0, "Interleave audio with the output video");
2270 uiDefBut(block
, LABEL
, 0, "Codec",
2271 xcol
, yofs
-22, 225, 20, 0, 0, 0, 0, 0, "");
2272 uiDefButI(block
, MENU
,B_NOP
, ffmpeg_audio_codec_pup(),
2273 xcol
, yofs
-44, 225, 20,
2274 &G
.scene
->r
.ffcodecdata
.audio_codec
,
2275 0,0,0,0, "FFMpeg codec to use");
2276 uiDefButI(block
, NUM
, B_DIFF
, "Bitrate",
2277 xcol
, yofs
-66, 110, 20,
2278 &G
.scene
->r
.ffcodecdata
.audio_bitrate
,
2279 32, 384, 0, 0, "Audio bitrate(kb/s)");
2283 static char *scene_plumi_menu(void)
2286 int len
= 32 + 32*BLI_countlist(&G
.scene
->bg_scenes
);
2288 char *str
= MEM_callocN(len
, "menu plumi");
2290 for(nr
= 0, a
= 0, spl
= G
.scene
->bg_scenes
.first
; spl
; spl
= spl
->next
, nr
++) {
2291 a
+= sprintf(str
+a
, "|%s %%x%d", spl
->scene
->id
.name
+2, nr
);
2296 int scene_plumi_check(char *name
)
2300 p
= G
.scene
->bg_scenes
.first
;
2302 if(!strcmp (p
->scene
->id
.name
+2, name
))
2309 static void scene_plumi_menu_add(void *unused
, void *unused1
)
2312 int len
= 32+ 32*10; /* max number of scene: 10 */
2314 char *str
= MEM_callocN(len
, "menu add plumi");
2316 for(nr
= 0, a
= 0, p
= G
.main
->scene
.first
; p
; p
= p
->id
.next
, nr
++) {
2317 if(p
!=G
.scene
) { /* don't show the current scene. */
2318 if(!scene_plumi_check(p
->id
.name
+2)) {
2319 a
+= sprintf(str
+a
, "|%s %%x%d", p
->id
.name
+2, nr
);
2333 for(nr
= 0, p
= G
.main
->scene
.first
; p
; p
= p
->id
.next
, nr
++) {
2342 static void scene_plumi_menu_del(void *unused
, void *unused1
)
2348 if(!G
.scene
->bg_scenes
.first
)
2351 str
= scene_plumi_menu();
2356 for(nr
= 0, spl
= G
.scene
->bg_scenes
.first
; spl
; spl
= spl
->next
, nr
++) {
2358 scene_del_plumi(spl
);
2365 static void scene_plumi_clean(void *unused
, void *unused1
)
2367 if(okee("Solamente hace esto si estas bien seguro!!!")) {
2368 if(G
.scene
->bg_scenes
.first
) {
2369 BLI_freelistN(&G
.scene
->bg_scenes
);
2370 G
.scene
->bg_flags
= 0;
2375 static void render_panel_format(void)
2382 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_format", UI_EMBOSS
, UI_HELV
, curarea
->win
);
2383 if(uiNewPanel(curarea
, block
, "Format", "Render", 960, 0, 318, 204)==0) return;
2384 uiDefBlockBut(block
, framing_render_menu
, NULL
,
2385 "Game framing settings",
2386 892, 169, 227, 20, "Display game framing settings");
2387 /* uiDefIconTextBlockBut(block, framing_render_menu, NULL,
2388 ICON_BLOCKBUT_CORNER,
2389 "Game framing settings",
2391 "Display game framing settings"); */
2393 uiBlockBeginAlign(block
);
2394 uiDefButS(block
, NUM
,REDRAWVIEWCAM
,"SizeX:", 892 ,136,112,27, &G
.scene
->r
.xsch
, 4.0, 10000.0, 0, 0, "The image width in pixels");
2395 uiDefButS(block
, NUM
,REDRAWVIEWCAM
,"SizeY:", 1007,136,112,27, &G
.scene
->r
.ysch
, 4.0,10000.0, 0, 0, "The image height in scanlines");
2396 uiDefButS(block
, NUM
,REDRAWVIEWCAM
,"AspX:", 892 ,114,112,20, &G
.scene
->r
.xasp
, 1.0,200.0, 0, 0, "The horizontal aspect ratio");
2397 uiDefButS(block
, NUM
,REDRAWVIEWCAM
,"AspY:", 1007,114,112,20, &G
.scene
->r
.yasp
, 1.0,200.0, 0, 0, "The vertical aspect ratio");
2398 uiBlockEndAlign(block
);
2404 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");
2405 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");
2408 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");
2409 uiDefButBitI(block
, TOG
, R_CROP
, B_DIFF
, "Crop", 1068,yofs
,51,20, &G
.scene
->r
.mode
, 0, 0, 0, 0, "When Border render, the resulting image gets cropped");
2413 if(G
.scene
->r
.quality
==0) G
.scene
->r
.quality
= 90;
2415 #ifdef WITH_QUICKTIME
2416 if (G
.scene
->r
.imtype
== R_AVICODEC
|| G
.scene
->r
.imtype
== R_QUICKTIME
) {
2417 #else /* WITH_QUICKTIME */
2420 if(G
.scene
->r
.imtype
== R_QUICKTIME
) {
2421 #ifdef WITH_QUICKTIME
2422 #if defined (_WIN32) || defined (__APPLE__)
2423 //glColor3f(0.65, 0.65, 0.7);
2424 //glRecti(892,yofs+46,892+225,yofs+45+20);
2425 if(G
.scene
->r
.qtcodecdata
== NULL
)
2426 uiDefBut(block
, LABEL
, 0, "Codec: not set", 892,yofs
+44,225,20, 0, 0, 0, 0, 0, "");
2428 uiDefBut(block
, LABEL
, 0, G
.scene
->r
.qtcodecdata
->qtcodecname
, 892,yofs
+44,225,20, 0, 0, 0, 0, 0, "");
2429 uiDefBut(block
, BUT
,B_SELECTCODEC
, "Set codec", 892,yofs
,74,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime");
2431 #endif /* WITH_QUICKTIME */
2434 //glColor3f(0.65, 0.65, 0.7);
2435 //glRecti(892,yofs+46,892+225,yofs+45+20);
2436 if(G
.scene
->r
.avicodecdata
== NULL
)
2437 uiDefBut(block
, LABEL
, 0, "Codec: not set.", 892,yofs
+43,225,20, 0, 0, 0, 0, 0, "");
2439 uiDefBut(block
, LABEL
, 0, avicodec_str(), 892,yofs
+43,225,20, 0, 0, 0, 0, 0, "");
2441 uiDefBut(block
, BUT
,B_SELECTCODEC
, "Set codec", 892,yofs
,74,20, 0, 0, 0, 0, 0, "Set codec settings for AVI");
2445 else if (ELEM(G
.scene
->r
.imtype
, R_OPENEXR
, R_MULTILAYER
)) {
2446 if (G
.scene
->r
.quality
> 5) G
.scene
->r
.quality
= 2;
2448 if(G
.scene
->r
.imtype
==R_OPENEXR
) {
2449 uiBlockBeginAlign(block
);
2450 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");
2451 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");
2452 uiBlockEndAlign(block
);
2453 uiDefButBitS(block
, TOG
, R_PREVIEW_JPG
, B_NOP
,"Preview",1027,yofs
+44,90,20, &G
.scene
->r
.subimtype
, 0, 0, 0, 0, "When animation render, save JPG preview images in same directory");
2456 uiBlockBeginAlign(block
);
2458 uiDefButBitS(block
, TOG
, SCE_USE_BACKGROUND
, B_NOP
, "Add Layers", 892, yofs
+44, 100, 20, &G
.scene
->bg_flags
, 0, 0, 0, 0, "Save Render Layers from background scene");
2459 bt
= uiDefBut(block
, BUT
, 3, "C", 992, yofs
+44, 20, 20, NULL
, 0.0, 0.0, 0.0, 0.0, "Fix PlumiScene");
2460 uiButSetFunc(bt
, scene_plumi_clean
, NULL
, NULL
);
2462 bt
= uiDefBut(block
, BUT
, 1, "Add", 1012, yofs
+44, 53, 20, NULL
, 0.0, 0.0, 0.0, 0.0, "Add a new scene to the list");
2463 uiButSetFunc(bt
, scene_plumi_menu_add
, NULL
, NULL
);
2465 bt
= uiDefBut(block
, BUT
, 2, "Del", 1065, yofs
+44, 54, 20, NULL
, 0.0, 0.0, 0.0, 0.0, "Remove a scene from the list");
2466 uiButSetFunc(bt
, scene_plumi_menu_del
, NULL
, NULL
);
2468 uiBlockEndAlign(block
);
2470 uiDefButS(block
, MENU
,B_NOP
, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4",
2471 892,yofs
,74,20, &G
.scene
->r
.quality
, 0, 0, 0, 0, "Set codec settings for OpenEXR");
2474 } else if (G
.scene
->r
.imtype
== R_DPX
|| G
.scene
->r
.imtype
== R_CINEON
) {
2475 uiDefButBitS(block
, TOG
, R_CINEON_LOG
, B_REDR
, "Log", 892,yofs
,74,20, &G
.scene
->r
.subimtype
, 0, 0, 0, 0, "Convert to log color space");
2477 if(G
.scene
->r
.subimtype
& R_CINEON_LOG
) {
2478 uiBlockBeginAlign(block
);
2479 uiDefButS(block
, NUM
, B_NOP
, "B", 892,yofs
+44,80,20, &G
.scene
->r
.cineonblack
, 0, 1024, 0, 0, "Log conversion reference black");
2480 uiDefButS(block
, NUM
, B_NOP
, "W", 972,yofs
+44,80,20, &G
.scene
->r
.cineonwhite
, 0, 1024, 0, 0, "Log conversion reference white");
2481 uiDefButF(block
, NUM
, B_NOP
, "G", 1052,yofs
+44,70,20, &G
.scene
->r
.cineongamma
, 0.0f
, 10.0f
, 1, 2, "Log conversion gamma");
2482 uiBlockEndAlign(block
);
2484 } else if (G
.scene
->r
.imtype
== R_TIFF
) {
2485 uiDefButBitS(block
, TOG
, R_TIFF_16BIT
, B_REDR
, "16 Bit", 892,yofs
,74,20, &G
.scene
->r
.subimtype
, 0, 0, 0, 0, "Save 16 bit per channel TIFF");
2487 if(G
.scene
->r
.quality
< 5) G
.scene
->r
.quality
= 90; /* restore from openexr */
2489 uiDefButS(block
, NUM
,B_DIFF
, "Q:", 892,yofs
,74,20, &G
.scene
->r
.quality
, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies");
2491 uiDefButS(block
, NUM
,B_FRAMEMAP
,"FPS:", 968,yofs
,75,20, &G
.scene
->r
.frs_sec
, 1.0, 120.0, 100.0, 0, "Frames per second");
2492 uiDefButF(block
, NUM
,B_FRAMEMAP
,"/", 1043,yofs
,75,20, &G
.scene
->r
.frs_sec_base
, 1.0, 120.0, 0.1, 3, "Frames per second base");
2495 uiBlockBeginAlign(block
);
2496 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");
2497 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");
2498 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)");
2500 uiBlockBeginAlign(block
);
2501 uiDefBut(block
, BUT
, B_PR_FULL
, "Plumiferos", 1146, 170, 100, 18, 0, 0, 0, 0, 0, "Plumiferos High - 1920x816, Aspect ratio - 1x1");
2502 uiDefBut(block
, BUT
, B_PR_PRV
, "OpenGL", 1146, 150, 100, 18, 0, 0, 0, 0, 0, "Plumiferos OpenGL - 960x408, Render size 100%");
2503 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)");
2504 uiDefBut(block
, BUT
, B_PR_PAL
, "PAL", 1146, 110, 100, 18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x576, Aspect ratio - 54x51, 25 fps");
2505 uiDefBut(block
, BUT
,B_PR_PC
, "PC", 1146,90,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 640x480, Aspect ratio - 100x100");
2506 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");
2507 uiDefBut(block
, BUT
,B_PR_PANO
, "PANO", 1146,50,100,18, 0, 0, 0, 0, 0, "Standard panorama settings");
2508 uiDefBut(block
, BUT
, B_PR_NTSC
, "NTSC", 1146, 30, 100, 18, 0, 0, 0, 0, 0, "Size preset: Image size - 720x480, Aspect ratio - 10x11, 30 fps");
2509 uiDefBut(block
, BUT
,B_PR_HD
, "HD", 1146,10,100,18, 0, 0, 0, 0, 0, "Size preset: Image size - 1920x1080, Aspect ratio - 1x1");
2510 uiBlockEndAlign(block
);
2513 #ifndef DISABLE_YAFRAY /* disable yafray stuff */
2514 /* yafray: global illumination options panel */
2515 static void render_panel_yafrayGI()
2519 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_yafrayGI", UI_EMBOSS
, UI_HELV
, curarea
->win
);
2520 uiNewPanelTabbed("Render", "Render");
2521 if(uiNewPanel(curarea
, block
, "YafRay GI", "Render", 320, 0, 318, 204)==0) return;
2523 // label to force a boundbox for buttons not to be centered
2524 uiDefBut(block
, LABEL
, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, "");
2526 uiDefBut(block
, LABEL
, 0, "Method", 5,175,70,20, 0, 1.0, 0, 0, 0, "");
2527 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");
2529 uiDefBut(block
, LABEL
, 0, "Quality", 5,150,70,20, 0, 1.0, 0, 0, 0, "");
2530 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");
2532 if (G
.scene
->r
.GImethod
>0) {
2533 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");
2534 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");
2537 if (G
.scene
->r
.GImethod
>0)
2539 if (G
.scene
->r
.GIdepth
==0) G
.scene
->r
.GIdepth
=2;
2541 if (G
.scene
->r
.GImethod
==2) {
2542 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");
2543 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)");
2544 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");
2547 uiDefButBitS(block
, TOG
, 1, B_REDR
, "Cache",6,125,95,20, &G
.scene
->r
.GIcache
, 0, 0, 0, 0, "Cache occlusion/irradiance samples (faster)");
2548 if (G
.scene
->r
.GIcache
)
2550 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)");
2551 uiDefBut(block
, LABEL
, 0, "Cache parameters:", 5,105,130,20, 0, 1.0, 0, 0, 0, "");
2552 if (G
.scene
->r
.GIshadowquality
==0.0) G
.scene
->r
.GIshadowquality
=0.9;
2553 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 :-) ");
2554 if (G
.scene
->r
.GIpixelspersample
==0) G
.scene
->r
.GIpixelspersample
=10;
2555 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");
2556 if (G
.scene
->r
.GIrefinement
==0) G
.scene
->r
.GIrefinement
=1.0;
2557 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");
2560 if (G
.scene
->r
.GImethod
==2) {
2561 if (G
.scene
->r
.GIphotons
)
2563 uiDefBut(block
, LABEL
, 0, "Photon parameters:", 170,105,130,20, 0, 1.0, 0, 0, 0, "");
2564 if(G
.scene
->r
.GIphotoncount
==0) G
.scene
->r
.GIphotoncount
=100000;
2565 uiDefButI(block
, NUM
, B_DIFF
, "Count:", 170,85,140,20, &G
.scene
->r
.GIphotoncount
,
2566 0, 10000000, 10, 10, "Number of photons to shoot");
2567 if(G
.scene
->r
.GIphotonradius
==0.0) G
.scene
->r
.GIphotonradius
=1.0;
2568 uiDefButF(block
, NUMSLI
, B_DIFF
,"Radius:", 170,60,140,20, &(G
.scene
->r
.GIphotonradius
),
2569 0.00001, 100.0 ,0,0, "Radius to search for photons to mix (blur)");
2570 if(G
.scene
->r
.GImixphotons
==0) G
.scene
->r
.GImixphotons
=100;
2571 uiDefButI(block
, NUM
, B_DIFF
, "MixCount:", 170,35,140,20, &G
.scene
->r
.GImixphotons
,
2572 0, 1000, 10, 10, "Number of photons to mix");
2573 uiDefButBitS(block
, TOG
, 1, B_REDR
, "Tune Photons",170,10,140,20, &G
.scene
->r
.GIdirect
,
2574 0, 0, 0, 0, "Show the photonmap directly in the render for tuning");
2581 /* yafray: global options panel */
2582 static void render_panel_yafrayGlobal()
2586 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_yafrayGlobal", UI_EMBOSS
, UI_HELV
, curarea
->win
);
2587 uiNewPanelTabbed("Render", "Render");
2588 if(uiNewPanel(curarea
, block
, "YafRay", "Render", 320, 0, 318, 204)==0) return;
2590 // label to force a boundbox for buttons not to be centered
2591 uiDefBut(block
, LABEL
, 0, " ", 305,180,10,10, 0, 0, 0, 0, 0, "");
2593 uiDefButBitS(block
, TOGN
, 1, B_REDR
, "xml", 5,180,75,20, &G
.scene
->r
.YFexportxml
,
2594 0, 0, 0, 0, "Export to an xml file and call yafray instead of plugin");
2596 uiDefButF(block
, NUMSLI
, B_DIFF
,"Bi ", 5,35,150,20, &(G
.scene
->r
.YF_raybias
),
2597 0.0, 10.0 ,0,0, "Shadow ray bias to avoid self shadowing");
2598 uiDefButI(block
, NUM
, B_DIFF
, "Raydepth ", 5,60,150,20,
2599 &G
.scene
->r
.YF_raydepth
, 1.0, 80.0, 10, 10, "Maximum render ray depth from the camera");
2600 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");
2601 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");
2603 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");
2606 uiDefButBitS(block
, TOGN
, 1, B_REDR
, "Auto AA", 5,140,150,20, &G
.scene
->r
.YF_AA
,
2607 0, 0, 0, 0, "Set AA using OSA and GI quality, disable for manual control");
2608 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.");
2609 if(G
.scene
->r
.YF_AA
){
2610 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)");
2611 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");
2612 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");
2613 uiDefButF(block
, NUMSLI
, B_DIFF
, "Thr ", 160,90,150,20, &G
.scene
->r
.YF_AAthreshold
, 0.000001, 1.0, 0, 0, "AA threshold");
2616 #endif /* disable yafray stuff */
2618 static void layer_copy_func(void *lay_v
, void *lay_p
)
2620 unsigned int *lay
= lay_p
;
2621 int laybit
= (int)lay_v
;
2623 if(G
.qual
& LR_SHIFTKEY
) {
2624 if(*lay
==0) *lay
= 1<<laybit
;
2629 copy_view3d_lock(REDRAW
);
2630 allqueue(REDRAWBUTSSCENE
, 0);
2633 static void delete_scene_layer_func(void *srl_v
, void *act_i
)
2635 if(BLI_countlist(&G
.scene
->r
.layers
)>1) {
2636 long act
= (long)act_i
;
2638 BLI_remlink(&G
.scene
->r
.layers
, srl_v
);
2640 G
.scene
->r
.actlay
= 0;
2642 if(G
.scene
->nodetree
) {
2644 for(node
= G
.scene
->nodetree
->nodes
.first
; node
; node
= node
->next
) {
2645 if(node
->type
==CMP_NODE_R_LAYERS
&& node
->id
==NULL
) {
2646 if(node
->custom1
==act
)
2648 else if(node
->custom1
>act
)
2653 allqueue(REDRAWBUTSSCENE
, 0);
2654 allqueue(REDRAWNODE
, 0);
2658 static void rename_scene_layer_func(void *srl_v
, void *unused_v
)
2660 if(G
.scene
->nodetree
) {
2661 SceneRenderLayer
*srl
= srl_v
;
2663 for(node
= G
.scene
->nodetree
->nodes
.first
; node
; node
= node
->next
) {
2664 if(node
->type
==CMP_NODE_R_LAYERS
&& node
->id
==NULL
) {
2665 if(node
->custom1
==G
.scene
->r
.actlay
)
2666 BLI_strncpy(node
->name
, srl
->name
, NODE_MAXSTR
);
2670 allqueue(REDRAWBUTSSCENE
, 0);
2671 allqueue(REDRAWOOPS
, 0);
2672 allqueue(REDRAWNODE
, 0);
2675 static char *scene_layer_menu(void)
2677 SceneRenderLayer
*srl
;
2678 int len
= 32 + 32*BLI_countlist(&G
.scene
->r
.layers
);
2680 char *str
= MEM_callocN(len
, "menu layers");
2682 strcpy(str
, "ADD NEW %x32767");
2684 for(nr
=0, srl
= G
.scene
->r
.layers
.first
; srl
; srl
= srl
->next
, nr
++) {
2685 if(srl
->layflag
& SCE_LAY_DISABLE
)
2686 a
+= sprintf(str
+a
, "|%s %%i%d %%x%d", srl
->name
, ICON_BLANK1
, nr
);
2688 a
+= sprintf(str
+a
, "|%s %%i%d %%x%d", srl
->name
, ICON_CHECKBOX_HLT
, nr
);
2694 static void draw_3d_layer_buttons(uiBlock
*block
, unsigned int *poin
, short xco
, short yco
, short dx
, short dy
)
2699 uiBlockBeginAlign(block
);
2700 for(a
=0; a
<5; a
++) {
2701 bt
= uiDefButBitI(block
, TOG
, 1<<a
, B_NOP
, "", (short)(xco
+a
*(dx
/2)), yco
+dy
/2, (short)(dx
/2), (short)(dy
/2), (int *)poin
, 0, 0, 0, 0, "");
2702 uiButSetFunc(bt
, layer_copy_func
, (void *)a
, poin
);
2704 for(a
=0; a
<5; a
++) {
2705 bt
=uiDefButBitI(block
, TOG
, 1<<(a
+10), B_NOP
, "", (short)(xco
+a
*(dx
/2)), yco
, (short)(dx
/2), (short)(dy
/2), (int *)poin
, 0, 0, 0, 0, "");
2706 uiButSetFunc(bt
, layer_copy_func
, (void *)(a
+10), poin
);
2710 uiBlockBeginAlign(block
);
2711 for(a
=5; a
<10; a
++) {
2712 bt
=uiDefButBitI(block
, TOG
, 1<<a
, B_NOP
, "", (short)(xco
+a
*(dx
/2)), yco
+dy
/2, (short)(dx
/2), (short)(dy
/2), (int *)poin
, 0, 0, 0, 0, "");
2713 uiButSetFunc(bt
, layer_copy_func
, (void *)a
, poin
);
2715 for(a
=5; a
<10; a
++) {
2716 bt
=uiDefButBitI(block
, TOG
, 1<<(a
+10), B_NOP
, "", (short)(xco
+a
*(dx
/2)), yco
, (short)(dx
/2), (short)(dy
/2), (int *)poin
, 0, 0, 0, 0, "");
2717 uiButSetFunc(bt
, layer_copy_func
, (void *)(a
+10), poin
);
2720 uiBlockEndAlign(block
);
2723 static void render_panel_layers(void)
2727 SceneRenderLayer
*srl
= BLI_findlink(&G
.scene
->r
.layers
, G
.scene
->r
.actlay
);
2731 G
.scene
->r
.actlay
= 0;
2732 srl
= G
.scene
->r
.layers
.first
;
2735 block
= uiNewBlock(&curarea
->uiblocks
, "render_panel_layers", UI_EMBOSS
, UI_HELV
, curarea
->win
);
2736 uiNewPanelTabbed("Output", "Render");
2737 if(uiNewPanel(curarea
, block
, "Render Layers", "Render", 320, 0, 318, 204)==0) return;
2739 /* first, as reminder, the scene layers */
2740 uiDefBut(block
, LABEL
, 0, "Scene:", 10,170,100,20, NULL
, 0, 0, 0, 0, "");
2741 draw_3d_layer_buttons(block
, &G
.scene
->lay
, 130, 170, 35, 30);
2743 /* layer disable, menu, name, delete button */
2744 uiBlockBeginAlign(block
);
2745 uiDefIconButBitI(block
, ICONTOGN
, SCE_LAY_DISABLE
, B_REDR
, ICON_CHECKBOX_HLT
-1, 10, 145, 20, 20, &srl
->layflag
, 0.0, 0.0, 0, 0, "Disable or enable this RenderLayer");
2746 strp
= scene_layer_menu();
2747 uiDefButS(block
, MENU
, B_ADD_RENDERLAYER
, strp
, 30,145,23,20, &(G
.scene
->r
.actlay
), 0, 0, 0, 0, "Choose Active Render Layer");
2750 /* name max 20, exr format limit... */
2751 bt
= uiDefBut(block
, TEX
, REDRAWNODE
, "", 53,145,172,20, srl
->name
, 0.0, 20.0, 0, 0, "");
2752 uiButSetFunc(bt
, rename_scene_layer_func
, srl
, NULL
);
2754 uiDefButBitS(block
, TOG
, R_SINGLE_LAYER
, B_NOP
, "Single", 230,145,60,20, &G
.scene
->r
.scemode
, 0, 0, 0, 0, "Only render this layer");
2755 bt
=uiDefIconBut(block
, BUT
, B_NOP
, ICON_X
, 285, 145, 25, 20, 0, 0, 0, 0, 0, "Deletes current Render Layer");
2756 uiButSetFunc(bt
, delete_scene_layer_func
, srl
, (void *)(long)G
.scene
->r
.actlay
);
2757 uiBlockEndAlign(block
);
2759 /* RenderLayer visible-layers */
2760 uiDefBut(block
, LABEL
, 0, "Layer:", 10,110,100,20, NULL
, 0, 0, 0, 0, "");
2761 draw_3d_layer_buttons(block
, &srl
->lay
, 130,110, 35, 30);
2763 uiBlockBeginAlign(block
);
2764 uiDefButBitI(block
, TOG
, SCE_LAY_ALL_Z
, B_NOP
,"AllZ", 10, 85, 40, 20, &srl
->layflag
, 0, 0, 0, 0, "Fill in Z values for all not-rendered faces, for masking");
2765 uiBlockBeginAlign(block
);
2766 uiDefButBitI(block
, TOG
, SCE_LAY_SOLID
, B_NOP
,"Solid", 50, 85, 60, 20, &srl
->layflag
, 0, 0, 0, 0, "Render Solid faces in this Layer");
2767 uiDefButBitI(block
, TOG
, SCE_LAY_HALO
, B_NOP
,"Halo", 110, 85, 55, 20, &srl
->layflag
, 0, 0, 0, 0, "Render Halos in this Layer (on top of Solid)");
2768 uiDefButBitI(block
, TOG
, SCE_LAY_ZTRA
, B_NOP
,"Ztra", 165, 85, 55, 20, &srl
->layflag
, 0, 0, 0, 0, "Render Z-Transparent faces in this Layer (On top of Solid and Halos)");
2769 uiDefButBitI(block
, TOG
, SCE_LAY_SKY
, B_NOP
,"Sky", 220, 85, 40, 20, &srl
->layflag
, 0, 0, 0, 0, "Render Sky or backbuffer in this Layer");
2770 uiDefButBitI(block
, TOG
, SCE_LAY_EDGE
, B_NOP
,"Edge", 260, 85, 50, 20, &srl
->layflag
, 0, 0, 0, 0, "Render Edge-enhance in this Layer (only works for Solid faces)");
2772 uiDefIDPoinBut(block
, test_grouppoin_but
, ID_GR
, B_SET_PASS
, "Light:", 10, 65, 150, 20, &(srl
->light_override
), "Name of Group to use as Lamps instead");
2773 uiDefIDPoinBut(block
, test_matpoin_but
, ID_MA
, B_SET_PASS
, "Mat:", 160, 65, 150, 20, &(srl
->mat_override
), "Name of Material to use as Materials instead");
2774 uiBlockEndAlign(block
);
2776 uiBlockBeginAlign(block
);
2777 uiDefButBitI(block
, TOG
, SCE_PASS_COMBINED
, B_SET_PASS
,"Combined", 10, 30, 45, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver full combined RGBA buffer");
2778 uiDefButBitI(block
, TOG
, SCE_PASS_Z
, B_SET_PASS
,"Z", 55, 30, 30, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Z values pass");
2779 uiDefButBitI(block
, TOG
, SCE_PASS_VECTOR
, B_SET_PASS
,"Vec", 85, 30, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Speed Vector pass");
2780 uiDefButBitI(block
, TOG
, SCE_PASS_NORMAL
, B_SET_PASS
,"Nor", 125, 30, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Normal pass");
2781 uiDefButBitI(block
, TOG
, SCE_PASS_UV
, B_SET_PASS
,"UV", 165, 30, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Texture UV pass");
2782 uiDefButBitI(block
, TOG
, SCE_PASS_INDEXOB
, B_SET_PASS
,"IndexOb",205, 30, 35, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Object Index pass");
2783 uiDefButBitI(block
, TOG
, SCE_PASS_INDEXMAT
, B_SET_PASS
,"IndexMat",250, 30, 35, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Material Index pass");
2784 uiDefButBitI(block
, TOG
, SCE_PASS_MIST
, B_SET_PASS
, "Mist", 275, 30, 35, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Mist factor pass (0-1)");
2786 uiDefButBitI(block
, TOG
, SCE_PASS_RGBA
, B_SET_PASS
,"Col", 10, 10, 35, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver shade-less Color pass");
2787 uiDefButBitI(block
, TOG
, SCE_PASS_DIFFUSE
, B_SET_PASS
,"Diff", 45, 10, 35, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Diffuse pass");
2788 uiDefButBitI(block
, BUT_TOGDUAL
, SCE_PASS_SPEC
, B_SET_PASS
,"Spec", 80, 10, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Specular pass");
2789 uiDefButBitI(block
, BUT_TOGDUAL
, SCE_PASS_SHADOW
, B_SET_PASS
,"Shad", 120, 10, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Shadow pass");
2790 uiDefButBitI(block
, BUT_TOGDUAL
, SCE_PASS_AO
, B_SET_PASS
,"AO", 160, 10, 30, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver AO pass");
2791 uiDefButBitI(block
, BUT_TOGDUAL
, SCE_PASS_REFLECT
, B_SET_PASS
,"Refl", 190, 10, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Raytraced Reflection pass");
2792 uiDefButBitI(block
, BUT_TOGDUAL
, SCE_PASS_REFRACT
, B_SET_PASS
,"Refr", 230, 10, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Raytraced Refraction pass");
2793 uiDefButBitI(block
, BUT_TOGDUAL
, SCE_PASS_RADIO
, B_SET_PASS
,"Rad", 270, 10, 40, 20, &srl
->passflag
, 0, 0, 0, 0, "Deliver Radiosity pass");
2796 void render_panels()
2799 render_panel_output();
2800 render_panel_layers();
2801 render_panel_render();
2802 render_panel_anim();
2803 render_panel_bake();
2805 render_panel_format();
2806 render_panel_plumiferos();
2808 if (G
.scene
->r
.imtype
== R_FFMPEG
) {
2809 render_panel_ffmpeg_video();
2810 render_panel_ffmpeg_audio();
2814 #ifndef DISABLE_YAFRAY
2815 /* yafray: GI & Global panel, only available when yafray enabled for rendering */
2816 if (G
.scene
->r
.renderer
==R_YAFRAY
) {
2817 if (G
.scene
->r
.YF_gamma
==0.0) G
.scene
->r
.YF_gamma
=1.0;
2818 if (G
.scene
->r
.YF_raybias
==0.0) G
.scene
->r
.YF_raybias
=0.001;
2819 if (G
.scene
->r
.YF_raydepth
==0) G
.scene
->r
.YF_raydepth
=5;
2820 if (G
.scene
->r
.YF_AApixelsize
==0.0) G
.scene
->r
.YF_AApixelsize
=1.5;
2821 if (G
.scene
->r
.YF_AAthreshold
==0.0) G
.scene
->r
.YF_AAthreshold
=0.05;
2822 if (G
.scene
->r
.GIpower
==0.0) G
.scene
->r
.GIpower
=1.0;
2823 if (G
.scene
->r
.GIindirpower
==0.0) G
.scene
->r
.GIindirpower
=1.0;
2824 render_panel_yafrayGlobal();
2825 render_panel_yafrayGI();
2831 /* --------------------------------------------- */
2837 block
= uiNewBlock(&curarea
->uiblocks
, "anim_panel", UI_EMBOSS
, UI_HELV
, curarea
->win
);
2838 if(uiNewPanel(curarea
, block
, "Anim", "Anim", 0, 0, 318, 204)==0) return;
2840 uiBlockBeginAlign(block
);
2841 uiDefButI(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");
2842 uiDefButI(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");
2844 uiBlockBeginAlign(block
);
2845 uiDefButS(block
, NUM
,B_FRAMEMAP
,"FPS:", 10,130,75,20, &G
.scene
->r
.frs_sec
, 1.0, 120.0, 100.0, 0, "Frames per second");
2846 uiDefButF(block
, NUM
,B_FRAMEMAP
,"/", 85,130,75,20, &G
.scene
->r
.frs_sec_base
, 1.0, 120.0, 0.1, 3, "Frames per second base");
2848 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");
2850 uiBlockBeginAlign(block
);
2851 uiDefButI(block
, NUM
,REDRAWALL
,"Sta:", 10,100,150,20,&G
.scene
->r
.sfra
,1.0,MAXFRAMEF
, 0, 0, "Specify the start frame of the animation");
2852 uiDefButI(block
, NUM
,REDRAWALL
,"End:", 160,100,150,20,&G
.scene
->r
.efra
,1.0,MAXFRAMEF
, 0, 0, "Specify the end frame of the animation");
2854 uiBlockBeginAlign(block
);
2855 uiDefButS(block
, NUM
, REDRAWTIME
, "Steps:",10, 70, 150, 20,&(G
.scene
->jumpframe
), 1, 100, 1, 100, "Set spacing between frames changes with up and down arrow keys");
2860 /* --------------------------------------------- */
2866 /* paranoia check */
2867 sound
= G
.buts
->lockpoin
;
2868 if(sound
&& GS(sound
->id
.name
)!=ID_SO
) {
2870 G
.buts
->lockpoin
= NULL
;
2873 sound_panel_sound(sound
);
2874 sound_panel_listener();
2875 sound_panel_sequencer();