Example #1
0
File: Anim.py Project: jonntd/mira
def main(file_name, local):
    logger = logging.getLogger("Anim publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path(file_name)
    publish_path = context.publish_path
    # reference opt
    publish.reference_opt()
    # copy image and video
    publish.copy_image_and_video(context)
    logger.info("Copy image and video done.")
    # save to publish path
    copy.copy(file_name, publish_path)
    logger.info("Copy to %s" % publish_path)
    # export asset info
    asset_info_path = context.asset_info_path
    export_anim_asset_info.export_anim_asset_info(asset_info_path)
    logger.info("Export asset info done.")
    # write out assembly edits
    rebuild_assembly.export_scene()
    logger.info("Export assembly edits done.")
    # export cache
    publish.export_cache(context)
    logger.info("Export cache done.")
    # quit maya
    if not local:
        quit_maya.quit_maya()
Example #2
0
def main(file_name, local):
    logger = logging.getLogger("HighMdl publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path(file_name)
    asset_type = context.asset_type
    # copy image and video
    publish.copy_image_and_video(context)
    logger.info("copy image and video done.")
    # export _MODEL group to publish path
    publish.export_need_to_publish(context)
    logger.info("Export _MODEL group to publish done.")
    # export abc cache
    publish.export_model_to_abc(context)
    logger.info("Export abc done.")
    # write out topology
    if asset_type in ["Character", "Prop", "Cprop"]:
        # write out topology
        topology_path = context.topology_path
        model_name = get_model_name.get_model_name()
        ho = hierarchy_opt.HierarchyOpt(model_name)
        ho.write_out(topology_path)
        logger.info("write out topology done.")
    # add to AD file
    publish.add_high_mdl_ad(context)
    logger.info("Add to AD done.")
    # quit maya
    if not local:
        quit_maya.quit_maya()
Example #3
0
def main(file_name, local):
    logger = logging.getLogger("Hair publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path(file_name)
    hair_cache_path = context.abc_cache_path
    hair_path = context.hair_path
    delta_path = context.delta_path
    asset_name = context.asset_name
    # import reference
    publish.reference_opt()
    # copy image
    publish.copy_image_and_video(context)
    logger.info("Copy image done.")
    # export SCULP group to abc
    model_name = get_model_name.get_model_name("hair")
    export_abc.export_abc(1, 1, hair_cache_path, model_name)
    logger.info("Export abc done.")
    # export xgen file
    collection_node = str("%s_collection" % asset_name)
    xgen = Xgen.Xgen()
    xgen.export_palette(collection_node, hair_path)
    xgen.create_delta(collection_node, delta_path)
    logger.info("Export .xgen file done.")
    # export shd
    export_shd(context)
    logger.info("Export shader done.")
    save_as.save_as(context.publish_path)
    if not local:
        quit_maya.quit_maya()
Example #4
0
def main(file_name, local):
    logger = logging.getLogger("Lookdev publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path()
    publish.copy_image_and_video(context)
    logger.info("copy image and video done.")
    save_as.save_as(context.publish_path)
    # quit maya
    if not local:
        quit_maya.quit_maya()
Example #5
0
File: Shd.py Project: jonntd/mira
def main(file_name, local):
    logger = logging.getLogger("shd publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path(file_name)
    publish_path = context.publish_path
    publish.copy_image_and_video(context)
    logger.info("copy image and video done.")
    # import all reference
    publish.reference_opt()
    logger.info("Import all reference.")
    # unlock normals
    unlock_normals()
    # delete history and delete unused nodes
    delete_history.delete_history()
    delete_unused_nodes.delete_unused_nodes()
    # delete intermediate object
    delete_intermediate_object.delete_intermediate_object()
    logger.info("Delete intermediate_object done.")
    # remove namespace
    remove_namespace.remove_namespace()
    logger.info("Remove namespace done.")
    # rename mat node
    model_name = get_model_name.get_model_name()
    mc.select(model_name, r=1)
    rename_shd_mat_node(context)
    logger.info("Rename material name done.")
    # rename shape
    if not rename_pipeline_shape.rename_pipeline_shape():
        raise RuntimeError("Rename shape error.")
    logger.info("Rename shape done.")
    # export _MODEL to publish path
    delete_layer.delete_layer()
    export_selected.export_selected(publish_path)
    logger.info("Export to %s" % publish_path)
    # export material
    publish.export_material(context)
    logger.info("Export material done.")
    # export connection
    publish.export_connection(context)
    logger.info("Export connection done.")
    # convert image
    convert_image(context)
    logger.info("Convert image done.")
    # add to AD
    publish.add_mesh_to_ad(context)
    logger.info("Add to AD done.")
    if not local:
        quit_maya.quit_maya()
Example #6
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()
Example #7
0
def main(file_name, local):
    logger = logging.getLogger("Group publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path(file_name)
    # copy image and video
    publish.copy_image_and_video(context)
    logger.info("copy image and video done.")
    # copy to publish path
    copy.copy(file_name, context.publish_path)
    logger.info("Copy to publish path.")
    # generate AD file
    publish.create_ad(context)
    logger.info("Create AD done.")
    # quit maya
    if not local:
        quit_maya.quit_maya()
Example #8
0
def main(file_name, local):
    logger = logging.getLogger("MidRig publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path(file_name)
    # 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
    publish.export_need_to_publish(context, "rig")
    logger.info("Export to publish path done.")
    # quit maya
    if not local:
        quit_maya.quit_maya()
Example #9
0
def main(file_name, local):
    logger = logging.getLogger("LgtLay publish")
    if not local:
        open_file.open_file(file_name)
    # delete Env
    try:
        mc.delete("Env")
    except:
        print "Can't delete Env"
    context = pipeFile.PathDetails.parse_path()
    publish.copy_image_and_video(context)
    # export Lights to _light
    mc.select("Lights", r=1)
    export_selected.export_selected(context.light_path)
    logger.info("Export Lights to %s" % context.light_path)
    # copy to publish path
    copy.copy(file_name, context.publish_path)
    logger.info("Copy to publish path")
    # quit maya
    if not local:
        quit_maya.quit_maya()
Example #10
0
def main(file_name, local):
    logger = logging.getLogger("HighRig publish")
    if not local:
        open_file.open_file(file_name)
    # get paths
    context = pipeFile.PathDetails.parse_path(file_name)
    # 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.")
    # delete blends
    delete.delete("_BLENDS")
    # rename shape
    if not rename_pipeline_shape.rename_pipeline_shape():
        raise RuntimeError("Rename shape error.")
    logger.info("Rename shape done.")
    # export needed
    publish.export_need_to_publish(context, "rig")
    logger.info("Export to publish path done.")
    # quit maya
    if not local:
        quit_maya.quit_maya()