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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
def main(): # import camera abc abc_file = options.file abc_dir = os.path.dirname(abc_file) start = options.start end = options.end import_abc.import_abc(abc_file) # bak frames camera = get_wanted_camera() bake_frame.bake_frame(camera, start, end) # export fbx fbx_file = "%s/%s.fbx" % (abc_dir, camera) mc.select(camera) mc.file(fbx_file, options="", typ="FBX export", force=1, pr=1, es=1) os.startfile(abc_dir) quit_maya.quit_maya()
def main(file_name, local): logger = logging.getLogger("HairRig start") context = pipeFile.PathDetails.parse_path(file_name) # reference HighRig high_rig_file = pipeFile.get_task_publish_file(context.project, context.entity_type, context.asset_type, context.asset_name, "HighRig", "HighRig") if not os.path.isfile(high_rig_file): logger.error("HighRig not publish file yet.") if not local: quit_maya.quit_maya() return create_reference.create_reference(high_rig_file) # save file save_as.save_as(file_name) logger.info("%s publish successful!" % file_name) if not local: quit_maya.quit_maya()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()
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()