[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11163] branches/imgbrowser-elubie/release /scripts: Some render presets to go in by default

Matt Ebb matt at mke3.net
Wed Jul 4 03:15:21 CEST 2007


Revision: 11163
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11163
Author:   broken
Date:     2007-07-04 03:15:20 +0200 (Wed, 04 Jul 2007)

Log Message:
-----------
Some render presets to go in by default

Added Paths:
-----------
    branches/imgbrowser-elubie/release/scripts/pre_rdim_NTSC.py
    branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL.py
    branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL169.py
    branches/imgbrowser-elubie/release/scripts/pre_rdim_a3.py
    branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv108024p.py
    branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv72030p.py
    branches/imgbrowser-elubie/release/scripts/pre_rdim_save.py

Added: branches/imgbrowser-elubie/release/scripts/pre_rdim_NTSC.py
===================================================================
--- branches/imgbrowser-elubie/release/scripts/pre_rdim_NTSC.py	                        (rev 0)
+++ branches/imgbrowser-elubie/release/scripts/pre_rdim_NTSC.py	2007-07-04 01:15:20 UTC (rev 11163)
@@ -0,0 +1,40 @@
+#!BPY
+
+# """
+# Name: 'NTSC'
+# Blender: 232
+# Group: 'PresetRDimensions'
+# Tooltip: 'Set a new render dimensions preset'
+# """
+
+__author__ = "????"
+__version__ = "1.0"
+__url__ = [""]
+__bpydoc__ = """\
+You can edit this section to write something about your script that can
+be read then with the Scripts Help Browser script in Blender.
+
+Remember to also set author, version and possibly url(s) above.  You can also
+define an __email__ tag, check some bundled script's source for examples.
+"""
+
+# This script was automatically generated by the pre_rdim_save.py bpython script.
+# By default, these generated scripts are released as Public Domain, but you
+# are free to change the license of the scripts you generate with
+# save_theme.py before releasing them.
+
+import Blender
+from Blender import Scene
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+context.imageSizeX(720)
+context.imageSizeY(480)
+
+context.aspectRatioX(10)
+context.aspectRatioY(11)
+
+context.framesPerSec(30)
+
+context.enableOddFieldFirst(0)
\ No newline at end of file

Added: branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL.py
===================================================================
--- branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL.py	                        (rev 0)
+++ branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL.py	2007-07-04 01:15:20 UTC (rev 11163)
@@ -0,0 +1,40 @@
+#!BPY
+
+# """
+# Name: 'PAL'
+# Blender: 232
+# Group: 'PresetRDimensions'
+# Tooltip: 'Set a new render dimensions preset'
+# """
+
+__author__ = "????"
+__version__ = "1.0"
+__url__ = [""]
+__bpydoc__ = """\
+You can edit this section to write something about your script that can
+be read then with the Scripts Help Browser script in Blender.
+
+Remember to also set author, version and possibly url(s) above.  You can also
+define an __email__ tag, check some bundled script's source for examples.
+"""
+
+# This script was automatically generated by the pre_rdim_save.py bpython script.
+# By default, these generated scripts are released as Public Domain, but you
+# are free to change the license of the scripts you generate with
+# save_theme.py before releasing them.
+
+import Blender
+from Blender import Scene
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+context.imageSizeX(720)
+context.imageSizeY(576)
+
+context.aspectRatioX(54)
+context.aspectRatioY(51)
+
+context.framesPerSec(25)
+
+context.enableOddFieldFirst(0)

Added: branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL169.py
===================================================================
--- branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL169.py	                        (rev 0)
+++ branches/imgbrowser-elubie/release/scripts/pre_rdim_PAL169.py	2007-07-04 01:15:20 UTC (rev 11163)
@@ -0,0 +1,25 @@
+#!BPY
+"""
+Name: 'PAL 16:9'
+Blender: 232
+Group: 'PresetRDimensions'
+Tooltip: ''
+"""
+
+# Render dimensions preset: PAL 16:9
+
+import Blender
+from Blender import Scene
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+context.imageSizeX(720)
+context.imageSizeY(576)
+
+context.aspectRatioX(64)
+context.aspectRatioY(45)
+
+context.framesPerSec(25)
+
+context.enableOddFieldFirst(0)
\ No newline at end of file

Added: branches/imgbrowser-elubie/release/scripts/pre_rdim_a3.py
===================================================================
--- branches/imgbrowser-elubie/release/scripts/pre_rdim_a3.py	                        (rev 0)
+++ branches/imgbrowser-elubie/release/scripts/pre_rdim_a3.py	2007-07-04 01:15:20 UTC (rev 11163)
@@ -0,0 +1,24 @@
+#!BPY
+"""
+Name: 'A3 300dpi'
+Blender: 232
+Group: 'PresetRDimensions'
+Tooltip: ''
+"""
+
+# Render dimensions preset: A3 @ 300dpi
+
+import Blender
+from Blender import Scene
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+context.imageSizeX(3508)
+context.imageSizeY(4961)
+
+context.aspectRatioX(1)
+context.aspectRatioY(1)
+context.enableRGBColor()
+
+context.enableFieldRendering(0)
\ No newline at end of file

Added: branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv108024p.py
===================================================================
--- branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv108024p.py	                        (rev 0)
+++ branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv108024p.py	2007-07-04 01:15:20 UTC (rev 11163)
@@ -0,0 +1,25 @@
+#!BPY
+"""
+Name: 'HDTV 1080/24p'
+Blender: 232
+Group: 'PresetRDimensions'
+Tooltip: ''
+"""
+
+# Render dimensions preset: HDTV 1080/24p
+
+import Blender
+from Blender import Scene
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+context.imageSizeX(1920)
+context.imageSizeY(1080)
+
+context.framesPerSec(24)
+
+context.aspectRatioX(1)
+context.aspectRatioY(1)
+
+context.enableFieldRendering(0)
\ No newline at end of file

Added: branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv72030p.py
===================================================================
--- branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv72030p.py	                        (rev 0)
+++ branches/imgbrowser-elubie/release/scripts/pre_rdim_hdtv72030p.py	2007-07-04 01:15:20 UTC (rev 11163)
@@ -0,0 +1,25 @@
+#!BPY
+"""
+Name: 'HDTV 720/30p'
+Blender: 232
+Group: 'PresetRDimensions'
+Tooltip: ''
+"""
+
+# Render dimensions preset: HDTV 1080/24p
+
+import Blender
+from Blender import Scene
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+context.imageSizeX(1280)
+context.imageSizeY(720)
+
+context.framesPerSec(30)
+
+context.aspectRatioX(1)
+context.aspectRatioY(1)
+
+context.enableFieldRendering(0)
\ No newline at end of file

Added: branches/imgbrowser-elubie/release/scripts/pre_rdim_save.py
===================================================================
--- branches/imgbrowser-elubie/release/scripts/pre_rdim_save.py	                        (rev 0)
+++ branches/imgbrowser-elubie/release/scripts/pre_rdim_save.py	2007-07-04 01:15:20 UTC (rev 11163)
@@ -0,0 +1,131 @@
+#!BPY
+
+"""
+Name: 'Save Preset...'
+Blender: 234
+Group: 'PresetRDimensions'
+Tooltip: 'Save current preset as a bpython script'
+"""
+
+__author__ = "Willian Padovani Germano & Matt Ebb"
+__url__ = ("blender")
+__version__ = "1.0 09/12/04"
+
+__bpydoc__ = """\
+This script saves the current render dimensions (Dimensions panel in Blender) 
+as a Blender Python script.
+
+Usage:
+This script gets automatically run, using the 'Save Preset...' option in the presets menu.
+It saves the data in a bpython script, meaning that you can simply run it to load the
+preset. It should then be automatically loaded into the presets menu so you can simply
+choose it from the list, by the name that you saved it as.
+
+To appear in the menu, a theme saved with this script must be put in your
+Blender's scripts dir, that's what happens by default when you save one by
+yourself.  If you don't know where this dir is, running
+
+import Blender<br>print Blender.Get("scriptsdir")
+
+on the Text Editor window (use menu or ALT+P to run it) will write the path on
+the console.
+
+Remember to edit your exported theme's source file to put your name and
+some information on it before sharing it with others.
+"""
+
+# $Id: pre_rdim_save.py,v 1.1 2005/01/07 15:10:03 broken Exp $
+#
+# --------------------------------------------------------------------------
+# save_theme version 2.34 Sep 20, 2004
+# Copyright (C) 2004: Willian P. Germano, wgermano _at_ ig.com.br
+# --------------------------------------------------------------------------
+# Released under the Blender Artistic License (BAL):
+#   http://download.blender.org/documentation/html/x21254.html
+#
+# The scripts generated by this script are put under Public Domain by
+# default, but you are free to edit the ones you generate with this script
+# and change their license to another one of your choice.
+# --------------------------------------------------------------------------
+
+import Blender
+from Blender import Scene, Draw
+from Blender.Window import FileSelector
+from types import *
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+# default filename: theme's name + '_theme.py' in user's scripts dir:
+default_presetnamebasic = str(context.imageSizeX()) + 'x' + str(context.imageSizeY())
+default_presetname = Blender.Draw.PupStrInput("Name:", default_presetnamebasic, 32)
+if default_presetname == None:
+	default_presetname = default_presetnamebasic
+else:
+	# remove quote marks from the name string (used for both filename and bpymenu 'Name' field)
+	default_presetname = default_presetname.replace("""'""",'')
+	
+default_fname = Blender.Get("scriptsdir")
+default_fname = Blender.sys.join(default_fname, 'pre_rdim_' + default_presetname + '.py')
+default_fname = default_fname.replace(' ','_')
+
+def write_preset(filename):
+	"Write the current preset as a bpython script"
+
+	if filename.find('.py', -3) <= 0: filename += '.py'
+
+	fout = file(filename, "w")
+
+	fout.write("""#!BPY
+
+# \"\"\"
+# Name: '%s'
+# Blender: 232
+# Group: 'PresetRDimensions'
+# Tooltip: 'Set a new render dimensions preset'
+# \"\"\"
+
+__%s__ = "????"
+__%s__ = "1.0"
+__%s__ = [""]
+__%s__ = \"\"\"\\
+You can edit this section to write something about your script that can
+be read then with the Scripts Help Browser script in Blender.
+
+Remember to also set author, version and possibly url(s) above.  You can also
+define an __email__ tag, check some bundled script's source for examples.
+\"\"\"
+
+# This script was automatically generated by the pre_rdim_save.py bpython script.
+# By default, these generated scripts are released as Public Domain, but you
+# are free to change the license of the scripts you generate with
+# save_theme.py before releasing them.
+
+import Blender
+from Blender import Scene
+
+scn = Scene.GetCurrent()
+context = scn.getRenderingContext()
+
+""" % (default_presetname, "author", "version", "url", "bpydoc"))
+
+	# We do these one by one, since we don't want to save the complete renderdata,
+	# just the relevant ones to render dimensions
+	
+	fout.write("context.imageSizeX(%s)\n" % (context.imageSizeX()))

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list