def validation(self, *args):
        """
        Only work in animation file
        :return:
        """
        maya_file = mc.file(q=True, sn=True).lower().replace('\\', '/')
        if 'animation/character/wildlife' not in maya_file:
            return

        for reference in get_scene_references():
            maya_file = reference.resolved_name
            remote_files = msvP4.get_remote_files(maya_file)
            all_stats = msvP4.get_files_stats(remote_files)

            for f_stat in all_stats:
                have_rev = f_stat.get('haveRev')
                head_rev = f_stat.get('headRev')

                if have_rev != head_rev:
                    message = 'The rig file is not the latest one!\n Click "Confirm" to update!'
                    gui = dialog.ConfirmDialog2(
                        **{
                            'message': message,
                            'doConfirm': partial(self.update, maya_file)
                        })
                    gui.show()
Exemplo n.º 2
0
def open_maya(file_path):
    print '%s: %s: %s' % (MAYABATCHOUTPUT, OPENMAYAFILE, file_path)

    mc.file(force=True, new=True)
    try:
        mc.file(file_path, open=True, force=True)
    except Exception as e:
        print e.message

    for reference in get_scene_references():
        reference.resolve()
 def _open_animation_file(cls, animation_file, binder_file, namespace):
     mc.file(force=True, new=True)
     try:
         mc.file(animation_file, open=True, force=True)
     except:
         pass
     finally:
         mc.file(binder_file,
                 i=True,
                 usingNamespaces=True,
                 preserveReferences=True,
                 namespace=namespace)
         for reference in get_scene_references():
             reference.resolve()
Exemplo n.º 4
0
 def _open_animation_file(cls, animation_file, binder_file, namespace):
     """
     Open source animation and import binder file
     """
     mc.file(force=True, new=True)
     try:
         mc.file(animation_file, open=True, force=True)
     except Exception as e:
         print e.message
     finally:
         mc.file(binder_file,
                 i=True,
                 usingNamespaces=True,
                 preserveReferences=True,
                 namespace=namespace)
         for reference in get_scene_references():
             reference.resolve()
Exemplo n.º 5
0
from maya import cmds as mc
from blue.dcc.maya.core.referencing.msvReferenceUtils import get_scene_references

mc.file('{animation_file}', open=True, force=True)

for reference in get_scene_references():
    reference.resolve()