It’s been a great week here since Pablo arrived and has been doing amazing work shading Gilga’s hair with cycles- can’t wait to show his results. This weekend, we took some downtime, hanging out and blending at the Haymarket Cafe. Famed Gnome designer Jakub Steiner was lamenting the lack of an easy way (there is of course, a difficult way) to make a quick ‘typing’ effect for Blender text objects. I thought it would be a fun hack so I made this addon.

Grab it from gitlab

  1. Nice job Bassam! Something simple but immediately usable. It might be also nice to script the positioning of an empty to the right of the last visible character. That way users could attach a blinking cursor or some other appropriate object based on the context of the project. Cheers.

  2. might actually be possible, if I can use/get the dimensions of the text and put the empty on the bottom right corner (assuming left to right text). I have no access to the individual characters as far as I can tell.

  3. Name :

    A big salute to you Bassam

  4. Hi Bassam,
    It didn´t work on my mashine and I don´t know why.
    Here the console output:
    fake_module: addon missing ‘bl_info’ gives bad performance!: ‘C:\\Users\\Webels\
    \AppData\\Roaming\\Blender Foundation\\Blender\\2.65\\scripts\\addons\\typewrite
    r_text.py’
    event has invalid window
    File “\type.py”, line 20
    import bpy
    ^
    IndentationError: unexpected indent

    location: :-1

    location: :-1
    Error: File “\type.py”, line 20
    import bpy
    ^
    IndentationError: unexpected indent

    location: :-1

    Error: Python script fail, look in the console for now…

    File “\type.py”, line 20
    import bpy
    ^
    IndentationError: unexpected indent

    location: :-1

    location: :-1
    Error: File “\type.py”, line 20
    import bpy
    ^
    IndentationError: unexpected indent

    location: :-1

    Error: Python script fail, look in the console for now…

    Can you tell me why ? Blender Version 2.65 R53189

    thanks a lot …
    regards Willi …

  5. from the error you don’t have the file copied correctly, try redownloading – press the copy button in pasteall, paste it into a text editor, and save again.
    bl_info is in the addon, so that is a clue, and there is no indent infront of import bpy – another clue that the download went wrong.

  6. Hi Bassam,

    Thanks a lot for your replay.
    Yes you´re right. It was and copy and paste mistake.
    Now it´s working. Great job 😉
    regards Willi …

  7. Wow man. This is an awesome add-on. Thank you so much. I hope it gets added to the standard distribution.

    Right now I’m trying to figure out how to get a character count from the source text and display the number in the add-on UI to make animating to the end of the text faster.

    Anyway: I can get a string length of an example text file in Blender “t1” like so:

    len(bpy.data.texts[‘t1’].as_string())

    My next step is to figure out how to get it to point at the currently selected object’s source_text (still working out Blender’s object organization structure). And then I need to figure out how to get stuff to chow up in the UI.

    *If this seems like a good idea to you, go right ahead and steal it. 😉 In the mean time, I’ll keep plugging along and I’ll let you know if I am successful.

  8. You can probably find it in the addon in uptext() ; basically it stores the extra property source_text with the datablock name. As in uptext, you’ll need to check if that corresponds to an actuall text datablock .
    might be a nice addition, would need to do it nicely so it doesn’t recalculate the length everytime it refreshes the ui.

  9. Thanks.

    I was thinking that it would need to be updated in case the text was edited.

    It looks like uptext() updates text.body, but truncates the source string to the current length of character_count. What I’d like to do is make a button that sets char_count to the total length of the source text.

    I’ve been trying to get it with

    string_length = int(len(bpy.data.texts[source].as_string()))

    but the console is returning ” for bpy.data.curves[‘myText’].string_length

    Clearly I have a lot to learn. Thanks again. This add-on rocks.

  10. Hang on—if it’s a button, it only needs to run the calculation whenever it gets clicked. Maybe I won’t give up just yet. 🙂

  11. so you could do update functions when the text source is edited, that’s a custom property, similar to the count. However, editing the source text block won’t drive an update function (a refresh button might be the answer here, or add the length calculation to uptext as well, so it will be refreshed next time the desired count is changed)

  12. James :

    does it work in 2.66? will not enable in 2.66.
    otherwise great add-on. thank you.

  13. […] для создания титров в своих роликах. Скрипт Бассама, «Typewriter», который он сделал по твоей же просьбе, помог тебе […]

  14. This script is really cool! Thank you! Worked on 2.68

  15. This looks really cool… can’t wait to try it. THNX

  16. […] implemented a couple of features for object data as well). It’s similar in some respects to Bassam Kurdali’s typewriter add-on, but has a few differences. Randomiser can manipulate text data in a variety of ways. If […]

  17. […] […]

  18. Can I open this in any text editor??? If so, how? I don’t have Microsoft Word…. Sooooo, how can I do it?

  19. yeah, word is a bad choice, since it is a word processor, but if you want you can either open it in the blender text editor, or just install it from the addons tab in user preference.

  20. Very useful, thanks!
    To insert a line break, I’ve added this line of code in your uptext() function:
    source = source.replace(“_”, “\n”);
    “_” is a character that I never use and that can be replaced by a “new line” character.

  21. Bob :

    Works great! Thanks very much for making this available.

  22. Hi Bassam, looks really awesome but the pasteall link no longer works? Thank you!

  23. Hi Raph, I’m about to fix it! look for a new blog post

  24. The only thing in my file is the picker and floating sliders

  25. thanks! I forgot to actually commit the other files, they’re there now.

  26. Thanks

  27. Small issue i’m having with the addon creating a keyframe for the change in character count

  28. can you tell me what the issue is exactly? does it refuse to add a keyframe, or are you unsure how to add it? if it doesn’t work, is there an error message?

  29. […] Typewritter (site) – Urchn – demo Animer simplement l’apparition d’un texte comme s’il était tapé au clavier. Pour un contrôle plus précis sur le texte on lui préférera Dynamic text […]

  30. Is this working for 2.78b? I am unable to import it as an addon script, and when I try to load the .py file directly into the text editor and run the script, it returns the following error:
    Error: File “E:\Zanthuria\Scene Files\Animation\2 – Infiltration\Infiltration Shot 2.blend\typewriter_text.py”, line 1

    ^
    SyntaxError: invalid syntax

    location: :-1

  31. That’s odd, did a stray character get in there? could you pastebin the file? the first line is just a comment…

  32. Here is the link to the pastebin: http://pastebin.com/zN8P3gLU
    I didn’t copy/paste the file from the gitlab repository, I right clicked on typewriter_text.py and saved it as a .py file on my computer. In the adons menu, installing from file did not work, and when I loaded the file into the text editor and clicked Run Script, that’s when I got this error.

  33. Ok, so I figured it out. Apparently downloading it fails, but clicking on it and copy/pasting the code directly from gitlab (instead of downloading the file) works, and it lets me save as a working .py file then, and I can successfully install it as a plugin. So there’s some code that went weird in the actual .py file, and I don’t know whether it happened during the download or what. But it is working now, and I love it! Great addon!

    On that note, just double-checking one thing: on gitlab, it says some are for personal use. Am I allowed to use this addon as an animation resource for a commercial project?

  34. Yes. The addon has no more restrictions than blender itself, and you are allowed to produce and use any kind of artwork with it (for sale, etc.)
    Any art you do with it belongs to you.

  35. Ok, thank you!

  36. Hi Bassam,

    how do you make the text self-type? You said something about a “recursive setup”. Could you please explain further?

    Thanks a million.

  37. Hi Bassam,

    I found the way by myself

    Thanks!
    Ralf

  38. Hi Bassam
    Great work on this addon!
    My challenge
    every time i copy the name of a text file into the source text bar….nothing shows up….no text just plain

  39. It shouldn’t be a text file it should be the name of a text block in blender, perhaps that’s the issue?

  40. Awesome addon for Blender.

©URCHIN 2015