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 )
def link_object_to_text(context):
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()
bpy.app.handlers.scene_update_pre.append(link_object_to_text)
2- For conversion run the following script once
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)
def addObject(self, context):
self.layout.operator(
text_object.bl_idname,
text = text_object.bl_label,
icon = 'OUTLINER_DATA_FONT')
def register():
bpy.utils.register_class(text_object)
bpy.types.VIEW3D_MT_object.append(addObject)
def unregister():
bpy.types.VIEW3D_MT_object.remove(addObject)
bpy.utils.unregister_class(text_object)
if __name__ == "__main__":
register()
unregister()
before register()
after if
at the end.
$\endgroup$
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.
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.
PgUp and PgDn function nowadays.