Exemplo n.º 1
0
def NoUI_publish():
    filepath = pm.sceneName()
    # make thumb
    screen_capture_file(pft.getPreviewPath(filepath))

    # remove shareReferenc
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()

    # playblast
    # playblast is hard to write here ,so playblast first

    # publishcamera相机导出时会弹窗,所以就不导出了
    # cam_publish.run()

    # update referece
    # you can do it before this script

    publish_xml()

    update_xml()

    # organize.run()

    anim_publish(filepath)
    # we can not publish abc cache
    # you can export cache youself
    mc.warning(
        'no UI anim publish complete!<--No playblast,No update referece,No Camera Export,No anim cache export-->'
    )
Exemplo n.º 2
0
def getAllchars():
    # -----------
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()
    # -----------
    reference = []
    for x in pm.listReferences():
        asset = os.path.basename(x.path).split('_')[1]
        if ps.get_asset_type_by_name(asset)[1] == 'Character':
            reference.append(x)

    return reference
Exemplo n.º 3
0
def getAllSHD():
    # -----------
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()
    # -----------
    reference = []
    for x in pm.listReferences():
        if re.match(r'\d+[a-zA-Z]*', os.path.basename(x.path).split('_')[1]):
            continue
        asset = os.path.basename(x.path).split('_')[1]
        if ps.get_asset_type_by_name(asset)[1] == 'Environment':
            reference.append(x)

    return reference
Exemplo n.º 4
0
def replace_all_with_low_env():
    for fileRef in pm.listReferences():
        node = AssetReference(fileRef.path)
        if 'Environment' == node.assetType:
            lowENV = node.high_version_low_mdl_path()
            # normalENV = node.aas_path()
            if lowENV:
                fileRef.replaceWith(lowENV)
                import deleteInvaildReferenceNode
                deleteInvaildReferenceNode.run()
                import deleteInvaildReferenceNode
                deleteInvaildReferenceNode.run()
            else:
                pm.warning('Ignore replacing this env {}'.format(node.asset))
                continue
Exemplo n.º 5
0
    def update_file(self):
        current_version = self.version_option.currentText()
        file_base_name = 'df_' + self.asset + '_rig_' + current_version

        current_publish = r'Z:/Shotgun/projects/df/_library/assets/Character/{}/rig/_publish/{}/{}_*'.format(
            self.asset, current_version, file_base_name)
        file_path = glob.glob(os.path.normpath(current_publish))[0]
        oldpath = self.refpath
        pm.warning('Begin changing {} version'.format(self.char))
        pm.warning('--Old:{}'.format(os.path.normpath(oldpath)))
        pm.warning('--New:{}'.format(os.path.normpath(file_path)))

        if os.path.normpath(file_path) != os.path.normpath(oldpath):
            pm.FileReference(self.refnode).replaceWith(
                os.path.normpath(file_path))
            # update "refpath" value
            self.refpath = self.refnode.path
        # -----------
        import deleteInvaildReferenceNode
        deleteInvaildReferenceNode.run()
def run():
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()

    try:
        mc.delete(mc.ls(type='polyColorPerVertex'))
    except:
        pass

    import update_prompt_timer
    reload(update_prompt_timer)
    dlg = update_prompt_timer.scene_break_down()
    dlg.show()
    dlg.select_all_red()
    dlg.do_update()
    dlg.close()
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()
def run():
    import deleteInvaildReferenceNode
    deleteInvaildReferenceNode.run()