Created
September 23, 2012 23:20
-
-
Save zeffii/3773400 to your computer and use it in GitHub Desktop.
checking if text has selection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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