Fixes timecode to run frames 0 to (fps-1) rather than 1 to fps
authorJohnny Matthews <johnny.matthews@gmail.com>
Fri, 15 Apr 2005 13:38:27 +0000 (13:38 +0000)
committerJohnny Matthews <johnny.matthews@gmail.com>
Fri, 15 Apr 2005 13:38:27 +0000 (13:38 +0000)
source/blender/python/api2_2x/sceneRender.c

index ddb2b1dcd9289e909fce24f72500e39d394bfe78..2db70d089bd81427c9f44ce40a2737f9354cd767 100644 (file)
@@ -2037,13 +2037,11 @@ PyObject *RenderData_getTimeCode( BPy_RenderData * self){
     int hi,mi,si,fi,hold,fps,cfa;
     
     fps = self->renderContext->frs_sec;
-    cfa = self->renderContext->cfra;
-    fi =  self->renderContext->cfra % fps;
-    if(fi == 0)
-        fi = fps;
+    cfa = self->renderContext->cfra-1;
+    fi =  cfa % fps;
                    
-    hi   = (cfa - 1) / (fps*60*60);
-    hold = (cfa - 1) % (fps*60*60);     
+    hi   = (cfa) / (fps*60*60);
+    hold = (cfa) % (fps*60*60);     
     mi   = hold / (fps*60);
     hold = hold % (fps*60);
     si   = hold / fps;