User Guide Cancel

sbswriter | Substance 3D Automation ToolKit

sbswriter

Module sbswriter provides the class SBSWriter which allows the serialization of a SBSDocument into a .sbs file.

All derived SBSObject have a write function with the same signature than on the base class SBSObject:
common_interface.SBSObject.write()
class sbswriter.SBSWriter(aXmlRootNode, aPackagePath, aContext)
class sbswriter.SBSWriter(aXmlRootNode, aPackagePath, aContext)
 class sbswriter.SBSWriter(aXmlRootNode, aPackagePath, aContext)  

Bases: object

Class used to provide useful functions when writing a .sbs (=xml) file from a SBSDocument

setXmlElementAttribValue(aXmlElementParent, aAttribute, aAttribName)
setXmlElementAttribValue(aXmlElementParent, aAttribute, aAttribName)
 setXmlElementAttribValue(aXmlElementParent, aAttribute, aAttribName)  

setXmlElementVAttribValue(aXmlElementParent, aAttribute, aChildName) Write the given attribute as a child of the given XmlParent, using the format

setXmlElementVAttribValue(aXmlElementParent, aAttribute, aChildName)
setXmlElementVAttribValue(aXmlElementParent, aAttribute, aChildName)
 setXmlElementVAttribValue(aXmlElementParent, aAttribute, aChildName)  

Write the given attribute as a child of the given XmlParent, using the format

setXmlFilePathValue(aXmlElementParent, aAttribute, aChildName)
setXmlFilePathValue(aXmlElementParent, aAttribute, aChildName)
 setXmlFilePathValue(aXmlElementParent, aAttribute, aChildName)  

Convert attribute path before as a absolute path. Write the given attribute as a child of the given XmlParent, using the format

writeAllSBSNodesIn(aXmlNode, aObject, aTagName)
writeAllSBSNodesIn(aXmlNode, aObject, aTagName)
 writeAllSBSNodesIn(aXmlNode, aObject, aTagName)  

Write the given list of SBSObject using its proper writing method, and its XML description directly to the given XmlNode ………

writeListOfSBSNode(aXmlNode, aSBSObject, aTagName, aChildTagName)
writeListOfSBSNode(aXmlNode, aSBSObject, aTagName, aChildTagName)
 writeListOfSBSNode(aXmlNode, aSBSObject, aTagName, aChildTagName)  

Write the given list of SBSObject using their proper writing method, and add its hierarchical XML description to the given XmlNode ………

writeOnDisk(aFileAbsPath, aFormatDoc=False, aIncludeXMLHeader=True)
writeOnDisk(aFileAbsPath, aFormatDoc=False, aIncludeXMLHeader=True)
 writeOnDisk(aFileAbsPath, aFormatDoc=False, aIncludeXMLHeader=True)  

Write on disk the XmlRootNode, with the appropriate header, at the given path

writeSBSNode(aXmlNode, aSBSObject, aTagName)
writeSBSNode(aXmlNode, aSBSObject, aTagName)
 writeSBSNode(aXmlNode, aSBSObject, aTagName)  

Write the given SBSObject using its proper writing method, and add its XML description to the given XmlNode …

Get help faster and easier

New user?