Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created September 23, 2012 23:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/3773400 to your computer and use it in GitHub Desktop.
Save zeffii/3773400 to your computer and use it in GitHub Desktop.
checking if text has selection
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))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment