Exemple #1
0
    def _import(self, path, sg_publish_data):
        """
        Import contents of the given file into the scene.
        
        :param path: Path to file.
        :param sg_publish_data: Shotgun data dictionary with all the standard publish fields.
        """
        from pyfbsdk import FBApplication
        
        if not os.path.exists(path):
            raise Exception("File not found on disk - '%s'" % path)
        
        (_, ext) = os.path.splitext(path)
        
        if ext.lower() != ".fbx":
            raise Exception("Unsupported file extension for '%s'. Only FBX files are supported." % path)

        app = FBApplication()
        app.FileMerge(path)
Exemple #2
0
    def add_file_to_motionbuilder(self, file_path, shotgun_data):
        """
        Load item into motionbuilder.
        
        This will attempt to merge the loaded file with the scene.
        """
        from pyfbsdk import FBApplication

        if not os.path.exists(file_path):
            self.parent.log_error("The file %s does not exist." % file_path)
            return

        # get the slashes right
        file_path = file_path.replace(os.path.sep, "/")
        
        (path, ext) = os.path.splitext(file_path)
        
        if ext != ".fbx":
            self.parent.log_error("Unsupported file extension for %s. Only FBX files are supported." % file_path)
        else:
            app = FBApplication()
            app.FileMerge(file_path)