-
Notifications
You must be signed in to change notification settings - Fork 0
/
copy_date_build_hash_to_clipboard.py
57 lines (42 loc) · 1.37 KB
/
copy_date_build_hash_to_clipboard.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
## Copy Blender Info ######
bl_info = {
"name": "Blender Info to Clipboard",
"description": "Copy Build name, hash and date to clipboard. Useful whan you report bugs and want to copy such data for working branch",
"location": "Help Menu > Copy info",
"author": "Kobozev Vyacheslav",
"version": (0, 0, 1),
"blender": (2, 80, 0),
"wiki_url": "",
"tracker_url": "",
"category": "User"
}
import bpy
from bpy.types import Operator
class CI_OT_CopyInfo(Operator):
"""Copies Blender info to clipboard"""
bl_idname="ci.copy_info"
bl_label="Copy info"
def execute(self,context):
version = bpy.app.version_string
build = bpy.app.build_branch
comDate = bpy.app.build_commit_date
comTime = bpy.app.build_commit_time
buildHash = bpy.app.build_hash
buildType = bpy.app.build_type
appInfo = version+", "+buildHash.decode()+", "+comDate.decode()+" "+comTime.decode()
bpy.context.window_manager.clipboard=appInfo
self.report({'INFO'}, 'Info copied, ready to paste :)')
return {'FINISHED'}
def CI_CopyOP(self, context):
self.layout.operator("ci.copy_info",text="Copy info", icon="COPYDOWN")
classes = (
CI_OT_CopyInfo
)
def register():
bpy.utils.register_class(CI_OT_CopyInfo)
bpy.types.TOPBAR_MT_help.prepend(CI_CopyOP)
def unregister():
bpy.utils.unregister_class(CI_OT_CopyInfo)
bpy.types.TOPBAR_MT_help.remove(CI_CopyOP)
if __name__ == "__main__":
register()