-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path__init__.py
87 lines (67 loc) · 2.25 KB
/
__init__.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#######################################################
## Copy Blender Info ######
##
## v0.0.1
## Added
## 23-02-19 - Initial start addon & repo
## v0.0.2
## Added
## 23-02-19 - Feedback when data is copied (info sysbar)
## v0.0.3
## Changed
## 23-02-19 - Now using BL internal copy method, easier and less files (Thanks Oleg Stepanov)
## v0.0.4
## Added
## 26-02-19 - After copying bl info call url bugpost direct from this addon (now its just 1 click)
## v0.0.5
## Added
## 19-04-22
# - Single quotes for hash code
bl_info = {
"name": "Copy Blender Info",
"description": "Reports a bug but also copies Blender info such as version, hash, date & time commit. This is handy for when filing a bug",
"location": "Help Menu > Report a Bug (+info)",
"author": "Rombout Versluijs",
"version": (0, 0, 5),
"blender": (2, 80, 0),
"wiki_url": "https://github.com/schroef/copy-blender-info",
"tracker_url": "https://github.com/schroef/copy-blender-info/issues",
"category": "User"
}
import bpy
from bpy.types import (
Operator
)
class CAI_OT_CopyInfo(Operator):
"""Copies Blender info to clipboard which is need to file a bug report"""
bl_idname="cai.copy_info"
bl_label="Report a Bug (+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
bpy.ops.wm.url_open(url="https://developer.blender.org/maniphest/task/edit/form/1")
self.report({'INFO'}, 'Info copied, ready to paste :)')
return {'FINISHED'}
def CAI_AddCopyOP(self, context):
self.layout.operator("cai.copy_info",text="Report a Bug (+info)", icon='URL')#icon='COPYDOWN')
classes = (
CAI_OT_CopyInfo
)
def register():
#for cls in classes:
# bpy.utils.register_class(cls)
bpy.utils.register_class(CAI_OT_CopyInfo)
bpy.types.TOPBAR_MT_help.prepend(CAI_AddCopyOP)
def unregister():
bpy.types.TOPBAR_MT_help.remove(CAI_AddCopyOP)
#for cls in reversed(classes):
# bpy.utils.unregister_class(cls)
bpy.utils.unregister_class(CAI_OT_CopyInfo)
if __name__ == "__main__":
register()