User Guide Cancel

sbsexporter | Substance 3D Automation ToolKit

sbsexporter

class sbsexporter.SBSExporter
class sbsexporter.SBSExporter
 class sbsexporter.SBSExporter  

Bases: object

Class used to provide useful functions when parsing a .sbs (=xml) file

export(aSBSDocument, aExportFolder, aBuildArchive = False, aAliasesToExport = None, aArchiveFormat = 'zip')
export(aSBSDocument, aExportFolder, aBuildArchive = False, aAliasesToExport = None, aArchiveFormat = 'zip')
 export(aSBSDocument, aExportFolder, aBuildArchive = False, aAliasesToExport = None, aArchiveFormat = 'zip')  

Exports the given SBSDocument with its dependencies (resources + packages) to the specified folder, including the packages referenced by the provided aliases. This is the equivalent of the function ‘Export with dependencies’ within Substance Designer. If aAliasesToExport is let None, all the packages referenced by an alias will not be included in the self-contained package.

Parameters:
  • aSBSDocument (SBSDocument) – The package to export
  • aExportFolder (string) – The absolute path of the export folder (it must exist). A folder with the name of the document will be created inside this folder.
  • aBuildArchive (boolean, optional) – True to create an archive of the exported folder. Default to False
  • aAliasesToExport (list of string, optional) – The list of aliases to export in the self-contained package. If left None, the path with aliases will be kept as is.
  • aArchiveFormat (string) – Archive format, among ‘zip’, ‘tar’, ‘gztar’, ‘bztar’ as specified in the Python module shutil
Returns:

The absolute path of the resulting exported package or archive

Raise:

api_exceptions.SBSImpossibleActionError

getExportedDependencies()
getExportedDependencies()
 getExportedDependencies()  

Allows to get the exported dependencies (resources + packages) of the last export

Returns:The exported dependencies as a dictionary of {oldAbsPath(string): newAbsPath(string)}
getExportedPackages()
getExportedPackages()
 getExportedPackages()  

Allows to get the exported packages of the last export

Returns:The exported packages as a dictionary of {oldAbsPath(string): newAbsPath(string)}
getExportedResources()
getExportedResources()
 getExportedResources()  

Allows to get the exported resources of the last export

Returns:The exported resources as a dictionary of {oldAbsPath(string): newAbsPath(string)}
getMissingPackages()
getMissingPackages()
 getMissingPackages()  

Allows to get the missing packages of the last export (file not found)

Returns:The missing packages as a list string
getMissingResources()
getMissingResources()
 getMissingResources()  

Allows to get the missing resources of the last export (file not found)

Returns:The missing resources as a list string
reset()
reset()
 reset()  

Reset the exporter to its initial state

Get help faster and easier

New user?