Featured post

new redirect for blender.org bpy docs.

http://www.blender.org/api/blender_python_api_current/ As of 10/11 november 2015 we can now link to the current api docs and not be worr...

September 23, 2012

More text editor functionality

Thanks ideasman_42 for showing that this was possible, but admittedly ugly.
import bpy
text = bpy.context.edit_text
def has_selection(text):
return not (text.select_end_line == text.current_line and \
text.current_character == text.select_end_character)
print(has_selection(text))