# How to quickly place text cursor in long 3D Text?

For a 3D text object, especially with many many characters in it, how can I place the cursor to the right position in order to edit the text around it?

Here is an example to show what I mean:

Here is two methods to edit the text object in the text editor :

1- Link the object text to the text file :

2- Convert text object to a file, then back from a file to an object :

1- For the first method, run this script once and select your text object to see the live update.

import bpy

#this is one way link ( object to text file )
obj = bpy.context.active_object
if obj.type == 'FONT':
if None == bpy.data.texts.get(obj.name):
bpy.data.texts.new(name = obj.name)
bpy.data.texts[obj.name].write(obj.data.body)
text_file = bpy.data.texts[obj.name]
obj.data.body = text_file.as_string()



2- For conversion run the following script once

• you will find it in 3D_View -> Object -> Convert text
• OR type Convert Text Object in the Space menu

.

import bpy
from bpy.types import Operator
from bpy.props import *

def object_to_text():
obj = bpy.context.active_object
if obj.type == 'FONT':
if None == bpy.data.texts.get(obj.name):
bpy.data.texts.new(name = obj.name)

text_file = bpy.data.texts[obj.name]
text_file.clear()
text = obj.data.body
text_file.write(text)

def object_from_text():
obj = bpy.context.active_object
if obj.type == 'FONT':
if None == bpy.data.texts.get(obj.name):
bpy.data.texts.new(name = obj.name)

text_file = bpy.data.texts[obj.name]
#clear text_obj
obj.data.body = text_file.as_string()

class   text_object(Operator):

"""text file from&to text object"""
bl_idname = "object.from_to_text"
bl_label = "convert text object"
bl_options = {'REGISTER', 'UNDO'}

#parameters and variables
convert = EnumProperty(
name="Convert",
description="Choose conversion",
items=(('T2F', "object to file ", "convert text object to text file"),
('F2T', "file  to object", "convert text file to text object")),
default='T2F',
)

def execute(self, context):
if self.convert == 'T2F':
object_to_text()
else:
object_from_text()

self.report({'INFO'},"Conversion is Done")
return {'FINISHED'}

#get inputs
def invoke(self, context, event):
wm = context.window_manager
return wm.invoke_props_dialog(self)

self.layout.operator(
text_object.bl_idname,
text = text_object.bl_label,
icon = 'OUTLINER_DATA_FONT')

def register():
bpy.utils.register_class(text_object)

def unregister():
bpy.utils.unregister_class(text_object)

if __name__ == "__main__":
register()

• The solution very nice for now. Man, you really should make them as an addon to share. :) BTW, When accidentally run script Two twice, the menu will also be created twice. Anyway to solve this? – Leon Cheung Mar 7 '15 at 2:34
• @LeonCheung thanks , and for the menu i have no idea for now ! I'll see if i can find something in the tomorrow – Chebhou Mar 7 '15 at 2:39
• Script two is an addon, best to disable/enable it in prefs. To work better running from text block add unregister() before register() after if at the end. – sambler Mar 7 '15 at 7:15

You can just type what you want in the text editor and then convert it to a text.and it is so easy to do just toggle to the edit panel and press convert to 3d text and choose what you want.you can also use an original text for this. Have fun.

• Yes, it works, though I think it is a one way trip. Each time I need to edit something, I need to recreate as a new object and delete the last one. Anyway, it seems to be something about workflow. – Leon Cheung Mar 7 '15 at 2:41

While I would recommend using the text editor to edit large amounts of text, it really doesn't take too long to get around with just the arrow keys, at least in a situation like your example:

Using ⎈ Ctrl← Left arrow and ⎈ Ctrl→ Right arrow you can jump between spaces, allowing you to travel much faster horizontally. Home and End are also useful.

So far as I can see, there is no faster way than using the arrow keys and moving to the correct position. Unless you're writing a small novel, you should be fine with this. Once you use the arrow keys even once, you can use the options found in the tool bar to jump to next page, previous line ect. and then hone in on the particular place normally.