Beispiel #1
0
def get_cache_dir():
    context = pipeFile.PathDetails.parse_path()
    project = context.project
    template = Project(project).template("fx_cache_work")
    cache_dir = template.format(project=project,
                                sequence=context.sequence,
                                shot=context.shot,
                                step="Cfx")
    return cache_dir
Beispiel #2
0
 def show_pictures(self, value):
     if not value:
         print "has no value"
         self.set_empty_model()
     else:
         project, sequence, shot, step = value
         work_template = Project(project).template("maya_shot_render")
         work_dir = work_template.format(project=project,
                                         sequence=sequence,
                                         shot=shot.split("_")[-1],
                                         step=step)
         publish_template = Project(project).template(
             "maya_shot_renderPublish")
         publish_dir = publish_template.format(project=project,
                                               sequence=sequence,
                                               shot=shot.split("_")[-1],
                                               step=step)
         self.set_dir(work_dir, "work", "version")
         self.set_dir(publish_dir, "publish", "texture")
Beispiel #3
0
def reference_cloth():
    context = pipeFile.PathDetails.parse_path()
    project = context.project
    template = Project(project).template("fx_cache_publish")
    cache_dir = template.format(project=project, sequence=context.sequence, shot=context.shot, step="Cfx")
    if not os.path.isdir(cache_dir):
        print "No cloth cache dir exist"
        return
    cloth_cache_path = glob.glob("%s/*/cloth/cloth.abc" % cache_dir)
    if cloth_cache_path:
        for cache in cloth_cache_path:
            create_reference.create_reference(cache, "cloth")
    else:
        print "No cloth cache found."
Beispiel #4
0
def get_logger(project, logger_type, task_name):
    logger_dir = Project(project).task_log_dir
    logger_dir = logger_dir.format(project=project)
    logger_dir = join_path.join_path2(logger_dir, logger_type)
    if not os.path.isdir(logger_dir):
        os.makedirs(logger_dir)
    current_time = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())
    file_base_name = "%s-%s.txt" % (task_name, current_time)
    file_name = join_path.join_path2(logger_dir, file_base_name)
    logging.basicConfig(filename=file_name,
                        level=logging.DEBUG,
                        filemode='w',
                        format='%(asctime)s - %(levelname)s: %(message)s')
    logger = logging.getLogger()
    return logger
Beispiel #5
0
def import_camera(project, sequence, step):
    db = db_api.DbApi(project).db_obj
    shots = db.get_all_shots(sequence)
    if not shots:
        print "No shot exist in this sequence"
        return
    shot_names = [shot.get("code") for shot in shots]
    for shot_name in shot_names:
        cache_template = Project(project).template("maya_shot_cache")
        cache_dir = cache_template.format(project=project, sequence=sequence,
                                          shot=shot_name.split("_")[-1], step=step, task=step)
        camera_cache_path = "%s/camera.abc" % cache_dir
        camera_cache_path = camera_cache_path.replace("\\", "/")
        if not os.path.isfile(camera_cache_path):
            print "%s is not exist." % camera_cache_path
            continue
        reference_files = mc.file(q=1, r=1, wcn=1)
        if camera_cache_path in reference_files:
            print "%s already exist" % camera_cache_path
            continue
        create_reference.create_reference(camera_cache_path)
    group_camera()
Beispiel #6
0
 def get_dir(self, step, work_type, submit_type=None):
     if step in ["LgtLay", "Lgt"]:
         if work_type == "work":
             template = Project(self.project).template("maya_shot_render")
         else:
             template = Project(
                 self.project).template("maya_shot_renderPublish")
     else:
         if work_type == "work":
             if submit_type == "Cache":
                 template = Project(self.project).template("fx_cache_work")
             else:
                 template = Project(self.project).template("fx_render_work")
         else:
             if submit_type == "Cache":
                 template = Project(
                     self.project).template("fx_cache_publish")
             else:
                 template = Project(
                     self.project).template("fx_render_publish")
     return template.format(project=self.project,
                            sequence=self.sequence,
                            shot=self.shot,
                            step=self.step)