Ejemplo n.º 1
0
def export_shd(context):
    sg_nodes, connection_dict = get_all_hair_sg_nodes()
    if not sg_nodes:
        return
    mc.select(sg_nodes, r=1, ne=1)
    export_selected.export_selected(context.shd_path)
    json_operation.set_json_data(context.connection_path, connection_dict)
Ejemplo n.º 2
0
Archivo: Shd.py Proyecto: 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()
Ejemplo n.º 3
0
def main(file_name):
    logger = logging.getLogger("hair publish")
    open_file.open_file(file_name)
    obj = pipeFile.PathDetails.parse_path(file_name)
    asset_type_short_name = obj.asset_type_short_name
    asset_name = obj.asset_name
    publish_path = obj.publish_path
    hair_path = obj.hair_path
    yeti_group = "%s_%s_yetiNode" % (asset_type_short_name, asset_name)
    # import mdl reference
    import_load_remove_unload_ref.import_load_remove_unload_ref()
    # export yeti group to _hair group
    delete_layer.delete_layer()
    mc.select(yeti_group, r=1)
    export_selected.export_selected(hair_path)
    logger.info("export yeti node to _hair done.")
    mc.delete(yeti_group)
    # save to publish path
    save_as.save_as(publish_path)
    # quit maya
    quit_maya.quit_maya()
Ejemplo n.º 4
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()