Adding Framerate preset patch by Troy Sobotka (sobotka). Small change to
authorDaniel Salazar <zanqdo@gmail.com>
Tue, 25 Jan 2011 18:30:31 +0000 (18:30 +0000)
committerDaniel Salazar <zanqdo@gmail.com>
Tue, 25 Jan 2011 18:30:31 +0000 (18:30 +0000)
make Frame Old / Frame New remapping settings always visible as they
aren't really a part of framerate settings

release/scripts/presets/framerate/23.98.py [new file with mode: 0644]
release/scripts/presets/framerate/24.py [new file with mode: 0644]
release/scripts/presets/framerate/25.py [new file with mode: 0644]
release/scripts/presets/framerate/29.97.py [new file with mode: 0644]
release/scripts/presets/framerate/30.py [new file with mode: 0644]
release/scripts/presets/framerate/50.py [new file with mode: 0644]
release/scripts/presets/framerate/59.94.py [new file with mode: 0644]
release/scripts/presets/framerate/60.py [new file with mode: 0644]
release/scripts/presets/framerate/Custom.py [new file with mode: 0644]
release/scripts/ui/properties_render.py

diff --git a/release/scripts/presets/framerate/23.98.py b/release/scripts/presets/framerate/23.98.py
new file mode 100644 (file)
index 0000000..498a518
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 24
+bpy.context.scene.render.fps_base = 1.001
diff --git a/release/scripts/presets/framerate/24.py b/release/scripts/presets/framerate/24.py
new file mode 100644 (file)
index 0000000..6fcdcb1
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 24
+bpy.context.scene.render.fps_base = 1
diff --git a/release/scripts/presets/framerate/25.py b/release/scripts/presets/framerate/25.py
new file mode 100644 (file)
index 0000000..2097391
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 25
+bpy.context.scene.render.fps_base = 1
diff --git a/release/scripts/presets/framerate/29.97.py b/release/scripts/presets/framerate/29.97.py
new file mode 100644 (file)
index 0000000..8f7ad67
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 30
+bpy.context.scene.render.fps_base = 1.001
diff --git a/release/scripts/presets/framerate/30.py b/release/scripts/presets/framerate/30.py
new file mode 100644 (file)
index 0000000..bc83df1
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 30
+bpy.context.scene.render.fps_base = 1
diff --git a/release/scripts/presets/framerate/50.py b/release/scripts/presets/framerate/50.py
new file mode 100644 (file)
index 0000000..08dfaa8
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 50
+bpy.context.scene.render.fps_base = 1
diff --git a/release/scripts/presets/framerate/59.94.py b/release/scripts/presets/framerate/59.94.py
new file mode 100644 (file)
index 0000000..5c44841
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 60
+bpy.context.scene.render.fps_base = 1.001
diff --git a/release/scripts/presets/framerate/60.py b/release/scripts/presets/framerate/60.py
new file mode 100644 (file)
index 0000000..30f2db7
--- /dev/null
@@ -0,0 +1,3 @@
+import bpy
+bpy.context.scene.render.fps = 60
+bpy.context.scene.render.fps_base = 1
diff --git a/release/scripts/presets/framerate/Custom.py b/release/scripts/presets/framerate/Custom.py
new file mode 100644 (file)
index 0000000..001d19a
--- /dev/null
@@ -0,0 +1 @@
+import bpy
index ed25fc1b0e73de427b68cb79e94b79ee72515cef..4851034e875d8fb105191650b7489b51af6a3995 100644 (file)
@@ -34,6 +34,13 @@ class RENDER_MT_ffmpeg_presets(bpy.types.Menu):
     draw = bpy.types.Menu.draw_preset
 
 
+class RENDER_MT_framerate_presets(bpy.types.Menu):
+    bl_label = "Frame Rate Presets"
+    preset_subdir = "framerate"
+    preset_operator = "script.execute_preset"
+    draw = bpy.types.Menu.draw_preset
+    
+    
 class RenderButtonsPanel():
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
@@ -555,8 +562,27 @@ class RENDER_PT_dimensions(RenderButtonsPanel, bpy.types.Panel):
         sub.prop(scene, "frame_step", text="Step")
 
         sub.label(text="Frame Rate:")
-        sub.prop(rd, "fps")
-        sub.prop(rd, "fps_base", text="/")
+        if rd.fps_base == 1:
+            fps_rate = round(rd.fps / rd.fps_base)
+        else:
+            fps_rate = round(rd.fps / rd.fps_base, 2)
+        
+        # TODO: Change the following to iterate over existing presets
+        if (fps_rate in (23.98, 24, 25, 29.97, 30, 50, 59.94, 60)):
+            custom_framerate = False
+        else:
+            custom_framerate = True
+        
+        if custom_framerate == True:
+            fps_label_text = "Custom (" + str(fps_rate) + " fps)"
+        else:
+            fps_label_text = str(fps_rate) + " fps"
+            
+        sub.menu("RENDER_MT_framerate_presets", text=fps_label_text)
+        
+        if (bpy.types.RENDER_MT_framerate_presets.bl_label == "Custom") or (custom_framerate == True):
+            sub.prop(rd, "fps")
+            sub.prop(rd, "fps_base", text="/")
         subrow = sub.row(align=True)
         subrow.prop(rd, "frame_map_old", text="Old")
         subrow.prop(rd, "frame_map_new", text="New")