Example #1
0
def _build_add_robot_frame(parent_layout):
    # Create frame layout with one column
    add_robot_frame = pm.frameLayout(label="Add Robot", collapsable=True)
    add_robot_col = pm.columnLayout(adj=True, columnAttach=('both', 5))
    pm.separator(height=5, style='none')

    # Create list of robots
    pm.rowLayout(numberOfColumns=2,
                 adjustableColumn=1,
                 columnAttach=(1, 'left', 3),
                 columnWidth=[(1, 158), (2, 45)],
                 height=20)

    pm.optionMenu('robotImportList')

    rigs = general_utils.get_rigs_dict()
    rig_names = general_utils.get_rigs_names(rigs)
    for rig_name in rig_names:
        pm.menuItem(label=rig_name)

    pm.button(label=' Add ',
              command=add_robot,
              width=45,
              height=20,
              annotation='Imports selected robot into the scene')

    pm.setParent(add_robot_frame)

    pm.separator(style='none')
    pm.setParent(parent_layout)
Example #2
0
def _build_add_robot_frame(parent_layout):
    # Create frame layout with one column
    add_robot_frame = pm.frameLayout(label="Add Robot", collapsable=True)
    add_robot_col = pm.columnLayout(adj=True, columnAttach=('both', 5))
    pm.separator(height=5, style='none')

    # Create list of robots
    pm.rowLayout(numberOfColumns=2,
                 adjustableColumn=1,
                 columnAttach=(1, 'left', 3),
                 columnWidth=[(1, 158), (2, 45)],
                 height=20)

    pm.optionMenu('robotImportList')

    rigs = general_utils.get_rigs_dict()
    rig_names = general_utils.get_rigs_names(rigs)
    for rig_name in rig_names:
        pm.menuItem(label=rig_name)

    # Get required rigs directories
    dir_mimic = general_utils.get_mimic_dir()
    dir_rigs = dir_mimic + '/rigs'
    add_robot_command_string = \
        'import mimic_utils; reload(mimic_utils); ' \
        'mimic_utils.import_robot("{}"); ' \
        'mimic_utils.add_mimic_script_node(); ' \
        'mimic_utils.add_hud_script_node()' \
            .format(dir_rigs)

    pm.button(label=' Add ',
              command=add_robot_command_string,
              width=45,
              height=20,
              annotation='Imports selected robot into the scene')

    pm.setParent(add_robot_frame)

    pm.separator(style='none')
    pm.setParent(parent_layout)