Пример #1
0
def ui_elements(op: Boss_OT_base_ui):
    UICreator.deleteAllUi(op)

    global sels
    sels = bpy.context.selected_objects

    mouse_x,mouse_y = UICreator.mouse_xy(op)

    initX = mouse_x
    initY = mouse_y

    rd = RectData(
        initX,
        initY - element_height,
        element_width,
        element_height
    )

    reg_height = UICreator.rr(op).height - screen_margin[1]

    for o in sels:
        rd = rd.getTop(5)
        if rd.yMax > reg_height:
            initX += (element_width + element_space)
            rd.setPosition(initX, screen_margin[0])

        RTextField(op, rd, value=o.name, param=o, onValueChange=renameObj)

    bpy.ops.object.select_all(action='DESELECT')
Пример #2
0
def ui_elements(op):
    UICreator.deleteAllUi(op)  # to delete all existing ui

    btn_width, btn_height = 100, 40

    rr = UICreator.rr(op)  # region_rect:rr

    rd = (rr.width / 2 - btn_width / 2, rr.height / 2 - btn_height / 2,
          btn_width, btn_height)

    UICreator.button(op, rd, 'text', onClick)
Пример #3
0
def ui_elements(op):
    UICreator.deleteAllUi(op)  # to delete all existing ui
    btn_width, btn_height = 100, 40

    rr = UICreator.rr(op)  # region_rect(rr)

    rd = (rr.width / 2 - btn_width / 2, rr.height / 2 - btn_height / 2,
          btn_width, btn_height)
    UICreator.textField(op,
                        rectData=rd,
                        text='Cube',
                        onEnterPress=onEnterPress)
Пример #4
0
def ui_elements(op: Boss_OT_base_ui):
    UICreator.deleteAllUi(op)

    sel_obj = create_grid()

    fv = FieldValue(value=(3, 3, 1),
                    min=(0, 0, 0),
                    max=(10, 10, 10),
                    changeBy=(1, 1, 1))
    vif_cnt = UICreator.vectorIntField(op,
                                       RectData(100,
                                                UICreator.rr(op).height - 150,
                                                200, 50),
                                       value=fv,
                                       onValueChange=onCountChanged,
                                       param=sel_obj)

    UICreator.button(op,
                     vif_cnt.rectData.getBottom(5),
                     text='Apply',
                     buttonData=apply_mods,
                     param=sel_obj)
Пример #5
0
def ui_elements(op: Boss_OT_base_ui):
    UICreator.deleteAllUi(op)  # to delete all existing ui
    btn_width, btn_height = 150, 40
    space = 10
    rr = UICreator.rr(op)
    rd = RectData(
        op.uip.mouse_x,
        rr.height - 150,
        # op.uip.mouse_y - btn_height,
        btn_width,
        btn_height
    )

    UICreator.button(
        op=op,
        rectData=rd,
        text='btn_text',
        buttonData=None,
        ttt='button tooltip',
        tti=r'C:\Users\abc\Desktop\boss_location.png',
        canDrag=True,
        parent=None,
        rectIsLocal=False,
        param=None
    )

    rd = rd.getBottom(space)
    UICreator.textField(
        op,
        rectData=rd,
        onTextChange=onTextField_TextChanged,
        onValueChange=onTextField_ValueChanged,
        onEnterPress=onTextField_EnterPressed,
        ttt='This is tool_tip_text (ttt)',
        tti=r'C:\Users\abc\Desktop\boss_location.png',
        canDrag=True,
        parent=None,
        rectIsLocal=False
    )

    rd = rd.getBottom(space)
    UICreator.intField(
        op,
        rectData=rd,
        value=1,
        onTextChange=onTextChange,
        onValueChange=onValueChange,
        onEnterPress=onEnterPress,
        ttt='This is tool_tip_text (ttt)',
        tti=r'C:\Users\abc\Desktop\boss_location.png',
        canDrag=True,
        parent=None,
        rectIsLocal=False

    )

    rd = rd.getBottom(space)
    UICreator.floatField(
        op,
        rectData=rd,
        value=0.0,
        onTextChange=onTextChange,
        onValueChange=onValueChange,
        onEnterPress=onEnterPress,
        ttt= 'This is tool_tip_text (ttt)',
        tti = r'C:\Users\abc\Desktop\boss_location.png',
        canDrag = True,
        parent = None,
        rectIsLocal = False
    )

    rd = rd.getBottom(space)
    UICreator.checkBox(
        op=op,
        rectData=rd,
        text='checkBox',
        value=False,
        onValueChange=None,
        ttt='checkBox',
        tti=r'C:\Users\abc\Desktop\boss_location.png',
        canDrag=True,
        parent=None,
        rectIsLocal=False,
        param=None
    )
    rd = rd.getBottom(space)

    UICreator.vectorBooleanField(
        op,
        rectData=rd,
        value=(True, False, True),
        onValueChange=onValueChange,
        ttt='This is tool_tip_text (ttt)',
        tti=r'C:\Users\abc\Desktop\boss_location.png',
        canDrag=True,
        parent=None,
        rectIsLocal=False

    )

    rd = rd.getBottom(space)

    UICreator.vectorFloatField(
        op,
        rectData=rd,
        value=(0.0, 0.0, 0.0),
        onValueChange=onValueChange,
        onTextChange=onTextChange,
        onEnterPress=onEnterPress,
        ttt='This is tool_tip_text (ttt)',
        tti=r'C:\Users\abc\Desktop\boss_location.png',
        canDrag=True,
        parent=None,
        rectIsLocal=False
    )

    rd = rd.getBottom(space)

    UICreator.vectorIntField(
        op,
        rectData=rd,
        value=(0, 0, 0),
        onValueChange=onValueChange,
        onTextChange=onTextChange,
        onEnterPress=onEnterPress,
        ttt='This is tool_tip_text (ttt)',
        tti=r'C:\Users\abc\Desktop\boss_location.png',
        canDrag=True,
        parent=None,
        rectIsLocal=False
    )