-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed FRACTION in Vec Math (Sub search). Added keymap functionality i…
…nto addon preferences.
- Loading branch information
1 parent
b293bba
commit 26e8035
Showing
3 changed files
with
64 additions
and
27 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,8 +20,8 @@ | |
bl_info = { | ||
"name": "Node Tabber", | ||
"author": "Richard Lyons <[email protected]>", | ||
"version": (0, 1, 3), | ||
"blender": (2, 83, 0), | ||
"version": (0, 1, 4), | ||
"blender": (2, 83, 7), | ||
"description": "Allows quick smart searching of node types.", | ||
"category": "Node", | ||
} | ||
|
@@ -35,8 +35,10 @@ | |
IntProperty, | ||
) | ||
from . import operators | ||
import rna_keymap_ui | ||
|
||
|
||
addon_keymaps = [] | ||
|
||
|
||
class node_tabberPreferences(AddonPreferences): | ||
|
@@ -72,30 +74,81 @@ class node_tabberPreferences(AddonPreferences): | |
) | ||
|
||
|
||
|
||
def draw(self, context): | ||
layout = self.layout | ||
|
||
# Prefs | ||
|
||
box = layout.box() | ||
row1 = box.row() | ||
row2 = box.row() | ||
row3 = box.row() | ||
row4 = box.row() | ||
row1.prop(self, "tally") | ||
row1.operator('node.reset_tally', | ||
row1.prop(self, "sub_search") | ||
row1.prop(self, "quick_place") | ||
row2.prop(self, "tally") | ||
row2.operator('node.reset_tally', | ||
text = 'Reset Tally') | ||
row1.prop(self, "tally_weight") | ||
row2.prop(self, "quick_place") | ||
row2.prop(self, "nt_debug") | ||
row3.prop(self, "sub_search") | ||
row4.label(text="NOTE: CTRL + TAB : Performs \"Edit Group\" functionality.") | ||
row2.prop(self, "tally_weight") | ||
#row2.prop(self, "nt_debug") | ||
#row4.label(text="NOTE: CTRL + TAB : Performs \"Edit Group\" functionality.") | ||
|
||
|
||
# Keymaps | ||
|
||
#box = layout.box() | ||
col = box.column() | ||
col.label(text="Keymap List:",icon="KEYINGSET") | ||
|
||
wm = bpy.context.window_manager | ||
kc = wm.keyconfigs.user | ||
old_km_name = "" | ||
get_kmi_l = [] | ||
for km_add, kmi_add in addon_keymaps: | ||
for km_con in kc.keymaps: | ||
if km_add.name == km_con.name: | ||
km = km_con | ||
break | ||
|
||
for kmi_con in km.keymap_items: | ||
if kmi_add.idname == kmi_con.idname: | ||
if kmi_add.name == kmi_con.name: | ||
get_kmi_l.append((km,kmi_con)) | ||
|
||
get_kmi_l = sorted(set(get_kmi_l), key=get_kmi_l.index) | ||
|
||
for km, kmi in get_kmi_l: | ||
if not km.name == old_km_name: | ||
col.label(text=str(km.name),icon="DOT") | ||
col.context_pointer_set("keymap", km) | ||
rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0) | ||
col.separator() | ||
old_km_name = km.name | ||
|
||
|
||
|
||
|
||
|
||
def register(): | ||
operators.register() | ||
bpy.utils.register_class(node_tabberPreferences) | ||
|
||
wm = bpy.context.window_manager | ||
kc = wm.keyconfigs.addon | ||
if kc: | ||
km = wm.keyconfigs.addon.keymaps.new(name='Node Editor', space_type='NODE_EDITOR') | ||
kmi = km.keymap_items.new("node.add_tabber_search", type = 'TAB', value= 'PRESS') | ||
addon_keymaps.append((km, kmi)) | ||
kmi = km.keymap_items.new("node.group_edit", type = 'TAB', value= 'PRESS', ctrl= True) | ||
addon_keymaps.append((km, kmi)) | ||
|
||
def unregister(): | ||
for km, kmi in addon_keymaps: | ||
km.keymap_items.remove(kmi) | ||
addon_keymaps.clear() | ||
|
||
operators.unregister() | ||
bpy.utils.unregister_class(node_tabberPreferences) | ||
|
||
|
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
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