[gnome-getting-started-docs] render into figures



commit ab8fd7f221530c089c9fe3a8a48b88aa0deb1dbe
Author: Jakub Steiner <jimmac gmail com>
Date:   Tue Oct 23 20:07:46 2012 +0200

    render into figures
    
    - make scripts external, so they are legible/tweakable for
      non-blender versed people
    - can't render at buildttime yet, because rendering scenes with
      multiplexed sound and music requires blender to be built with
      ffmpeg. But as transations are built during this time, there
      is no way around it. It needs to render during build time.
      I can only see this doable rendering into image frames and
      sequencing using some gstreamer pipeline. Or simply giving up
      on localized animations and relying on mallard titles only.

 animation/gnome-change-wallpaper.blend       |  Bin 1479616 -> 1478312 bytes
 animation/gnome-change-wallpaper.py          |   38 ++++++++++++++++++++
 animation/gnome-launching-applications.blend |  Bin 1682076 -> 1682440 bytes
 animation/gnome-launching-applications.py    |   49 ++++++++++++++++++++++++++
 animation/gnome-responding-to-messages.blend |  Bin 1626584 -> 1624820 bytes
 animation/gnome-responding-to-messages.py    |   47 ++++++++++++++++++++++++
 animation/gnome-yelp-intro.blend             |  Bin 1535080 -> 1533312 bytes
 animation/gnome-yelp-intro.py                |   48 +++++++++++++++++++++++++
 animation/render-localized.sh                |    3 +-
 animation/workaround.py                      |    4 --
 10 files changed, 184 insertions(+), 5 deletions(-)
---
diff --git a/animation/gnome-change-wallpaper.blend b/animation/gnome-change-wallpaper.blend
index e7313e3..bf660e4 100644
Binary files a/animation/gnome-change-wallpaper.blend and b/animation/gnome-change-wallpaper.blend differ
diff --git a/animation/gnome-change-wallpaper.py b/animation/gnome-change-wallpaper.py
new file mode 100644
index 0000000..e0985fd
--- /dev/null
+++ b/animation/gnome-change-wallpaper.py
@@ -0,0 +1,38 @@
+import bpy,os
+from xml.etree import ElementTree as ET
+
+def render(lang):
+  #bpy.context.scene.render.resolution_percentage =
+  #bpy.context.scene.render.use_compositing = 0
+  bpy.context.scene.render.use_sequencer = 1
+  renderpath = '../getting-started/'+lang+'/figures'
+  if (not renderpath):
+    os.mkdir(renderpath)
+  bpy.context.scene.render.filepath = "//" + renderpath + '/changing-wallpaper-'
+  if (not os.path.isfile(bpy.context.scene.render.frame_path())):
+    bpy.ops.render.render(animation=True)
+  else:
+    print('already rendered')
+
+#translates strings and calls render
+def main():
+  
+  t = {}
+  #unfortunately no decent fonts have â
+  langs = open('language-whitelist.txt').readlines()
+  for lang in langs:
+    lang = lang.strip()
+    xmlfile = ET.parse('../getting-started/' + lang + '/animation.xml')
+    t[lang] = xmlfile.getroot()
+  
+  for lang in t:
+    for textobj in t[lang].findall('t'):
+      if textobj.get('id') in bpy.data.objects: #prelozit jestli existuje jako index
+        bpy.data.objects[textobj.get('id')].data.body = textobj.text
+    bpy.data.objects['usermenuuser'].data.body = bpy.data.objects['user'].data.body #due to different alignment
+    render(lang)
+    
+if __name__ == '__main__':
+    #bpy.app.handlers.frame_change_pre.append(typewriteit)
+    main()
+    #bpy.app.handlers.frame_change_pre.pop(0)
diff --git a/animation/gnome-launching-applications.blend b/animation/gnome-launching-applications.blend
index aa3846d..7d3f8b3 100644
Binary files a/animation/gnome-launching-applications.blend and b/animation/gnome-launching-applications.blend differ
diff --git a/animation/gnome-launching-applications.py b/animation/gnome-launching-applications.py
new file mode 100644
index 0000000..96d2fd8
--- /dev/null
+++ b/animation/gnome-launching-applications.py
@@ -0,0 +1,49 @@
+import bpy,os
+from xml.etree import ElementTree as ET
+
+def typewriteit(scene):
+  #FIXME make this happen only in scene "launching apps - keyboard"
+  typewrite = bpy.data.objects['typewriter'].data.body
+  #psani zacina v sekvenci na 563
+  if bpy.context.scene.frame_current >= 563:
+    i = int((bpy.context.scene.frame_current-563)/3)
+  else:
+    i = 0
+  #print(typewrite, i, typewrite[:i])
+  bpy.data.objects['search'].data.body = typewrite[:i]
+
+def render(lang):
+  #bpy.context.scene.render.resolution_percentage =
+  #bpy.context.scene.render.use_compositing = 0
+  bpy.context.scene.render.use_sequencer = 1
+  renderpath = '../getting-started/'+lang+'/figures'
+  if (not renderpath):
+    os.mkdir(renderpath)
+  bpy.context.scene.render.filepath = "//" + renderpath + '/launching-apps-'
+  if (not os.path.isfile(bpy.context.scene.render.frame_path())):
+    bpy.ops.render.render(animation=True)
+  else:
+    print('already rendered')
+
+#translates strings and calls render
+def main():
+  global typewrite
+  
+  t = {}
+  #unfortunately no decent fonts have â
+  langs = open('language-whitelist.txt').readlines()
+  for lang in langs:
+    lang = lang.strip()
+    #t[lang] = yaml.load(open('translations/'+file))
+    xmlfile = ET.parse('../getting-started/' + lang + '/animation.xml')
+    t[lang] = xmlfile.getroot()
+    for textobj in t[lang].findall('t'):
+      if textobj.get('id') in bpy.data.objects: #prelozit jestli existuje jako index
+        bpy.data.objects[textobj.get('id')].data.body = textobj.text
+    bpy.data.objects['typewriter'].data.body = t[lang].find('t[ id="search"]').text
+    render(lang)
+    
+if __name__ == '__main__':
+    bpy.app.handlers.frame_change_pre.append(typewriteit)
+    main()
+    bpy.app.handlers.frame_change_pre.pop(0)
diff --git a/animation/gnome-responding-to-messages.blend b/animation/gnome-responding-to-messages.blend
index aba18d5..d4cf58d 100644
Binary files a/animation/gnome-responding-to-messages.blend and b/animation/gnome-responding-to-messages.blend differ
diff --git a/animation/gnome-responding-to-messages.py b/animation/gnome-responding-to-messages.py
new file mode 100644
index 0000000..189019f
--- /dev/null
+++ b/animation/gnome-responding-to-messages.py
@@ -0,0 +1,47 @@
+import bpy,os
+from xml.etree import ElementTree as ET
+
+def typewriteit(scene):
+  typewrite = bpy.data.objects['typewriter'].data.body
+  #psani zacina v sekvenci na 152
+  if bpy.context.scene.frame_current >= 152:
+    i = int((bpy.context.scene.frame_current-152)/3)
+  else:
+    i = 0
+  #print(typewrite, i, typewrite[:i])
+  bpy.data.objects['search'].data.body = typewrite[:i]
+
+def render(lang):
+  #bpy.context.scene.render.resolution_percentage =
+  #bpy.context.scene.render.use_compositing = 0
+  bpy.context.scene.render.use_sequencer = 1
+  renderpath = '../getting-started/'+lang+'/figures'
+  if (not renderpath):
+    os.mkdir(renderpath)
+  bpy.context.scene.render.filepath = "//" + renderpath + '/responding-to-messages-'
+  if (not os.path.isfile(bpy.context.scene.render.frame_path())):
+    bpy.ops.render.render(animation=True)
+  else:
+    print('already rendered')
+    
+#translates strings and calls render
+def main():
+  global typewrite
+  
+  t = {}
+  #unfortunately no decent fonts have â
+  langs = open('language-whitelist.txt').readlines()
+  for lang in langs:
+    lang = lang.strip()
+    xmlfile = ET.parse('../getting-started/' + lang + '/animation.xml')
+    t[lang] = xmlfile.getroot()
+    for textobj in t[lang].findall('t'):
+      if textobj.get('id') in bpy.data.objects: #prelozit jestli existuje jako index
+        bpy.data.objects[textobj.get('id')].data.body = textobj.text
+    bpy.data.objects['typewriter'].data.body = t[lang].find('t[ id="search"]').text
+    render(lang)
+    
+if __name__ == '__main__':
+    bpy.app.handlers.frame_change_pre.append(typewriteit)
+    main()
+    bpy.app.handlers.frame_change_pre.pop(0)
diff --git a/animation/gnome-yelp-intro.blend b/animation/gnome-yelp-intro.blend
index 37400a0..e40cfc6 100644
Binary files a/animation/gnome-yelp-intro.blend and b/animation/gnome-yelp-intro.blend differ
diff --git a/animation/gnome-yelp-intro.py b/animation/gnome-yelp-intro.py
new file mode 100644
index 0000000..cdcd8f1
--- /dev/null
+++ b/animation/gnome-yelp-intro.py
@@ -0,0 +1,48 @@
+import bpy,os
+from xml.etree import ElementTree as ET
+
+def render(lang):
+  #bpy.context.scene.render.resolution_percentage =
+  #bpy.context.scene.render.use_compositing = 0
+  bpy.context.scene.render.use_sequencer = 1
+  renderpath = '../getting-started/'+lang+'/figures'
+  if (not renderpath):
+    os.mkdir(renderpath)
+  bpy.context.scene.render.filepath = "//" + renderpath + '/yelp-intro'
+  if (not os.path.isfile(bpy.context.scene.render.frame_path())):
+    bpy.ops.render.render(animation=True)
+  else:
+    print('already rendered')
+    
+def typewriteit(scene):
+  #FIXME make this happen only in scene "launching apps - keyboard"
+  typewrite = bpy.data.objects['typewriter'].data.body
+  #psani zacina v sekvenci na 369
+  if bpy.context.scene.frame_current >= 369:
+    i = int((bpy.context.scene.frame_current-369)/3)
+  else:
+    i = 0
+  #print(typewrite, i, typewrite[:i])
+  bpy.data.objects['search'].data.body = typewrite[:i]
+
+#translates strings and calls render
+def main():
+  global typewrite
+  
+  t = {}
+  #unfortunately no decent fonts have â
+  langs = open('language-whitelist.txt').readlines()
+  for lang in langs:
+    lang = lang.strip()
+    xmlfile = ET.parse('../getting-started/' + lang + '/animation.xml')
+    t[lang] = xmlfile.getroot()
+    for textobj in t[lang].findall('t'):
+      if textobj.get('id') in bpy.data.objects: #prelozit jestli existuje jako index
+        bpy.data.objects[textobj.get('id')].data.body = textobj.text
+    bpy.data.objects['typewriter'].data.body = t[lang].find('t[ id="search"]').text
+    render(lang)
+    
+if __name__ == '__main__':
+    bpy.app.handlers.frame_change_pre.append(typewriteit)
+    main()
+    bpy.app.handlers.frame_change_pre.pop(0)
diff --git a/animation/render-localized.sh b/animation/render-localized.sh
index 6480807..f4be5b0 100755
--- a/animation/render-localized.sh
+++ b/animation/render-localized.sh
@@ -8,5 +8,6 @@ case $1 in
 esac
 
 for file in *blend
-  do $blender -b $file -P workaround.py
+  do script=`basename $file blend`py
+  $blender -b $file -P $script
 done



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]