[gnome-getting-started-docs/jenkins] move typewriter script to the .py



commit 8b897be5e7ebc26192cd76b51a76bae293af8112
Author: Jakub Steiner <jimmac gmail com>
Date:   Wed Sep 24 01:12:03 2014 +0200

    move typewriter script to the .py
    
    - rather than trying to get autoload modules working, just
      execute the script from the external python file.

 animation/gnome-launching-applications.blend |  Bin 1872676 -> 1869144 bytes
 animation/gnome-launching-applications.py    |   15 ++++++++++++++-
 animation/gnome-responding-to-messages.blend |  Bin 2738796 -> 2734844 bytes
 animation/gnome-responding-to-messages.py    |   26 +++++++++++++++++++++++++-
 animation/gnome-task-switching.blend         |  Bin 3063476 -> 3060760 bytes
 animation/gnome-task-switching.py            |   20 +++++++++++++++++++-
 6 files changed, 58 insertions(+), 3 deletions(-)
---
diff --git a/animation/gnome-launching-applications.blend b/animation/gnome-launching-applications.blend
index 38192c7..9d9a655 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
index 7225e62..db243dc 100644
--- a/animation/gnome-launching-applications.py
+++ b/animation/gnome-launching-applications.py
@@ -1,5 +1,17 @@
 import bpy,os,re,gnomerender
 from xml.etree import ElementTree as ET
+#from bpy.app.handlers import persistent
+
+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 630
+  if bpy.context.scene.frame_current >= 630:
+    i = int((bpy.context.scene.frame_current- 630)/3)
+  else:
+    i = 0
+  #print(typewrite, i, typewrite[:i])
+  bpy.data.objects['search'].data.body = typewrite[:i]
 
 def main():
   global typewrite
@@ -24,6 +36,7 @@ def main():
       gnomerender.transcode(lang)
     
 if __name__ == '__main__':
-    main()
+  bpy.app.handlers.frame_change_pre.append(typewriteit)
+  main()
 
 # vim: tabstop=2 expandtab
diff --git a/animation/gnome-responding-to-messages.blend b/animation/gnome-responding-to-messages.blend
index 10a7c52..e6a16de 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
index 95b4faf..a9c8d45 100644
--- a/animation/gnome-responding-to-messages.py
+++ b/animation/gnome-responding-to-messages.py
@@ -1,6 +1,29 @@
 import bpy,os,re,gnomerender
 from xml.etree import ElementTree as ET
 
+def typewriteit(scene):
+  typewrite = bpy.data.objects['typewriter'].data.body
+  typewrite2 = bpy.data.objects['typewriter2'].data.body
+  typewrite3 = bpy.data.objects['typewriter3'].data.body
+  #psani zacina v sekvenci na 152
+  if bpy.context.scene.frame_current >= 152:
+    i = int((bpy.context.scene.frame_current-152)/2)
+  else:
+    i = 0
+  if bpy.context.scene.frame_current >= 640:
+    j = int((bpy.context.scene.frame_current-640)/2)
+  else:
+    j = 0
+  if bpy.context.scene.frame_current >= 1024:
+    k = int((bpy.context.scene.frame_current-1024)/2)
+    #print(k,typewrite3)
+  else:
+    k = 0
+  #print(typewrite, i, typewrite[:i])
+  bpy.data.objects['bubble.response'].data.body = typewrite[:i]
+  bpy.data.objects['bubble.response2'].data.body = typewrite2[:j]
+  bpy.data.objects['bubble.response3'].data.body = typewrite3[:k]
+
 def main():
   
   t = {}
@@ -24,6 +47,7 @@ def main():
       gnomerender.transcode(lang)
     
 if __name__ == '__main__':
-    main()
+  bpy.app.handlers.frame_change_pre.append(typewriteit)
+  main()
 
 # vim: tabstop=2 expandtab
diff --git a/animation/gnome-task-switching.blend b/animation/gnome-task-switching.blend
index 1c66523..8abc852 100644
Binary files a/animation/gnome-task-switching.blend and b/animation/gnome-task-switching.blend differ
diff --git a/animation/gnome-task-switching.py b/animation/gnome-task-switching.py
index 7eeaa2c..6ea164d 100644
--- a/animation/gnome-task-switching.py
+++ b/animation/gnome-task-switching.py
@@ -1,5 +1,21 @@
 import bpy,os,re,gnomerender
 from xml.etree import ElementTree as ET
+from bpy.app.handlers import persistent
+
+#changes the text in the searchbox (called before every frame change)
+#to unassign: bpy.app.handlers.frame_change_pre.pop(0)
+
+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 618
+    if bpy.context.scene.frame_current >= 915:
+        i = int((bpy.context.scene.frame_current-915)/3)
+    else:
+        i = 0
+    #print(typewrite, i, typewrite[:i])
+    bpy.data.objects['search2'].data.body = typewrite[:i]
+
 
 def main():
   
@@ -22,6 +38,8 @@ def main():
       gnomerender.transcode(lang)
     
 if __name__ == '__main__':
-    main()
+  bpy.app.handlers.frame_change_pre.append(typewriteit)
+  #bpy.app.handlers.frame_change_pre.pop(0)
+  main()
 
 # vim: tabstop=2 expandtab


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