0
$\begingroup$

i was using a pie_menu previously but decided to switch to a panel to make use of the "keep_open" property

after converting the UI to work with a panel i noticed the ui_units and ui_scale don't affect anything, even tho this exact same ui resized to the proper values that were set when it was in a pie_menu

while the ui_units/scale_y seems to be functioning, the ui_units/scale_x seems to do nothing and adding other elements on the same row sends everything down a row as if it was auto-wrapping at a certain x size, nowhere is any kind of wrapping being set, is this a bug or a limitation?

the words are too common to search and lead to object size/scale, so I'm unable to even look it up myself

even the simplified version seems to auto cut/wrap at an unchangeable ui_units_x size here is the code to copy paste in the script editor:

import bpy

class Alx_MT_AlexandriaToolPanel(bpy.types.Panel):
    bl_label = "Alexandria Tool Panel"
    bl_idname = "alx_panel_alexandria_tool"

    bl_region_type = "UI"
    bl_space_type = "VIEW_3D"

    @classmethod
    def poll(cls, context):
        return True

    def draw(self, context):
        AlxLayout = self.layout
        AlexandriaToolPanel = AlxLayout.box()
        AlexandriaToolPanel.ui_units_x = 20.0
        AlexandriaToolPanel.ui_units_y = 20.0
        AlexandriaToolPanel.label(text="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
        
addon_keymaps = []

def AlxKeymapRegister(KeymapType, itemidname, key, useshift=False, usectrl=False, usealt=False, triggertype="PRESS"):
    """KeyMapType: [PANEL, PIE]"""
    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:

        CallType = ""
        if (KeymapType == "PANEL"):
            CallType = "wm.call_panel"
        if (KeymapType == "PIE"):
            CallType = "wm.call_menu_pie"
        if (KeymapType == "OPERATOR"):
            CallType = itemidname

        if (CallType != ""):
            km = kc.keymaps.new(name='3D View', space_type='VIEW_3D')
            kmi = km.keymap_items.new(CallType, type=key, shift=useshift, ctrl=usectrl, alt=usealt, value=triggertype)
            if (KeymapType in ["PANEL", "PIE"]):
                kmi.properties.name = itemidname
            addon_keymaps.append((km, kmi))
        
def register():
    bpy.utils.register_class(Alx_MT_AlexandriaToolPanel)

    AlxKeymapRegister(KeymapType="PANEL", itemidname=Alx_MT_AlexandriaToolPanel.bl_idname, key="A", usectrl=True, usealt=True, triggertype="CLICK")

def unregister():
    bpy.utils.unregister_class(Alx_MT_AlexandriaToolPanel)



    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

if __name__ == "__main__":
    register()

This is the result of a test with the actual addon, although the value is set to 20 it shows as ~5

$\endgroup$

0

You must log in to answer this question.

Browse other questions tagged .