forked from Sprytile/Sprytile
-
Notifications
You must be signed in to change notification settings - Fork 12
/
references.txt
98 lines (88 loc) · 3.74 KB
/
references.txt
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
88
89
90
91
92
93
94
95
96
97
98
https://blenderartists.org/forum/showthread.php?377599-NEW!!-Python-BVH-Tree-for-ray-cast-and-collisions-and-snapping
http://stackoverflow.com/questions/5666222/3d-line-plane-intersection
https://blenderartists.org/forum/showthread.php?223152-Opengl-in-Blender-2-6
http://blender.stackexchange.com/questions/30444/create-an-interface-which-is-similar-to-the-material-list-box
https://www.blender.org/api/blender_python_api_2_70_5/bpy.types.UIList.html
https://www.blender.org/api/blender_python_api_2_76_1/gpu.offscreen.html
Find the user's actual undo/redo keymapping by
- go to the keyconfigs. wm.keyconfigs.user
- Looking under the 'Screen' keymap
- Finding 'ed.undo' and 'ed.redo'
bpy.context.window_manager.keyconfigs.user.keymaps['Screen'].keymap_items.find('ed.undo')
Screen keymap:
ed.undo, ed.redo
Mesh keymap:
mesh.select_all,
mesh.hide
mesh.reveal
view3d.move - Camera pan, to allow user to move tile palette
code from development_iskeyfree.py, for checking user keymaps
# wm = bpy.context.window_manager
#
# for context, keyboardmap in wm.keyconfigs.user.keymaps.items():
# for myitem in keyboardmap.keymap_items:
# print myitem.idname
Change the key handler in the modal to operate through KeyMapItem found by this way.
If the event matches, pass the event through
Code for reading specific keymaps, unused but good as reference for key take overs
# # These keymaps are passed through blender
# keymap_pass_through = {
# 'Screen': {
# "ids": ['ed.undo', 'ed.redo']
# },
# 'Mesh': {
# "ids": [
# 'mesh.split',
# 'mesh.select_all',
# 'mesh.hide',
# 'mesh.reveal',
# 'mesh.edge_face_add',
# 'mesh.knife_tool',
# 'mesh.loopcut_slide',
# 'view3d.edit_mesh_extrude_move_normal',
# ],
# "prop": [
# 'VIEW3D_MT_edit_mesh_select_mode',
# 'VIEW3D_MT_edit_mesh_delete',
# 'VIEW3D_MT_edit_mesh_edges'
# ]
# },
# '3D View': {
# "ids": [
# 'view3d.select_circle',
# 'view3d.select_border',
# 'transform.rotate'
# ],
# "prop": ['VIEW3D_MT_snap'],
# "toggle": ['tool_settings.use_snap']
# },
# 'Object Non-modal': {
# "ids": ['object.mode_set']
# },
# 'Window': {
# "ids": ['wm.search_menu']
# }
# }
# for keymap_id in keymap_pass_through:
# keymap = user_keymaps[keymap_id]
# if keymap is None:
# continue
# cmd_list = keymap_pass_through[keymap_id]
# for kmi in keymap.keymap_items.values():
# if "ids" in cmd_list:
# if kmi.idname in cmd_list["ids"]:
# self.user_keys.append(kmi)
# continue
# if "prop" in cmd_list:
# if kmi.properties is None:
# continue
# if 'name' in kmi.properties:
# if kmi.properties.name in cmd_list["prop"]:
# self.user_keys.append(kmi)
# if "toggle" in cmd_list:
# if kmi.idname != "wm.context_toggle":
# continue
# if kmi.properties is None:
# continue
# if kmi.properties.data_path in cmd_list["toggle"]:
# self.user_keys.append(kmi)