Text [editor] objects: "fakeUser", "Make text

Scripting in Blender with Python, and working on the API

Moderators: jesterKing, stiv

Post Reply
Posts: 0
Joined: Tue Aug 24, 2010 8:08 am

Text [editor] objects: "fakeUser", "Make text

Post by thelusiv »

I have created a script that makes a Text object. It works fine. However I have noticed that there is an instance variable for the Text class called fakeUser, which seems like it would be necessary for Text objects which need to stay in the .blend file. So I've been setting textobject.fakeUser = True after I create the objects, and then in Blender's text editor window, that Text object has an F to the left of it in the drop-down box of text objects.

The way I am creating the text objects is by writing to a temporary file and then doing Text.Load (one of the functions in the Text module, not in the Text class itself). This works fine, and I delete the temporary file when the object has been stored. When I exit my script, and look at the Text object via the Blender text editor, a salmon-colored box with a question mark on it appears next to the list of text files, which, when clicked, prompts "File Deleted Outside Blender" with options "Make internal" and "Recreate file".

Questions regarding these things:
  • is fakeUser necessary to make sure Text objects stick around even if the file to which they refer no longer exists?
  • is there a way to make the file internal via Python?
  • what is the difference between making a Text object internal and not doing so? I can't tell any difference...
  • where can I find more information on Text objects, outside the API?

Posts: 0
Joined: Mon Aug 29, 2011 8:13 am

Post by kestion »

this post is a year old, but i came across it while searching on text edits.


For a very basic intro on getting started with python using the blender Text Editor see
http://wiki.blender.org/index.php/User: ... i_Proposal

Post Reply