def ui_elements(op: Boss_OT_base_ui): # UICreator.deleteAllUi(op) # to delete all existing ui btn_width, btn_height = 150, 40 space = 10 rd = RectData(op.uip.mouse_x, op.uip.mouse_y - btn_height, btn_width, btn_height) vbf = UICreator.vectorBooleanField(op, rectData=rd, value=(True, False, True), onValueChange=onValueChanged, param='This can be any python object') # can also be used # vbf.add_onValueChange(onValueChanged) rd = rd.getBottom(space) vff = UICreator.vectorFloatField(op, rectData=rd, value=(0.0, 0.0, 0.0), onValueChange=onValueChanged, onTextChange=onTextChanged, onEnterPress=onEnterPressed, param='This can be any python object') # can also be used # vff.add_onTextChange(onTextChanged) # vff.add_onValueChange(onValueChanged) # vff.add_onEnterPress(onEnterPressed) rd = rd.getBottom(space) vif = UICreator.vectorIntField( op, rectData=rd, value=(0, 0, 0), # can also be used # onValueChange=onValueChanged, # onTextChange=onTextChanged, # onEnterPress=onEnterPressed, param='This can be any python object') vif.add_onTextChange(onTextChanged) vif.add_onValueChange(onValueChanged) vif.add_onEnterPress(onEnterPressed)
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' )
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 )