def draw(self, context):

		preferences = bpy.context.preferences
		addon_prefs = bpy.context.preferences.addons[__name__].preferences

		layout = self.layout

		row = layout.row()
		col = row.column()
		col.label(text="Tab Category:")
		col.prop(self, "category", text="")


		################################################
		# キーマップリスト
		box = layout.box()
		col = box.column()

		col.label(text="Keymap List:",icon="KEYINGSET")

		kc = bpy.context.window_manager.keyconfigs.addon
		for km, kmi in addon_keymaps:
			km = km.active()
			col.context_pointer_set("keymap", km)
			rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
 def draw(self, context):
     layout = self.layout
     col = layout.column()
     col.prop(self, 'font_size')
     col.prop(self, 'node_distance')
     col.prop(self, 'sibling_distance')
     col.prop(self, 'subtree_distance')
     col.separator()
     col.prop(self, 'show_colors')
     if self.show_colors:
         box = layout.box()
         box.label(text="Syntax Highlighting")
         box.prop(self, 'math_func_color')
         box.prop(self, 'vector_math_func_color')
         box.prop(self, 'python_color')
         box.prop(self, 'float_color')
         box.prop(self, 'default_color')
         box.prop(self, 'keyword_color')
         box.prop(self, 'error_color')
     col = layout.column()
     col.label(text="Keymaps:")
     kc = bpy.context.window_manager.keyconfigs.addon
     for km, kmi in addon_keymaps:
         km = km.active()
         col.context_pointer_set("keymap", km)
         rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
    def draw(self, context):
        layout = self.layout

        box = layout.box()
        box.label(text='Octane')
        box.prop(self, "brdf_model")
        box.separator()

        box = layout.box()
        box.label(text='Megascans')
        col = box.column(align=True)
        col.prop(self, 'use_projection_surface')
        col.prop(self, 'surface_projection', text='')
        col = box.column(align=True)
        col.prop(self, "disp_type")
        if (self.disp_type == "VERTEX"):
            col.prop(self, "disp_level_vertex")
        col = box.column(align=True)
        col.prop(self, "is_cavity_enabled")
        col.prop(self, "is_curvature_enabled")
        col.prop(self, "is_bump_enabled")
        col.prop(self, "is_fuze_enabled")
        box.separator()

        box = layout.box()
        box.label(text='Keymap')
        kc = bpy.context.window_manager.keyconfigs.addon
        for km, kmi in addon_keymaps:
            km = km.active()
            box.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, box, 0)
        box.separator()
Beispiel #4
0
    def draw(self, context):
        layout = self.layout

        box = layout.box()
        row = box.row()
        row.prop(self, 'modal_color_header')
        row = box.row()
        row.prop(self, 'modal_color_text')
        row = box.row()
        row.prop(self, 'modal_color_subtext')

        box = layout.box()
        split = box.split()
        col = split.column()
        col.label(text='Custom Operator Hotkeys')
        col.separator()

        wm = bpy.context.window_manager
        kc = wm.keyconfigs.user
        km = kc.keymaps['3D View Generic']
        kmi = get_hotkey_entry_item(km, 'ke.call_pie', "KE_MT_shading_pie")
        if kmi:
            col.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
        else:
            col.label(
                text=
                "keShading Pie: No hotkey entry found - Restore in keymap prefs (3D View / 3D View Generic)"
            )
    def draw(self, context):
        layout = self.layout
        box = layout.box()
        box.prop(self, "show_angle")
        split = box.split()

        col = split.column()
        col.label(text="Text Size:")
        col.label(text="Text Color:")
        col.label(text="Rotation Speed:")

        col = split.column()
        col.prop(self, "text_size", text="", slider=True)
        col.prop(self, "text_color", text="")
        col.prop(self, "rotation_speed", text="", slider=True)

        wm = context.window_manager
        box = layout.box()
        split = box.split()
        col = split.column()
        col.label(text='Hotkey')
        col.separator()
        kc = wm.keyconfigs.user
        km = kc.keymaps['3D View']
        kmi = get_hotkey_entry_item(km, 'rotate.hdri')
        col.context_pointer_set("keymap", km)
        rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
Beispiel #6
0
    def draw(self, context):
        layout = self.layout
        layout.prop(self, 'flipUVRandom')
        layout.prop(self, 'hideGPStrokes')
        box = layout.box()
        split = box.split()
        col = split.column()
        col.label(text='Hotkey')
        col.separator()
        wm = bpy.context.window_manager
        kc = wm.keyconfigs.user
        km = kc.keymaps['3D View']
        kmi = get_hotkey_entry_item(km, 'wm.call_menu_pie', "object.hair_tool_menu")
        if kmi:
            col.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
            col.operator(HT_OT_HairTool_Clear_Hotkeys.bl_idname, text="Clear hotkeys", icon='REMOVE')
        else:
            col.label(text="No hotkey entry found")
            col.operator(HT_OT_HairTool_Add_Hotkey.bl_idname, text="Add hotkey entry", icon='ADD')

        row = layout.row()
        col = row.column()

        subcol = col.column(align = True)
Beispiel #7
0
    def drawKeymap(self):
        col = self.layout.box().column()
        # col.label(text="Keymap", icon="KEYINGSET")
        km = None
        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 and 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)

            old_km_name = km.name
def show_keymap(condition,
                kc,
                keymap,
                addon,
                layout,
                kmivalue='none',
                properties='none',
                keepactive=False):
    km = kc.keymaps[keymap]
    if condition:
        try:
            layout.separator()
            kmi = get_keymap_item(km, addon, kmivalue, properties)
            # kmi.active = True
            layout.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, layout, 0)
            layout.separator()
        except:
            pass
    else:
        try:
            kmi = get_keymap_item(km, addon, kmivalue, properties)
            if not keepactive:
                kmi.active = False
        except:
            pass
Beispiel #9
0
    def draw(self, context):
        layout = self.layout
        wm = context.window_manager
        kc = wm.keyconfigs.user
        kms = kc.keymaps
        keymap_names = [
            '3D View', 'Sculpt', 'Vertex Paint', 'Weight Paint', 'Image Paint'
        ]
        box = layout.box()

        idname = ModifierComboMenuTrigger.bl_idname

        box.label("Modifier Combo Menu")

        for n in range(len(keymap_names)):
            km_n = kms[keymap_names[n]]
            split = box.split()
            col = split.column()
            col.label(keymap_names[n])
            kmi_n = get_keymap_item(km_n, idname)

            if kmi_n:
                col.context_pointer_set("keymap", km_n)
                rna_keymap_ui.draw_kmi([], kc, km_n, kmi_n, col, 0)
            else:
                register_keymap()
Beispiel #10
0
    def draw(self, context):
        layout = self.layout
        layout.prop(self, "radius")
        layout.prop(self, "mlt_merge_type")
        wm = context.window_manager
        kc = wm.keyconfigs.user
        box = layout.box()
        box.label(
            "You don't need to check boxes of Merge Verts, Melter Pie Menu, Circle Size Up and Circle Size Down."
        )

        idnames = [
            Melter.bl_idname, MelterOperation.bl_idname,
            SetMelterSettingPieTrigger.bl_idname, CircleSizeUp.bl_idname,
            CircleSizeDown.bl_idname
        ]
        km = kc.keymaps['Mesh']

        for n, idname in enumerate(idnames):
            split = box.split()
            col = split.column()
            kmi = get_keymap_item(km, idname)

            if kmi:
                col.context_pointer_set("keymap", km)
                rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)

            else:
                register_keymap()
Beispiel #11
0
def draw_keymaps(context, layout, km_kmi: "dict / load_modules.keymaps"):
    """"""
    from rna_keymap_ui import draw_kmi

    wm = context.window_manager
    kc = wm.keyconfigs.addon
    # kc = wm.keyconfigs.user

    for keymap, kmis in km_kmi.items():
        layout.context_pointer_set('keymap', keymap)

        row = layout.row()
        row.alignment = 'LEFT'
        row.emboss = 'PULLDOWN_MENU'
        row.prop(keymap, 'show_expanded_items', text=keymap.name)
        # row.prop(keymap, "show_expanded_items", text="", emboss=False)
        # row.label(text=keymap.name)

        if keymap.show_expanded_items:
            col = layout.column()

            # for kmi in keymap.keymap_items:
            # if kmi in kmis:
            # draw_kmi(["ADDON", "USER", "DEFAULT"], kc, keymap, kmi, col, 0)
            for kmi in kmis:
                draw_kmi(['ADDON'], kc, keymap, kmi, col, 0)
Beispiel #12
0
    def draw(self, context):
        layout = self.layout

        row = layout.row()
        row.label(text="Tab Category:")
        row.prop(self, "category", text="")

        box = layout.box()
        col = box.column()
        col.label(text="Keymap List:", icon="KEYINGSET")

        wm = bpy.context.window_manager
        kc = wm.keyconfigs.user
        for keymaps_added, keyitems_added in addon_keymaps:
            for keymaps_config in kc.keymaps:
                if keymaps_added.name == keymaps_config.name:
                    km = keymaps_config

            for kmi_con in km.keymap_items:
                if keyitems_added.name == kmi_con.name:
                    kmi = kmi_con
            try:
                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()
            except:
                pass

        col.operator(TGLVIEW_OT_reset_hotkey.bl_idname, text="Reset Keymaps")
        layout.operator("wm.url_open", text="GitHub",
                        icon="URL").url = "https://github.com/3str6"
Beispiel #13
0
    def draw(self, context):
        layout = self.layout
        layout.use_property_split = True
        layout.use_property_decorate = False

        layout = layout.column(align=True)
        layout.label(text="Preferences Window Size")
        row = layout.row()
        row.label(text="Width:")
        row.prop(self, "pref_window_width", text="")
        row.label(text="Height:")
        row.prop(self, "pref_window_height", text="")

        layout.separator()
        layout = layout.box()
        wm = bpy.context.window_manager
        kc = wm.keyconfigs.user

        km = kc.keymaps['Screen']
        kmi = get_hotkey_entry_item(km, 'cps.call_preferences')
        if kmi:
            col = layout.row()
            col.label(text="Opens Preferences with custom width")
            col = layout.row()
            col.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
            col = layout.row()
            col.label(text="Save keymap to keep changes", icon='ERROR')

        else:
            col = layout.row()
            col.label(text="Personal setting")
            col.label(text="restore hotkeys from interface tab")
Beispiel #14
0
    def draw(self, context):
        layout = self.layout
        box = layout.box()
        split = box.split()
        col = split.column()
        # Layout ---------------------------------------------------------------- #
        col.label(text="Default Values:")
        col.prop(self, "offset", text="Default Offset")
        col.prop(self, "objnum", text="Default Count")
        col.prop(self, "selectable", text="Selectable")
        col.prop(self, "modal_help", text="Modal Help")
        col.label(text="Options:")
        col.prop(self, "col_toggle", text="Create New Collection")
        col.label(text="Keymap:")

        wm = bpy.context.window_manager
        kc = wm.keyconfigs.user
        km = kc.keymaps['Object Mode']
        #kmi = km.keymap_items[0]
        kmi = get_hotkey_entry_item(km, 'sop.r_array', 'sop.r_array')

        if addon_keymaps:
            km = addon_keymaps[0].active()
            col.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
Beispiel #15
0
def draw_keymap_items(kc, name, keylist, layout):
    drawn = False

    for idx, item in enumerate(keylist):
        keymap = item.get("keymap")

        if keymap:
            km = kc.keymaps.get(keymap)

            kmi = None
            if km:
                idname = item.get("idname")

                for kmitem in km.keymap_items:
                    if kmitem.idname == idname:
                        properties = item.get("properties")

                        if properties:
                            if all([getattr(kmitem.properties, name, None) == value for name, value in properties]):
                                kmi = kmitem
                                break

                        else:
                            kmi = kmitem
                            break

            # draw keymap item

            if kmi:
                # multi kmi tools, will share a single box, created for the first kmi
                if idx == 0:
                    box = layout.box()

                # single kmi tools, get their label from the title
                if len(keylist) == 1:
                    label = name.title().replace("_", " ")

                # multi kmi tools, get it from the label tag, while the title is printed once, before the first item
                else:
                    if idx == 0:
                        box.label(text=name.title().replace("_", " "))

                    label = item.get("label")

                row = box.split(factor=0.15)
                row.label(text=label)

                # layout.context_pointer_set("keymap", km)
                rna_keymap_ui.draw_kmi(["ADDON", "USER", "DEFAULT"], kc, km, kmi, row, 0)

                # draw info, if available
                infos = item.get("info", [])
                for text in infos:
                    row = box.split(factor=0.15)
                    row.separator()
                    row.label(text=text, icon="INFO")

                drawn = True
    return drawn
    def draw(self, context):
        '''
        simple preference UI to define custom inputs and user preferences
        '''
        layout = self.layout
        wm = bpy.context.window_manager

        row = layout.row(align=True)
        row.prop(self, "prefs_tabs", expand=True)

        if self.prefs_tabs == 'ui':

            row = layout.row()
            row.prop(self, "renaming_category", expand=True)
            row = layout.row()
            row.prop(self, "renamingPanel_showPopup")
            row = layout.row()
            row.prop(self, "renamingPanel_advancedMode")
            row = layout.row()
            row.prop(self, "renaming_separator")
            row = layout.row()
            row.prop(self, "renaming_stringLow")
            row = layout.row()
            row.prop(self, "renaming_stringHigh")
            row = layout.row()
            row.prop(self, "renaming_stringCage")
            row = layout.row()
            row.prop(self, "renaming_user1")
            row = layout.row()
            row.prop(self, "renaming_user2")
            row = layout.row()
            row.prop(self, "renaming_user3")

        if self.prefs_tabs == 'keymaps':
            box = layout.box()
            split = box.split()
            col = split.column()

            wm = bpy.context.window_manager
            kc = wm.keyconfigs.addon
            km = kc.keymaps['3D View Generic']

            kmis = []
            kmis.append(
                get_hotkey_entry_item(km, 'wm.call_panel',
                                      'VIEW3D_PT_tools_renaming_panel'))
            kmis.append(
                get_hotkey_entry_item(km, 'wm.call_panel',
                                      'VIEW3D_PT_tools_type_suffix'))
            for kmi in kmis:
                if kmi:
                    col.context_pointer_set("keymap", km)
                    rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
                else:
                    col.label(text="No hotkey entry found")
                    col.operator(RENAMING_OT_add_hotkey_renaming.bl_idname,
                                 text="Add hotkey entry",
                                 icon='ADD')
Beispiel #17
0
def add_hotkey_ui(name, km, kc, row):
    kmi = get_hotkey_entry_item(km, name)
    if kmi:
        row.context_pointer_set("keymap", km)
        rna_keymap_ui.draw_kmi([], kc, km, kmi, row, 0)

    else:
        row.label(text="No hotkey entry found")
        add_keymap(name, 'NONE')
Beispiel #18
0
    def get_hotkey_entry_item(name, kc, km, kmi_name, kmi_value, col):
        for km_item in km.keymap_items:
            if km_item.idname == kmi_name and km_item.properties.name == kmi_value:
                col.context_pointer_set('keymap', km)
                rna_keymap_ui.draw_kmi([], kc, km, km_item, col, 0)
                return

        col.label(text=f"No hotkey entry found for {name}")
        col.operator(PIESPLUS_OT_add_hotkey.bl_idname, text="Restore keymap", icon='ADD').km_name = km.name
    def draw(self, context):
        layout = self.layout
        wm = bpy.context.window_manager

        box = layout.box()
        split = box.split()
        col = split.column()
        col.label(text='UV Toolkit Pie menu Hotkey')
        col.separator()
        kc = wm.keyconfigs.user
        km = kc.keymaps['3D View']
        kmi = get_hotkey_entry_item(km, 'wm.call_menu_pie', 'UVTOOLKIT_MT_pie')
        if kmi:
            col.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)

        layout.label(text="Checker image settings:")
        box = layout.box()
        row = box.row()
        row.label(text="Default checker style")
        row.prop(self, "checker_type", expand=True)
        row = box.row()
        row.label(text="Auto assign texture in UV Editor")
        row.prop(self, "assign_image", expand=True)
        row = box.row()
        row.label(text="Use flat shading")
        row.prop(self, "use_flat_shading", expand=True)

        layout.label(text="UV Sync settings:")
        box = layout.box()
        row = box.row()
        row.label(text="Auto select mesh")
        row.prop(self, "uv_sync_auto_select", expand=True)
        row = box.row()
        row.label(text="Sync selection mode")
        row.prop(self, "uv_sync_selection_mode", expand=True)

        layout.label(text="Boundary Seam settings:")
        box = layout.box()
        row = box.row()
        row.label(text="Regular Unwrap after Boundary seam")
        row.prop(self, "boundary_loop_unwrap", expand=True)
        row = box.row()
        row.label(text="Alternative Unwrap after Boundary seam")
        row.prop(self, "boundary_loop_enable_live_unwrap", expand=True)
        row = box.row()
        row.label(text="Enable UV Sync")
        row.prop(self, "boundary_loop_enable_uv_sync", expand=True)

        layout.label(text="Support Me on:")
        box = layout.box()
        row = box.row()
        row.operator("wm.url_open",
                     text="Gumroad").url = "https://gumroad.com/alexbel"
        row.operator("wm.url_open",
                     text="PayPal").url = "https://paypal.me/belyakovalexander"
    def draw(self, context):
        layout = self.layout
        box = layout.row().box()
        FindConflict(box)
        box = layout.row().box()

        ku = bpy.context.window_manager.keyconfigs.user
        km = ku.keymaps.get('3D View')

        kmi = km.keymap_items.get('view3d.auto_delete')
        rna_keymap_ui.draw_kmi([], ku, km, kmi, box, 0)
Beispiel #21
0
def FindConflict(box, item):
    ku = bpy.context.window_manager.keyconfigs.user
    km = ['3D View','3D View Generic','Object Mode', 'Mesh','Curve','Armature']
    for km_n in km: 
        for i in bpy.context.window_manager.keyconfigs.user.keymaps[km_n].keymap_items:
            if item.type == i.type and item.ctrl == i.ctrl and item.alt == i.alt and item.shift == i.shift and item.name != i.name:
                col = box.column()
                col.label(text='Conflict hotkey: ' + '3D View -> ' + km_n + ' -> ' + i.name + " : ")
                # col.prop(bpy.context.window_manager.keyconfigs.user.keymaps.get(km_n), i)
                rna_keymap_ui.draw_kmi([], ku, bpy.context.window_manager.keyconfigs.user.keymaps[km_n], i, box, 0)
                return None
Beispiel #22
0
def draw_keymap_items(kc, name, keylist, layout, debug=False):
    drawn = False
    loist = []

    for item in keylist:
        keymap = item.get("keymap")

        if debug:
            print("+++++ \n" + str(item.get("idname")))
            print(str(keymap))

        if keymap:
            km = kc.keymaps.get(keymap)

            if debug:
                print(str(km) + "\n+++++ \n")

            kmi = None
            if km:
                idname = item.get("idname")

                for kmitem in km.keymap_items:
                    if kmitem.idname == idname:
                        loist.append(kmitem.idname)
                        properties = item.get("properties")

                        if properties:
                            if all(
                                    [getattr(kmitem.properties, name, None)
                                        == value for name, value in properties]):
                                kmi = kmitem
                                break

                        else:
                            kmi = kmitem
                            break

            # draw keymap item

            if kmi:
                box = layout.box()
                if debug:
                    pre = box.column()
                    pre.label(text=str(kmi.idname))
                    pre.label(text=str(keymap))

                row = box.row()

                rna_keymap_ui.draw_kmi(["ADDON", "USER", "DEFAULT"], kc, km, kmi, row, 0)

                drawn = True

    return drawn
Beispiel #23
0
    def draw(self, context):
        layout = self.layout
        wm = context.window_manager
        kc = wm.keyconfigs.user
        box = layout.box()
        box.label("Pie Menu Setting")

        split = box.split()
        col = split.column(align=True)
        col.label(text="Main")
        col.prop(self, "pie_north", text="↑ ")
        col.prop(self, "pie_north_east", text="↗ ")
        col.prop(self, "pie_east", text="→ ")
        col.prop(self, "pie_south_east", text="↘ ")
        col.prop(self, "pie_south", text="↓ ")
        col.prop(self, "pie_south_west", text="↙ ")
        col.prop(self, "pie_west", text="← ")
        col.prop(self, "pie_north_west", text="↖ ")

        col = split.column(align=True)
        col.label(text="Sub")
        col.prop(self, "pie_north_sub", text="")
        col.prop(self, "pie_north_east_sub", text="")
        col.prop(self, "pie_east_sub", text="")
        col.prop(self, "pie_south_east_sub", text="")
        col.prop(self, "pie_south_sub", text="")
        col.prop(self, "pie_south_west_sub", text="")
        col.prop(self, "pie_west_sub", text="")
        col.prop(self, "pie_north_west_sub", text="")

        idnames = [
            SwitchAreaPieTrigger.bl_idname, KeySwitchUp.bl_idname,
            KeySwitchDown.bl_idname, KeyShortRunner.bl_idname,
            KeyShortRunnerBack.bl_idname, KeyScreenUp.bl_idname,
            KeyScreenDown.bl_idname
        ]
        kms = kc.keymaps

        for n in range(len(keymap_names)):
            km_n = kms[keymap_names[n]]

            for m, idname in enumerate(idnames):
                split = box.split()
                col = split.column()
                if m is 0:
                    col.label(keymap_names[n])
                kmi_n = get_keymap_item(km_n, idname)

                if kmi_n:
                    col.context_pointer_set("keymap", km_n)
                    rna_keymap_ui.draw_kmi([], kc, km_n, kmi_n, col, 0)
                else:
                    register_keymap()
    def draw(self, context):
        layout = self.layout
        ConflictBox = layout.row().box()

        HotkeyBox = layout.row().box()

        ku = bpy.context.window_manager.keyconfigs.user
        km = ku.keymaps.get('3D View')
        for i in km.keymap_items:
            if i.idname == "view3d.raycast_selection":
                rna_keymap_ui.draw_kmi([], ku, km, i, HotkeyBox, 0)
                FindConflict(ConflictBox, i)
Beispiel #25
0
 def draw(self, context):
     global ttr_keymaps
     layout = self.layout
     layout.label(text="Time Remapping Shortcuts: ")
     col = layout.column()
     kc = bpy.context.window_manager.keyconfigs.addon
     km = (kc.keymaps.new("Screen") if "Screen" not in kc.keymaps
                                         else kc.keymaps['Screen'])
     for km, kmi in ttr_keymaps:
         km = km.active()
         col.context_pointer_set("keymap", km)
         rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
Beispiel #26
0
    def draw_snap_utilities_km(kc, km, layout):
        layout.context_pointer_set("keymap", km)

        row = layout.row()
        row.prop(km, "show_expanded_items", text="", emboss=False)
        row.label(text=km.name, text_ctxt=i18n_contexts.id_windowmanager)

        if km.show_expanded_items:
            col = layout.column()

            for kmi in km.keymap_items:
                if "snap_utilities" in kmi.idname:
                    rna_keymap_ui.draw_kmi(["ADDON", "USER", "DEFAULT"], kc, km, kmi, col, 0)
Beispiel #27
0
def draw_hotkeys(col,km_name):
	kc = bpy.context.window_manager.keyconfigs.user
	for kmi in kmaps_3dview:
		km2=kc.keymaps[km_name]
		kmi2=[]
		for a,b in km2.keymap_items.items():
			if a==kmi:
				kmi2.append(b)
		
		if kmi2:
			for a in kmi2:
				col.context_pointer_set("keymap", km2)
				rna_keymap_ui.draw_kmi([], kc, km2, a, col, 0)
Beispiel #28
0
    def draw_snap_utilities_km(kc, km, layout):
        layout.context_pointer_set("keymap", km)

        row = layout.row()
        row.prop(km, "show_expanded_items", text="", emboss=False)
        row.label(text=km.name, text_ctxt=i18n_contexts.id_windowmanager)

        if km.show_expanded_items:
            col = layout.column()

            for kmi in km.keymap_items:
                if "snap_utilities" in kmi.idname:
                    rna_keymap_ui.draw_kmi(["ADDON", "USER", "DEFAULT"], kc, km, kmi, col, 0)
    def draw_keymaps(self, layout):
        row = layout.row()
        col = row.column()

        col.label(text="Keymap settings:")

        wm = bpy.context.window_manager
        kc = wm.keyconfigs.user
        km = kc.keymaps['Object Mode']
        col.context_pointer_set("keymap", km)
        for kmi in km.keymap_items:
            if is_addon_keymap(kmi):
                rna_keymap_ui.draw_kmi(["ADDON", "USER", "DEFAULT"], kc, km, kmi, col, 0)
        subcol = col.split(factor=0.2).column()
Beispiel #30
0
 def draw_keymaps(self, layout, context, module, key="addon_keymaps"):
     import rna_keymap_ui
     addon_keymaps = getattr(module, key, [])
     col = layout
     kc = context.window_manager.keyconfigs.addon
     for km, kmi in addon_keymaps:
         km = km.active()
         col.context_pointer_set("keymap", km)
         #kmi.name = kmi.name.encode('utf-8').strip()
         # TODO ERROR UTF decode error on kmi.name
         try:
             rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
         except:
             pass
Beispiel #31
0
 def draw_keymaps(self, layout, context, module, key="addon_keymaps"):
     import rna_keymap_ui
     addon_keymaps = getattr(module, key, [])
     col = layout
     kc = context.window_manager.keyconfigs.addon
     for km, kmi in addon_keymaps:
         km = km.active()
         col.context_pointer_set("keymap", km)
         #kmi.name = kmi.name.encode('utf-8').strip()
         # TODO ERROR UTF decode error on kmi.name
         try: 
             rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
         except:
             pass
Beispiel #32
0
    def draw_keymap_items(col, km_name, keymap, map_type, allow_remove):
        kc = bpy.context.window_manager.keyconfigs.user
        km = kc.keymaps.get(km_name)
        kmi_idnames = [km_tuple[1].idname for km_tuple in keymap]
        if allow_remove:
            col.context_pointer_set("keymap", km)

        kmis = [
            kmi for kmi in km.keymap_items
            if kmi.idname in kmi_idnames and kmi.map_type in map_type
        ]
        for kmi in kmis:
            rna_keymap_ui.draw_kmi(['ADDON', 'USER', 'DEFAULT'], kc, km, kmi,
                                   col, 0)
    def draw (self, context):
        layout=self.layout.column_flow(1) 

        box = layout.box().column(1) 
         
        row = box.row(1)  
        row.label("Show Customize Tools:")

        row = box.row(1)        

        if context.scene.CustomizeTools:   
            row.prop(context.scene,"CustomizeTools", text = "Customize Tools", icon="RESTRICT_VIEW_OFF" )
        else:
         row.prop(context.scene,"CustomizeTools", text = "Customize Tools", icon="RESTRICT_VIEW_ON" )

        if context.scene.QuadTools:   
            row.prop(context.scene,"QuadTools", text = "Quad View", icon="RESTRICT_VIEW_OFF" )
        else:
            row.prop(context.scene,"QuadTools", text = "Quad View", icon="RESTRICT_VIEW_ON" )

        if context.scene.ScreenTools:   
            row.prop(context.scene,"ScreenTools", text = "Full Screen", icon="RESTRICT_VIEW_OFF" )
        else:
            row.prop(context.scene,"ScreenTools", text = "Full Screen", icon="RESTRICT_VIEW_ON" )

        if context.scene.ShelfTools:   
            row.prop(context.scene,"ShelfTools", text = "View Shelfs", icon="RESTRICT_VIEW_OFF" )
        else:
            row.prop(context.scene,"ShelfTools", text = "View Shelfs", icon="RESTRICT_VIEW_ON" )
        

        box.separator() 
        
        box = layout.box().column(1) 

        row = box.row(1)  
        row.label("Show Editor in Menu:")
        
        row = box.column_flow(3)        
        row.prop(context.scene,"Menu3DView", text = "3D View", icon= 'VIEW3D')
        row.prop(context.scene,"MenuNodeEditor", text = "Node Editor", icon= 'NODETREE')
        row.prop(context.scene,"MenuImageEditor", text = "Image Editor", icon= 'IMAGE_COL')
        row.prop(context.scene,"MenuOutliner", text = "Outliner", icon= 'OOPS')
        row.prop(context.scene,"MenuProperties", text = "Properties", icon= 'BUTS')
        row.prop(context.scene,"MenuTextEditor", text = "Text Editor", icon= 'FILE_TEXT')
        row.prop(context.scene,"MenuGraphEditor", text = "Graph Editor", icon= 'IPO')
        row.prop(context.scene,"MenuDopeSheet", text = "Dope Sheet", icon= 'ACTION')
        row.prop(context.scene,"MenuTimeline", text = "Timeline", icon= 'TIME')
        row.prop(context.scene,"MenuNlaEditor", text = "Nla Editor", icon= 'NLA')
        row.prop(context.scene,"MenuLogicEditor", text = "Logic Editor", icon= 'LOGIC')
        row.prop(context.scene,"MenuSequenceEditor", text = "Sequence Editor", icon= 'SEQUENCE')
        row.prop(context.scene,"MenuMovieClip", text = "Movie Clip", icon= 'RENDER_ANIMATION')
        row.prop(context.scene,"MenuPythonConsole", text = "Python Console", icon= 'CONSOLE')
        row.prop(context.scene,"MenuInfo", text = "Info", icon= 'INFO')
        row.prop(context.scene,"MenuFileBrowser", text = "File Browser", icon= 'FILESEL')
        row.prop(context.scene,"MenuUserPreferences", text = "User Preferences", icon= 'PREFERENCES')

        box.separator() 
        
        box = layout.box()
                
        col = box.column()
        kc = bpy.context.window_manager.keyconfigs.addon
        for km, kmi in addon_keymaps:
            km = km.active()
            col.context_pointer_set("keymap", km)
            rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
Beispiel #34
0
def draw_keymap_item(km, kmi, kc, layout):
    if kmi:
        layout.context_pointer_set("keymap", km)
        rna_keymap_ui.draw_kmi([], kc, km, kmi, layout, 0)
Beispiel #35
0
    def draw(self, context):
        layout = self.layout
        
        col = layout.column(1)   

        box = col.box().column(1)                         

        box.separator()     

        row = box.row(1)
        row.prop(self, "prefs_tabs", expand=True)
       
        box.separator()   
     
        if self.prefs_tabs == 'path':

            box.separator()   
             
            row = box.column(1)
            row.label(text="Asset Library Path", icon="FILE_FOLDER")      
           
            row.separator()  
        
            row.prop(self, 'tap_display_project', text="(Un)Hide Project in 3D View")               
           
            box.separator()  

            row = box.column()                                                    
            row.prop(self, 'custom_library_path', text="")                                                        

            box.separator()   
             
            row = box.column(1)
            row.label(text="Project Library Path", icon="FILE_FOLDER")      
            
            box.separator()  

            row = box.column()                           
            row.prop(self, 'custom_library_path_project', text="")     

            box.separator()   
            box.separator()   


        if self.prefs_tabs == 'images':

            box.separator()   

            row = box.row(1)
            row.label(text="Thumbnail Color", icon="FILE_IMAGE")                     
            row.prop(self, 'render_scene', text="")

            box.separator() 

            row = box.row(1)
            row.label(text="Thumbnail Size", icon="ZOOM_ALL")                      
            row.prop(self, 'thumbnail_render_size', text="")

            box.separator()   
            box.separator()   


        if self.prefs_tabs == 'location':

            box.separator()   
             
            row = box.row(1)
            row.label(text="Panel Location", icon="ARROW_LEFTRIGHT")      
            row.prop(self, 'tab_location_asset', expand = True)          
      
            if self.tab_location_asset == 'tools':

                box.separator()   
                
                row = box.row(1)                     
                row.prop(self, "tools_category_asset", text="TAB")
                   
            box.separator()   
            box.separator()   


        if self.prefs_tabs == 'keys':

            wm = bpy.context.window_manager
            kc = wm.keyconfigs.user

            split = box.split()
            col = split.column()

            col.separator()         
                             
            col.prop(self, 'tab_keymap_project', text="Hotkey for Project")   

            col.separator() 
              
            km = kc.keymaps['3D View']
            kmi = get_hotkey_entry_item(km, 'view3d.asset_flinger_project', 'none', 'none')
            if kmi:
                col.context_pointer_set("keymap", km)
                rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
            else:
                col.label("No hotkey entry found / restore hotkeys in input tab")            
              
            km = kc.keymaps['3D View']
            kmi = get_hotkey_entry_item(km, 'export.asset_flinger_project', 'none', 'none')
            if kmi:
                col.context_pointer_set("keymap", km)
                rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
            else:
                col.label("No hotkey entry found / restore hotkeys in input tab")   

          
            col.separator() 
            col.separator()         
                             
       
            col.prop(self, 'tab_keymap_asset', text="Hotkey for Library")   
                          
            col.separator() 

            km = kc.keymaps['3D View']
            kmi = get_hotkey_entry_item(km, 'view3d.asset_flinger', 'none', 'none')
            if kmi:
                col.context_pointer_set("keymap", km)
                rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
            else:
                col.label("No hotkey entry found / restore hotkeys in input tab")        

            km = kc.keymaps['3D View']
            kmi = get_hotkey_entry_item(km, 'export.asset_flinger', 'none', 'none')
            if kmi:
                col.context_pointer_set("keymap", km)
                rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
            else:
                col.label("No hotkey entry found / restore hotkeys in input tab")             

 
            col.separator()   
            col.separator()   


            col.prop(self, 'tab_popup_menu', text="Hotkey for Popup Menu")          

            col.separator()   
                 
            km = kc.keymaps['3D View']
            kmi = get_hotkey_entry_item(km, 'wm.call_menu', 'VIEW3D_TP_AssetFlinger_Menu', 'name')
            if kmi:
                col.context_pointer_set("keymap", km)
                rna_keymap_ui.draw_kmi([], kc, km, kmi, col, 0)
            else:
                col.label("No hotkey entry found / restore hotkeys in input tab")   
 
          
            col.separator()  
            col.separator()  

            col.prop(self, 'tab_menu_append', text="Append to Add Menu [CTRL+A]")

            col.separator()

            col.prop(self, 'tab_header_project', text="Header Buttons: Project")
            col.prop(self, 'tab_header_library', text="Header Buttons: Library")

            col.separator()

        
            # TIP #        

            row = layout.column(1)            
            row.label(text='Do not remove hotkeys, disable them instead.', icon ="INFO")           
            row.label(text="For KeyChange go to > User Preferences > Tab: Input", icon ="BLANK1")

            row = layout.column(1) 
            row.label(text="1 > Change search to key-bindig and insert the hotkey, eg. menu: ctrl shift alt w", icon ="BLANK1")
            row.label(text="2 > Under 3D View you find the call menu, name: VIEW3D_TP_AssetFlinger_Menu !", icon ="BLANK1")
            row.label(text="3 > Choose a new key configuration and save user settings !", icon ="BLANK1")

            box.separator()  

            row = layout.row(1)             
            row.label(text="! Or change the key in the keymap!", icon ="INFO")
            row.operator("tp_ops.keymap_assetflinger", text = 'Open KeyMap (Text Editor)   ')
            row.operator('wm.url_open', text = 'Type of Events (WEB)').url = "https://lh3.googleusercontent.com/zfNKbUKpnvLTPADu4btQI_adXhkR9iPiSyy31ZvP89YNK6YSiLf4iVC3lpzN76DTdEdHHIZqZK6qM2OYRSAeFRlIof5xHC0wLQtOaCwYEKi43A6W9KGkGAwnlNGqUugQdleEHTMLZnL67u4m6kU1KTKlFASfyDuFCCvdyGGaa5-gZ9kib1AiJ_2exgWvRh1yM86PehsJH65Zp0r6x5zhqZpLI1IS9K-zlyvaKg_WgYuVMzvsd3JrB2BAo-BIZGX9MFA8t-CC3qVtTLXH8WAkHo9IyA1u7GnlCM5p9wffwpu1NhCsZTuQwPnn0BGmOCD0tPCm_LJSJSDyCtkfBXvK_hdsQ3XM0Jcttl1oHJKYqbPoIjHMaLl7pNGmwMhcjlgPqXMq01Eln0wm6NHbJyTe5WMBN7FaB0WEaot7V9TsFxACRJzD2dJu-zP7xJ_vw6sMlYcXLf962SkzRShIMTJiBzSxui5sRJ1uKPCehcdP4E3pEc1tIFO1dQZTSwrLf9luz1S79zCflUCgJFWa8GfN4KGWG09mO4jUBJIdtobsDeM_NPyvraz6Lq4OTz90zgQQ1cxTzQ49MzYcIesnrw7TE2Ilr7UTkOpuoxL4rPw=w696-h1278-no"            

            box.separator() 
            
            row = layout.row(1)               
            row.label(text="! Use the 'is key free' addon under User Interface to finde a free shortcut !", icon ="INFO")
        
            box.separator()  
            box.separator()  
       
       

        if self.prefs_tabs == 'url':        

            box.separator()  
            
            row = box.row()
            row.operator('wm.url_open', text = 'Asset Flinger', icon = 'INFO').url = "https://github.com/BlenderAid/Asset-Flinger"
            row.operator('wm.url_open', text = 'v0.3 Fork', icon = 'INFO').url = "https://github.com/black-h0bB1T/Asset-Flinger"
            row.operator('wm.url_open', text = 'ToolPlus', icon = 'INFO').url = "https://github.com/mkbreuer/ToolPlus"
        
            box.separator()  
            box.separator()