示例#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):
    cc.deleteAllUi(op)  # to delete all existing ui
    mouse_x, mouse_y = cc.mouse_xy(op)
    btn_height, btn_width = 50, 200

    rd = RectData(mouse_x, mouse_y - 50, btn_width, btn_height)

    btn_title = cc.button(op, rd, text='Title Bar')

    space = 10

    rd = rd.getBottom(space)

    cc.button(
        op,
        rd,
        text='button 1',
        buttonData=onClick,
        parent=btn_title,
        canDrag=False,
    )

    rd = rd.getBottom(space)

    cc.button(
        op,
        rd,
        text='button 2',
        buttonData=onClick,
        parent=btn_title,
        canDrag=False,
    )
示例#3
0
def ui_elements(op: Boss_OT_base_ui):
    UICreator.deleteAllUi(op)  #  delete any existing UI

    o = bpy.context.object

    mouse_x, mouse_y = UICreator.mouse_xy(op)

    rd = (mouse_x, mouse_y - 25, 200, 25)

    UICreator.textField(op, rd, text=o.name, param=o, onValueChange=renameObj)
示例#4
0
def ui_elements(op):
    UICreator.deleteAllUi(op)  # to delete all existing ui

    btn_width, btn_height = 100, 40

    mouse_x, mouse_y = UICreator.mouse_xy(op)

    rd = (mouse_x, mouse_y - btn_height, btn_width, btn_height)

    UICreator.button(op, rd, 'btn_text', onClick)
示例#5
0
def ui_elements(op):
    UICreator.deleteAllUi(op)
    mouse_x, mouse_y = UICreator.mouse_xy(op)

    rd = RectData(mouse_x,mouse_y-50,200,50)
    btn_title = UICreator.button(op,rd,'Turntable')

    rd = rd.getBottom(5)
    if_frame_start = UICreator.intField(
        op,rd,1,parent=btn_title,canDrag=False,ttt='start frame')

    rd = rd.getBottom(5)

    if_frame_end = UICreator.intField(
        op, rd, 150,parent=btn_title,canDrag=False,ttt='end frame')

    rd = rd.getBottom(5)

    param = if_frame_start, if_frame_end
    btn_create = UICreator.button(
        op, rd, 'Create', turnTable, param=param, parent=btn_title, canDrag=False)
示例#6
0
def ui_elements(op):
    cc.deleteAllUi(op)  # to delete all existing ui
    mouse_x, mouse_y = cc.mouse_xy(op)
    btn_height, btn_width = 50, 200

    rd = RectData(mouse_x, mouse_y - 50, btn_width, btn_height)

    btn_title = cc.button(op, rd, text='Title Bar',
                                 ttt='This is a button, you can drag it'
                                 )

    space = 0#10

    rd = rd.getBottom(space)

    cc.button(
        op,rd,
        text='text',
        buttonData=onClick,
        parent = btn_title,
        canDrag = False,
        ttt='This is a button'
    )

    rd = rd.getBottom(space)
    cc.textField(
        op,rd,
        onTextChange=onTextField_TextChanged,
        onValueChange=onTextField_ValueChanged,
        onEnterPress=onTextField_EnterPressed,
        parent = btn_title,
        canDrag = False,
        ttt='This is a TextField'
    )

    rd = rd.getBottom(space)
    cc.intField(
        op,rd,
        value=1,
        onTextChange=onTextChange,
        onValueChange=onValueChange,
        onEnterPress=onEnterPress,
        parent = btn_title,
        canDrag = False,
        ttt='This is a IntField'

    )

    rd = rd.getBottom(space)
    cc.floatField(
        op,rd,
        value=0.0,
        onTextChange=onTextChange,
        onValueChange=onValueChange,
        onEnterPress=onEnterPress,
        parent = btn_title,
        canDrag = False,
        ttt='This is a FloatField'
    )

    rd = rd.getBottom(space)
    cc.checkBox(
        op,rd,
        text='text',
        value=True,
        onValueChange=onValueChange,
        parent = btn_title,
        canDrag = False,
        ttt='This is a Checkbox(boolean)'
    )
    rd = rd.getBottom(space)

    cc.vectorBooleanField(
        op,rd,
        value=(True, False, True),
        onValueChange=onValueChange,
        parent = btn_title,
        canDrag = False,
        ttt='This is VectorBooleanField'
    )

    rd = rd.getBottom(space)

    cc.vectorFloatField(
        op,rd,
        value=(0.0, 0.0, 0.0),
        onValueChange=onValueChange,
        onTextChange=onTextChange,
        onEnterPress=onEnterPress,
        parent = btn_title,
        canDrag = False,
        ttt='This is VectorFloatField'
    )

    rd = rd.getBottom(space)

    cc.vectorIntField(
        op, rd,
        value=(0, 0, 0),
        onValueChange=onValueChange,
        onTextChange=onTextChange,
        onEnterPress=onEnterPress,
        parent = btn_title,
        canDrag = False,
        ttt='This is VectorIntField'
    )