Blender: python script to import text

Project:Explaining exponential growth
Component:Blender
Category:feature request
Priority:normal
Assigned:Unassigned
Status:active
Project wiki:Explaining exponential growth
Description

The main advantage of remaking the video Are Human smarter than Yeast is to have the source allowing for easier translations of the whole video (audio and video).

The video will be remade with Blender, but we unfortunately, Blender has troubles handling certain fonts.
(See: #407: Blender and Asian fonts , #406: Blender bug: dead keys not working).

The ideal would be to have a python script importing the actual text into the blender text objects. The script could set the font and could much more easily select the proper characters for Chinese.
Also, we'd have a single text file for people to translate the video. Once the text file is translated into another language, we'd have to do minor modifications to the .blender file and re-animate the video in that language.

Comments

#1

I don't know much python and I know even less the Blender API.
Maybe I can start to learn from this example:
http://blenderartists.org/forum/showthread?t=41752
How do I change cameras during an animation?

import Blender
from Blender import *

def CheckCam():
        frame = Blender.Get("curframe")
        if (frame<=335 and frame >=1):
                Scene.getCurrent().setCurrentCamera(Object.Get("Camera01"))

        if (frame>=336):
                Scene.getCurrent().setCurrentCamera(Object.Get("Camera02"))

CheckCam()

#3

When using the 'print' command, where is the information actually printed?
I tried the command line mode, but to no avail:

/blender/my-tests/text-script$ blender -b text-script.blend -P Text.001

#4

#3 is ok. I used the wrong file name. Information is printed in the console.

#5

There is a possible volunteer to translate the video in Hebrew: #427: Translate script in Hebrew
Hebrew is a right-to-left script which compounds the problem with having text objects within blender.

A much easier solution could be using mask images for mapping textures on simple plane objects: #426: Use image mapping for text.

Post new comment

Edit issue settings
Note: changing any of these items will update the issue's overall values.
active
Use this field if you want to associate this issue to a specific wiki page. Enter the title of the wiki page. You can enter a comma separated list of nodes.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • Allowed HTML tags: <a> <blockquote> <br> <em> <img> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2><h3><h4><h5><h6> <pre> <table> <th> <td> <tr>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.
  • Project issue numbers (ex. [#12345]) turn into links automatically.
  • Use [toc list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;] to insert a mediawiki style collapsible table of contents. All the arguments are optional.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.