コード例 #1
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()
コード例 #2
0
ファイル: HighMdl.py プロジェクト: jonntd/mira
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()
コード例 #3
0
def playblast_turntable(submit=True):
    logger = logging.getLogger(__name__)
    # get path
    obj = pipeFile.PathDetails.parse_path()
    local_video_path = obj.local_video_path
    work_video_path = obj.work_video_path
    current_project = obj.project
    # playblast
    model_name = get_model_name.get_model_name()
    resolution = Project(current_project).resolution
    percent = Project(current_project).playblast_percent
    set_image_size.set_image_size(*resolution)
    mc.select(model_name, r=1)
    create_turntable.create_turntable()
    create_parent_dir.create_parent_dir(local_video_path)
    playblaster.playblaster(local_video_path, "tt_camera", 1, 120, resolution,
                            percent, False, None, True)
    remove_turntable.remove_turntable()
    logger.info("playblast done.")
    mc.lookThru("persp")
    if submit:
        Copy.copy(local_video_path, work_video_path)
        logger.info("Copy %s >> %s" % (local_video_path, work_video_path))
        return work_video_path
    else:
        return local_video_path
コード例 #4
0
ファイル: rename_pipeline_shape.py プロジェクト: jonntd/mira
def rename_pipeline_shape():
    model_group = get_model_name.get_model_name()
    mc.select(model_group, r=1)
    if rename_shape.rename_shape():
        return True
    else:
        return False
コード例 #5
0
 def get_error_list(self):
     locked_attrs = list()
     base_attributes = [
         'tx', 'ty', 'tz', 'rx', 'ry', 'rz', 'sx', 'sy', 'sz'
     ]
     model_name = get_model_name.get_model_name()
     for attr in base_attributes:
         locked = mc.getAttr("%s.%s" % (model_name, attr), l=1)
         if locked:
             locked_attrs.append("%s.%s" % (model_name, attr))
     return locked_attrs
コード例 #6
0
ファイル: Shd.py プロジェクト: 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()
コード例 #7
0
ファイル: check_topology.py プロジェクト: jonntd/mira
 def get_error_topology():
     model_name = get_model_name.get_model_name()
     # reference_file = mc.referenceQuery(model_name, filename=1, withoutCopyNumber=1)
     context = pipeFile.PathDetails.parse_path()
     project = context.project
     entity_type = context.entity_type
     asset_type = context.asset_type
     asset_name = context.asset_name
     HighMdl_file = pipeFile.get_task_publish_file(project, entity_type,
                                                   asset_type, asset_name,
                                                   "HighMdl", "HighMdl")
     context = pipeFile.PathDetails.parse_path(HighMdl_file)
     topology_path = context.topology_path
     if not os.path.isfile(topology_path):
         return
     ho = hierarchy_opt.HierarchyOpt(model_name)
     increase, decrease = ho.compare_hierarchy(topology_path)
     if all((increase, decrease)):
         return increase, decrease
     else:
         change_list = ho.compare_topology(topology_path)
         return change_list
コード例 #8
0
 def __init__(self):
     super(Check, self).__init__()
     self.rig_root_name = get_model_name.get_model_name(typ="rig")
コード例 #9
0
 def __init__(self):
     super(Check, self).__init__()
     self.model_name = get_model_name.get_model_name()