pyblish_maya/plugins/collect_current_file.py
def process(self, context):
        import os
        from maya import cmds

        """Inject the current working file"""
        current_file = cmds.file(sceneName=True, query=True)

        # Maya returns forward-slashes by default
        normalised = os.path.normpath(current_file)

        context.set_data('currentFile', value=normalised)

        # For backwards compatibility
        context.set_data('current_file', value=normalised)
def process(self, context):
        import os
        from maya import cmds

        """Inject the current working file"""
        current_file = cmds.file(sceneName=True, query=True)

        # Maya returns forward-slashes by default
        normalised = os.path.normpath(current_file)

        context.set_data('currentFile', value=normalised)

        # For backwards compatibility
        context.set_data('current_file', value=normalised)
def process ( self , context ) : import os from maya import cmds current_file = cmds . file ( sceneName = True , query = True ) # Maya returns forward-slashes by default normalised = os . path . normpath ( current_file ) context . set_data ( 'currentFile' , value = normalised ) # For backwards compatibility context . set_data ( 'current_file' , value = normalised )
Inject the current working file
Inject the current working file