Ejemplo n.º 1
0
def duplicate_guide_ctx(ui):
    global SCALP
    global DESCRIPTION
    if cmds.draggerContext(_DUPLICATE_GUIDE_CTX, exists=True):
        cmds.deleteUI(_DUPLICATE_GUIDE_CTX)

    name = ui.xgen_description_lineEdit.text()
    if not name:
        pm.displayWarning("No Xgen IGS description selected")
        return

    if not pm.selected():
        pm.displayWarning("Nothing selected to duplicate")
        return

    DESCRIPTION = xgen_handler.get_description(name)
    SCALP = xgen_handler.get_scalp(DESCRIPTION)

    cmds.draggerContext(
        _DUPLICATE_GUIDE_CTX,
        pressCommand=partial(duplicate_guide_rig, ui),
        dragCommand=partial(drag_guide_rig, ui, _DUPLICATE_GUIDE_CTX),
        releaseCommand=release_guide_rig,
        name=_DUPLICATE_GUIDE_CTX,
        cursor='crossHair',
        undoMode='step')
    cmds.setToolTo(_DUPLICATE_GUIDE_CTX)
Ejemplo n.º 2
0
def draw_guide_ctx(ui):
    global SCALP
    global DESCRIPTION
    if cmds.draggerContext(_DRAW_GUIDE_CTX, exists=True):
        cmds.deleteUI(_DRAW_GUIDE_CTX)

    name = ui.xgen_description_lineEdit.text()
    DESCRIPTION = xgen_handler.get_description(name)
    SCALP = xgen_handler.get_scalp(DESCRIPTION)

    cmds.draggerContext(
        _DRAW_GUIDE_CTX,
        pressCommand=partial(draw_guide_rig, ui),
        dragCommand=partial(drag_guide_rig, ui, _DRAW_GUIDE_CTX),
        releaseCommand=release_guide_rig,
        name=_DRAW_GUIDE_CTX,
        cursor='crossHair',
        undoMode='step')
    cmds.setToolTo(_DRAW_GUIDE_CTX)
Ejemplo n.º 3
0
def toggle_scalp_visibility(ui):
    name = ui.xgen_description_lineEdit.text()
    description = xgen_handler.get_description(name)
    if description:
        scalp = xgen_handler.get_scalp(description)
        attribute.toggle_bool_attr(scalp.visibility)