Exemplo n.º 1
0
def main(file_name, local):
    logger = logging.getLogger("Hair start")
    new_file.new_file()
    # copy low mdl publish file as mdl file
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    entity_type = context.entity_type
    asset_type = context.asset_type
    asset_name = context.asset_name
    asset_type_short_name = context.asset_type_short_name
    yeti_name = "%s_%s_pgYetiMaya" % (asset_type_short_name, asset_name)
    create_yeti_node(asset_type_short_name, asset_name)
    mdl_publish_file = pipeFile.get_task_publish_file(project, entity_type,
                                                      asset_type, asset_name,
                                                      "HighMdl", "HighMdl")
    if not os.path.isfile(mdl_publish_file):
        logger.warning("No mdl file published.")
        quit_maya.quit_maya()
        return
    create_reference.create_reference(mdl_publish_file)
    create_hair_group(asset_type_short_name, asset_name)
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 2
0
def main(file_name, local):
    logger = logging.getLogger("Lookdev start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    entity_type = context.entity_type
    asset_type = context.asset_type
    asset_name = context.asset_name
    # reference in Shd
    shd_publish_file = pipeFile.get_task_publish_file(project, entity_type,
                                                      asset_type, asset_name,
                                                      "Shd", "Shd")
    if not os.path.isfile(shd_publish_file):
        logger.info("%s is not an exist file" % shd_publish_file)
        return
    create_reference.create_reference(shd_publish_file, asset_name)
    logger.info("reference shd done.")
    # import hair
    load_plugin.load_plugin("xgenToolkit.mll")
    mel.eval("XgCreateDescriptionEditor;")
    publish_file = pipeFile.get_task_file(project, asset_type, asset_name,
                                          "Hair", "Hair", "maya_asset_publish",
                                          "")
    context = pipeFile.PathDetails.parse_path(publish_file)
    import_xgen_hair(context, "hair")
    logger.info("import hair done.")
    # reference turn table
    reference_turntable()
    logger.info("reference turntable done.")
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 3
0
def main(file_name, local):
    logger = logging.getLogger("LgtLay start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    save_as.save_as(file_name)
    # create Light group
    import_lights(context)
    logger.info("Import light done.")
    # AR set
    rebuild_scene()
    logger.info("Rebuild scene done.")
    # switch to midmdl
    assemb = Assembly.Assembly()
    assemb.set_active("MidMdl")
    # get the AnimLay cache
    abc_files = get_cache_files(context)
    if abc_files:
        for abc_file in abc_files:
            if abc_file.endswith("env.abc"):
                continue
            namespace = os.path.splitext(os.path.basename(abc_file))[0]
            create_reference.create_reference(abc_file, namespace)
    logger.info("Reference cache done.")
    # fix frame range
    fix_frame_range.fix_frame_range(context)
    logger.info("Fix frame range done.")

    # set resolution
    resolution = Project(context.project).resolution
    set_image_size.set_image_size(*resolution)
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 4
0
def main(file_name, local):
    logger = logging.getLogger("Hair start")
    new_file.new_file()
    # copy low mdl publish file as mdl file
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    entity_type = context.entity_type
    asset_type = context.asset_type
    asset_name = context.asset_name
    # reference in mdl publish file
    asset_type_short_name = context.asset_type_short_name
    mdl_publish_file = pipeFile.get_task_publish_file(project, entity_type,
                                                      asset_type, asset_name,
                                                      "HighMdl", "HighMdl")
    if not os.path.isfile(mdl_publish_file):
        logger.warning("No mdl file published.")
        quit_maya.quit_maya()
        return
    create_reference.create_reference(mdl_publish_file)
    # create sculp group
    sculp_group = "%s_%s_SCULP" % (asset_type_short_name, asset_name)
    create_group.create_group(sculp_group)
    if local:
        create_project.create_project(os.path.dirname(file_name))
    # create project
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 5
0
def main(file_name, local):
    logger = logging.getLogger("MidRig start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    entity_type = context.entity_type
    asset_type = context.asset_type
    asset_type_short_name = context.asset_type_short_name
    asset_name = context.asset_name
    task = context.task
    MidMdl_publish_file = pipeFile.get_task_publish_file(
        project, entity_type, asset_type, asset_name, "MidMdl", "MidMdl")
    if not os.path.isfile(MidMdl_publish_file):
        logger.warning("No MidMdl file published.")
        quit_maya.quit_maya()
        return
    create_reference.create_reference(MidMdl_publish_file)
    model_name = "%s_%s_MODEL" % (asset_type_short_name, asset_name)
    # create root group
    root_group_name = "%s_%s_ROOT" % (asset_type_short_name, asset_name)
    create_group.create_group(root_group_name)
    # create _BLENDS group
    blends_group = "_BLENDS"
    create_group.create_group(blends_group)
    if asset_type == "Character":
        rig_group_name = "Grp_Master_Ctl"
        create_group.create_group("Others", root_group_name)
        create_group.create_group("Geometry", root_group_name)
        create_group.create_group(model_name, blends_group)
    elif asset_type in ["Prop", "Cprop", "Building"]:
        rig_group_name = "%s_%s_RIG" % (asset_type_short_name, asset_name)
        create_group.create_group(model_name, root_group_name)
        create_group.create_group(rig_group_name)
        if asset_type in ["Prop", "Building"]:
            bounding = mc.xform(model_name, q=1, bb=1)
            max_value = max(abs(bounding[0]), abs(bounding[2]),
                            abs(bounding[3]), abs(bounding[5]))
            radius = max_value * 1.1
            center = mc.xform(model_name, q=1, sp=1, ws=1)
            circle_list = mc.circle(c=center,
                                    nr=[0, 1, 0],
                                    r=radius,
                                    name="%s_%s_Ctl" %
                                    (asset_type_short_name, asset_name))
            circle_name = circle_list[0]
            constraint_parent = mc.parentConstraint(circle_name,
                                                    model_name,
                                                    maintainOffset=True)
            constraint_scale = mc.scaleConstraint(circle_name,
                                                  model_name,
                                                  maintainOffset=True)
            mc.parent(constraint_parent, rig_group_name)
            mc.parent(constraint_scale, rig_group_name)
            mc.parent(circle_name, rig_group_name)
    create_group.create_group(rig_group_name, root_group_name)
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 6
0
def main(file_name, local):
    logger = logging.getLogger("Set start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    sequence = context.sequence
    create_group.create_group("%s_env" % sequence)
    # create network node
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 7
0
Arquivo: Group.py Projeto: jonntd/mira
def main(file_name, local):
    logger = logging.getLogger("Group start")
    new_file.new_file()
    # copy low mdl publish file as mdl file
    context = pipeFile.PathDetails.parse_path(file_name)
    asset_name = context.asset_name
    asset_type_short_name = context.asset_type_short_name
    model_name = "%s_%s_GROUP" % (asset_type_short_name, asset_name)
    # create default group
    mc.group(name=model_name, empty=1)
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 8
0
def create_shot_ad(context):
    ad_path = context.definition_path
    if os.path.isfile(ad_path):
        return
    ad_node_name = "%s_%s_AD" % (context.sequence, context.shot)
    if not os.path.isfile(context.publish_path):
        logger.error("%s is not an exist file" % context.publish_path)
        return
    new_file.new_file()
    rename_scene.rename_scene(ad_path)
    assemb = Assembly.Assembly()
    name = context.step
    node = assemb.create_assembly_node(ad_node_name, "assemblyDefinition")
    assemb.create_representation(node, "Scene", name, name, context.publish_path)
    save_file.save_file()
Exemplo n.º 9
0
def auto_publish(context, change_task_status):
    # copy image
    publish.copy_image_and_video(context)
    logger.info("Copy image and video done.")
    # import all reference
    publish.reference_opt()
    logger.info("Import reference done.")
    # export needed
    if context.step in ["MidRig", "HighRig"]:
        publish.export_need_to_publish(context)
        logger.info("Export to publish path done.")
    else:
        save_as.save_as(context.publish_path)
    # post publish
    post_publish(context, change_task_status)
    # open current file
    new_file.new_file()
Exemplo n.º 10
0
def main(file_name, local):
    logger = logging.getLogger("MainLgt start")
    new_file.new_file()
    create_group.create_group("Lights")
    # AR set AD file
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    sequence = context.sequence
    set_ad_file = pipeFile.get_task_file(project, sequence, "c000", "Set", "Set", "maya_shot_definition", "")
    assemb = Assembly.Assembly()
    node = assemb.reference_ad("%s_c000_set" % sequence, set_ad_file)
    create_group.create_group("Env")
    mc.parent(node, "Env")
    # set Shd active
    assemb.set_active("Shd")
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 11
0
Arquivo: Lgt.py Projeto: jonntd/mira
def main(file_name, local):
    logger = logging.getLogger("Lgt start")
    load_plugin.load_plugin("AbcImport.mll")
    load_plugin.load_plugin("MayaExocortexAlembic.mll")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    save_as.save_as(file_name)
    # create Light group
    import_lights(context)
    logger.info("Import light done.")
    # rebuild scene
    rebuild_scene()
    logger.info("Rebuild scene done.")
    # edit shd
    edit_shd(context)
    logger.info("Edit shd done.")
    # rebuild asset
    rebuild_asset(context)
    logger.info("Rebuild asset done.")
    # transfer attribute
    transfer_attribute.transfer_attribute()
    logger.info("Transfer attribute done.")
    # break visibility connections
    break_visibility_connections.break_visibility_connections()
    # reference camera
    reference_in_camera(context)
    # group assets
    group_assets()
    group_camera(file_name)
    # # assembly switch to shd
    # assembly = Assembly.Assembly()
    # assembly.set_active("Shd")
    # fix frame range
    fix_frame_range.fix_frame_range(context)
    logger.info("Fix frame range done.")
    # set resolution
    resolution = Project(context.project).resolution
    set_image_size.set_image_size(*resolution)
    save_as.save_as(file_name)
    logger.info("Publish done.")
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 12
0
Arquivo: Shd.py Projeto: jonntd/mira
def main(file_name, local):
    logger = logging.getLogger("shd start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    entity_type = context.entity_type
    asset_type = context.asset_type
    asset_name = context.asset_name
    mdl_publish_file = pipeFile.get_task_publish_file(project, entity_type,
                                                      asset_type, asset_name,
                                                      "HighMdl", "HighMdl")
    if not os.path.isfile(mdl_publish_file):
        logger.warning("No model file published.")
        quit_maya.quit_maya()
        return
    create_reference.create_reference(mdl_publish_file)
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 13
0
Arquivo: Anim.py Projeto: jonntd/mira
def main(file_name, local):
    logger = logging.getLogger("Anim start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    sequence = context.sequence
    shot = context.shot
    task = "AnimLay" if context.task == "Anim" else context.task
    lay_publish_file = pipeFile.get_task_publish_file(project, "Shot", sequence, shot, "AnimLay", task)
    if not os.path.isfile(lay_publish_file):
        logger.warning("%s is not an exist file" % lay_publish_file)
        if local:
            return
        else:
            quit_maya.quit_maya()
    copy.copy(lay_publish_file, file_name)
    logger.info("copy %s to %s" % (lay_publish_file, file_name))
    if local:
        open_file.open_file(file_name)
    else:
        quit_maya.quit_maya()
Exemplo n.º 14
0
def main(file_name, local):
    logger = logging.getLogger("AnimLay start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    seq = context.sequence
    shot = context.shot
    # create camera
    create_camera(seq, shot)
    logger.info("Create camera done.")
    # reference env
    reference_in_env(context)
    logger.info("Reference env done.")
    # create_references_group
    create_references_group()
    logger.info("Create reference group done.")
    # fix frame range
    fix_frame_range.fix_frame_range(context)
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 15
0
def main(file_name, local):
    logger = logging.getLogger("HighMdl start")
    new_file.new_file()
    # copy low mdl publish file as mdl file
    context = pipeFile.PathDetails.parse_path(file_name)
    project = context.project
    entity_type = context.entity_type
    asset_type = context.asset_type
    asset_name = context.asset_name
    MidMdl_publish_file = pipeFile.get_task_publish_file(
        project, entity_type, asset_type, asset_name, "MidMdl", "MidMdl")
    logger.info("MidMdl publish file: %s" % MidMdl_publish_file)
    if not os.path.isfile(MidMdl_publish_file):
        logger.warning("No MidMdl file published.")
        if not local:
            quit_maya.quit_maya()
        return
    open_file.open_file(MidMdl_publish_file)
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()
Exemplo n.º 16
0
def main(file_name, local):
    logger = logging.getLogger("MidMdl start")
    new_file.new_file()
    context = pipeFile.PathDetails.parse_path(file_name)
    asset_type = context.asset_type
    asset_name = context.asset_name
    asset_type_short_name = context.asset_type_short_name
    model_name = "%s_%s_MODEL" % (asset_type_short_name, asset_name)
    # create default group
    mc.group(name=model_name, empty=1)
    poly_group = "%s_%s_POLY" % (asset_type_short_name, asset_name)
    create_group.create_group(poly_group, model_name)
    backup_group = "%s_%s_BACKUP" % (asset_type_short_name, asset_name)
    create_group.create_group(backup_group, model_name)
    if asset_type == "Character":
        hair_mdl_grp = "hair_model_grp"
        create_group.create_group(hair_mdl_grp, backup_group)
        brow_grp = "brow_grp"
        create_group.create_group(brow_grp, backup_group)
        left_brow_grp = "left_brow_grp"
        create_group.create_group(left_brow_grp, brow_grp)
        right_brow_grp = "right_brow_grp"
        create_group.create_group(right_brow_grp, brow_grp)
        eyelash_grp = "eyelash_grp"
        create_group.create_group(eyelash_grp, backup_group)
        left_eyelash_grp = "left_eyelash_grp"
        create_group.create_group(left_eyelash_grp, eyelash_grp)
        right_eyelash_grp = "right_eyelash_grp"
        create_group.create_group(right_eyelash_grp, eyelash_grp)
        cloth_low_grp = "cloth_low_grp"
        create_group.create_group(cloth_low_grp, backup_group)

        body_group = "body_grp"
        create_group.create_group(body_group, poly_group)
        mouth_group = "mouth_grp"
        create_group.create_group(mouth_group, poly_group)
        gums_grp = "gums_grp"
        create_group.create_group(gums_grp, mouth_group)
        up_gums_grp = "up_gums_grp"
        create_group.create_group(up_gums_grp, gums_grp)
        down_gums_grp = "down_gums_grp"
        create_group.create_group(down_gums_grp, gums_grp)
        eye_group = "eye_grp"
        create_group.create_group(eye_group, poly_group)
        left_eyeball_grp = "left_eyeball_grp"
        create_group.create_group(left_eyeball_grp, eye_group)
        right_eyeball_grp = "right_eyeball_grp"
        create_group.create_group(right_eyeball_grp, eye_group)
        left_eyeball_inside_grp = "left_eyeball_inside_grp"
        create_group.create_group(left_eyeball_inside_grp, eye_group)
        right_eyeball_inside_grp = "right_eyeball_inside_grp"
        create_group.create_group(right_eyeball_inside_grp, eye_group)
        cloth_up_grp = "cloth_up_grp"
        create_group.create_group(cloth_up_grp, poly_group)
        cloth_down_grp = "cloth_down_grp"
        create_group.create_group(cloth_down_grp, poly_group)
        shoe_grp = "shoe_grp"
        create_group.create_group(shoe_grp, poly_group)
        left_shoe_grp = "left_shoe_grp"
        create_group.create_group(left_shoe_grp, shoe_grp)
        right_shoe_grp = "right_shoe_grp"
        create_group.create_group(right_shoe_grp, shoe_grp)
        other_grp = "other_grp"
        create_group.create_group(other_grp, poly_group)
    # create network node
    save_as.save_as(file_name)
    logger.info("%s publish successful!" % file_name)
    if not local:
        quit_maya.quit_maya()