-
-
Save zeffii/b0910b95ad92df070c98 to your computer and use it in GitHub Desktop.
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
''' | |
installation | |
- from a fresh Blender start | |
- drop ufkoot.py into your scripts/addons(_contrib) folder | |
- in User Preferences / addons / Testing (or community..) / Development | |
- tick 'Info To Text' | |
- press Save User Settings | |
- close the User Preferences Panel | |
- press Ctrl + U , (this will store this preference in the startup.blend) | |
access | |
- A new menu entry is added to Info -> Window -> Copy Selected Info To Text | |
''' | |
bl_info = { | |
"name": "Info To Text", | |
"author": "Dealga McArdle", | |
"version": (0, 0, 0), | |
"blender": (2, 7, 4), | |
"location": "info header > window > Copy Selected Info To Text", | |
"description": "copies selected lines to Text datablock", | |
"wiki_url": "", | |
"tracker_url": "", | |
"category": "Development"} | |
import bpy | |
class InfoToTextBlock(bpy.types.Operator): | |
bl_idname = "info.to_text_block" | |
bl_label = "Copy Selected Info To Text" | |
def execute(self, context): | |
bpy.ops.info.report_copy() | |
fdata = context.window_manager.clipboard | |
bpy.data.texts.new('copied_from_console') | |
bpy.data.texts['copied_from_console'].write(fdata) | |
return {'FINISHED'} | |
def draw_item(self, context): | |
layout = self.layout | |
layout.operator("info.to_text_block") | |
def register(): | |
bpy.utils.register_class(InfoToTextBlock) | |
bpy.types.INFO_MT_window.append(draw_item) | |
def unregister(): | |
bpy.utils.unregister_class(InfoToTextBlock) | |
bpy.types.INFO_MT_window.remove(draw_item) | |
if __name__ == "__main__": | |
register() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment