diff options
author | Peter Schlaile <peter@schlaile.de> | 2007-10-21 19:42:08 +0400 |
---|---|---|
committer | Peter Schlaile <peter@schlaile.de> | 2007-10-21 19:42:08 +0400 |
commit | a0390e5cc340febece6e2a7e61085033d79742e2 (patch) | |
tree | 5d0e89c54603641f394b95b0e76ee917d15a727d /source/blender/src/buttons_scene.c | |
parent | bacfc9eb91f10871a2ba9c3b35e48c3895dffac3 (diff) |
== Core ==
This adds fractional FPS support to blender and should finally
make NTSC work correctly.
NTSC has an FPS of 30.0/1.001 which is approximately 29.97 FPS.
Therefore, it is not enough to simply make frs_sec a float, since
you can't represent this accurately enough.
I added a seperate variable frs_sec_base and FPS is now
frs_sec / frs_sec_base.
I changed all the places, where frs_sec was used to my best knowledge.
For convenience sake, I added several macros, that should make life
easier in the future:
FRA2TIME(a) : convert frame number to a double precision time in seconds
TIME2FRA(a) : the same in the opposite direction
FPS : return current FPS as a double precision number
(last resort)
This closes bug #6715
Standard framerates not supported / breaks sync -- 23.967 29.967 etc.
https://projects.blender.org/tracker/?func=detail&aid=6715&group_id=9&atid=125
Please give this heavy testing with NTSC files, quicktime in/export
and the python interface.
Errors are most probably only spotted on longer timelines, so that is
also important.
The patch was tested by Troy Sobotka and me, so it most probably should
work out of the box, but wider testing is important, since errors are
very subtle.
Enjoy!
Diffstat (limited to 'source/blender/src/buttons_scene.c')
-rw-r--r-- | source/blender/src/buttons_scene.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 30bac4ea74c..d61268b2064 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -612,6 +612,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 51; G.scene->r.size= 100; G.scene->r.frs_sec= 25; + G.scene->r.frs_sec_base= 1; G.scene->r.mode &= ~R_PANORAMA; G.scene->r.xparts= G.scene->r.yparts= 4; #ifdef WITH_FFMPEG @@ -718,6 +719,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 45; G.scene->r.size= 100; G.scene->r.frs_sec= 25; + G.scene->r.frs_sec_base= 1; G.scene->r.mode &= ~R_PANORAMA; G.scene->r.xparts= G.scene->r.yparts= 4; #ifdef WITH_FFMPEG @@ -780,6 +782,7 @@ void do_render_panels(unsigned short event) G.scene->r.yasp= 11; G.scene->r.size= 100; G.scene->r.frs_sec= 30; + G.scene->r.frs_sec_base = 1.001; G.scene->r.mode &= ~R_PANORAMA; G.scene->r.xparts= G.scene->r.yparts= 2; #ifdef WITH_FFMPEG @@ -1641,7 +1644,7 @@ static void render_panel_format(void) uiDefBut(block, LABEL, 0, "Codec: not set", 892,yofs+44,225,20, 0, 0, 0, 0, 0, ""); else uiDefBut(block, LABEL, 0, G.scene->r.qtcodecdata->qtcodecname, 892,yofs+44,225,20, 0, 0, 0, 0, 0, ""); - uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime"); + uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,74,20, 0, 0, 0, 0, 0, "Set codec settings for Quicktime"); #endif #endif /* WITH_QUICKTIME */ } else { @@ -1653,7 +1656,7 @@ static void render_panel_format(void) else uiDefBut(block, LABEL, 0, avicodec_str(), 892,yofs+43,225,20, 0, 0, 0, 0, 0, ""); #endif - uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,112,20, 0, 0, 0, 0, 0, "Set codec settings for AVI"); + uiDefBut(block, BUT,B_SELECTCODEC, "Set codec", 892,yofs,74,20, 0, 0, 0, 0, 0, "Set codec settings for AVI"); } #ifdef WITH_OPENEXR } @@ -1668,15 +1671,16 @@ static void render_panel_format(void) 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"); } uiDefButS(block, MENU,B_NOP, "Codec %t|None %x0|Pxr24 (lossy) %x1|ZIP (lossless) %x2|PIZ (lossless) %x3|RLE (lossless) %x4", - 892,yofs,112,20, &G.scene->r.quality, 0, 0, 0, 0, "Set codec settings for OpenEXR"); + 892,yofs,74,20, &G.scene->r.quality, 0, 0, 0, 0, "Set codec settings for OpenEXR"); #endif } else { if(G.scene->r.quality < 5) G.scene->r.quality = 90; /* restore from openexr */ - uiDefButS(block, NUM,B_DIFF, "Quality:", 892,yofs,112,20, &G.scene->r.quality, 10.0, 100.0, 0, 0, "Quality setting for JPEG images, AVI Jpeg and SGI movies"); + 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"); } - uiDefButS(block, NUM,B_FRAMEMAP,"Frs/sec:", 1006,yofs,113,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second"); + 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"); + 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"); uiBlockBeginAlign(block); @@ -2027,7 +2031,9 @@ void anim_panels() 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"); uiBlockBeginAlign(block); - uiDefButS(block, NUM,B_FRAMEMAP,"Frs/sec:", 10,130,150,20, &G.scene->r.frs_sec, 1.0, 120.0, 100.0, 0, "Frames per second"); + 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"); + 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"); + 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"); uiBlockBeginAlign(block); |