Added texture browser to the image menu.
The Ctrl+Alt+Shift+A shortcut still works everywhere, but now it's also easy to find in the GUI.
This commit is contained in:
parent
b04f9adb40
commit
37f701edaf
@ -28,7 +28,7 @@ import bgl
|
|||||||
import blf
|
import blf
|
||||||
|
|
||||||
import pillarsdk
|
import pillarsdk
|
||||||
from . import async_loop, pillar, cache
|
from . import async_loop, pillar, cache, blender
|
||||||
|
|
||||||
REQUIRED_ROLES_FOR_TEXTURE_BROWSER = {'subscriber', 'demo'}
|
REQUIRED_ROLES_FOR_TEXTURE_BROWSER = {'subscriber', 'demo'}
|
||||||
MOUSE_SCROLL_PIXELS_PER_TICK = 50
|
MOUSE_SCROLL_PIXELS_PER_TICK = 50
|
||||||
@ -789,15 +789,15 @@ class BlenderCloudBrowser(pillar.PillarOperatorMixin,
|
|||||||
addon_keymaps = []
|
addon_keymaps = []
|
||||||
|
|
||||||
|
|
||||||
def menu_draw(self, context):
|
def image_editor_menu(self, context):
|
||||||
layout = self.layout
|
self.layout.operator(BlenderCloudBrowser.bl_idname,
|
||||||
layout.separator()
|
text='Get image from Blender Cloud',
|
||||||
layout.operator(BlenderCloudBrowser.bl_idname, icon='MOD_SCREW')
|
icon_value=blender.icon('CLOUD'))
|
||||||
|
|
||||||
|
|
||||||
def register():
|
def register():
|
||||||
bpy.utils.register_class(BlenderCloudBrowser)
|
bpy.utils.register_class(BlenderCloudBrowser)
|
||||||
# bpy.types.INFO_MT_mesh_add.append(menu_draw)
|
bpy.types.IMAGE_MT_image.prepend(image_editor_menu)
|
||||||
|
|
||||||
# handle the keymap
|
# handle the keymap
|
||||||
wm = bpy.context.window_manager
|
wm = bpy.context.window_manager
|
||||||
@ -817,4 +817,5 @@ def unregister():
|
|||||||
km.keymap_items.remove(kmi)
|
km.keymap_items.remove(kmi)
|
||||||
addon_keymaps.clear()
|
addon_keymaps.clear()
|
||||||
|
|
||||||
|
bpy.types.IMAGE_MT_image.remove(image_editor_menu)
|
||||||
bpy.utils.unregister_class(BlenderCloudBrowser)
|
bpy.utils.unregister_class(BlenderCloudBrowser)
|
||||||
|
Reference in New Issue
Block a user