User Guide Cancel

gui | Substance 3D Automation ToolKit

  1. Substance 3D home
  2. Home
  3. Command Line Tools
    1. Command Line overview
    2. sbsbaker
      1. sbsbaker overview
      2. sbsbaker command line options
      3. sbsbaker Example Command Lines
    3. sbscooker
      1. sbscooker overview
      2. sbscooker command line options
      3. sbscooker pattern variables
    4. sbsmtools
      1. sbsmtools overview
      2. sbsmtools command line options
    5. sbsmutator
      1. sbsmutator overview
      2. sbsmutator command line options
      3. sbsmutator Example Command Lines
    6. sbsrender
      1. sbsrender overview
      2. sbsrender base parameters and pattern variables
      3. sbsrender command line options
      4. sbsrender example command lines
    7. sbsupdater
      1. sbsupdater overview
      2. sbsupdater command line options
  4. Pysbs - Python API
    1. Pysbs - Python API overview
    2. Getting started
    3. General topics
      1. Basic manipulation
      2. Substance creation
      3. Substances modification
      4. Dependencies management
      5. PySbs batchtools module
      6. metadata manipulation
      7. SAT demos
      8. Edit sbsar with SBSARManager
      9. Spot Colors
      10. Thumbnail creation with SAT
    4. Examples
      1. demohelloworld
      2. demos
      3. demos_batchtools
      4. script_update_with_sbsupdater
    5. API Content
      1. API Content overview
      2. Substance definitions
        1. Common interfaces
          1. basegraph
          2. package
          3. sbsarobject
          4. sbsobject
        2. compnode
          1. compnode overview
          2. common
          3. compimplementation
          4. paramgraph
        3. context projectmgr
        4. graph
          1. graph overview
          2. function
          3. inputparameters
          4. output
        5. mdl
          1. mdlannotation
          2. mdlcommon
          3. mdldictionaries
          4. mdlenum
          5. mdlgraph
          6. mdllibclasses
          7. mdlmanager
          8. mdlnode
          9. mdlnodeimpl
          10. mdloperand
          11. mdlsbsbridge
        6. modelgraphindex
          1. modelannotationnames
          2. modelgraph
          3. modelgraphgenerator
          4. modelgraphimplementation
          5. modelnodenames
          6. modeloperand
          7. modulegraphindex
          8. moduleannotation
          9. moduleconnection
          10. modulegraph
          11. modulegraphgenerator
          12. modulegraphimplementation
          13. modulegraphlibrary
          14. modulegraphregister
          15. modulenode
          16. modulenodeimplementation
          17. modulenodeinstance
          18. moduleoperand
          19. moduleoutputbridging
          20. moduleparaminput
        7. params
          1. params overview
          2. dynamicvalue
          3. paramnode
        8. projectmgrdoc
        9. sbsarchive
          1. sbsarchive overview
          2. sbsarenum
          3. sbsargraph
          4. sbsargui
          5. sbsarguiwidgets
          6. sbsarmanager
        10. sbscommon
          1. connections
          2. gui
          3. nodes
          4. values
        11. sbspreset
        12. sbsproject
        13. substance
          1. substance overview
          2. content
          3. resource
      3. Libraries
        1. sbsenum
        2. sbslibrary
          1. sbslibrary overview
          2. sbsdictionaries
          3. sbsfilters
          4. sbsfunctions
          5. sbsfxmapnodes
          6. sbslibclasses
          7. sbswidgets
        3. sbsbakerslibrary
          1. sbsbakerslibrary overview
          2. sbsbakersdef
          3. sbsbakersdefaultprops
          4. sbsbakersdictionaries
          5. sbsbakersenum
          6. sbsbakingconverter
          7. sbsbakingconverterparam
          8. sbsbakingparameters
          9. sbsdialogstate
          10. sbsscenedata
        4. Helpers
          1. sbscleaner
          2. sbsexporter
          3. sbsgenerator
          4. sbsparser
          5. sbswriter
          6. qtclasses
            1. qtclasses overview
            2. qtvariantreader
            3. qtvariantwriter
          7. psdparser
          8. sbsimpactmanager
          9. batchtools
          10. autograph
            1. ag_functions
            2. ag_layout
            3. ag_types
          11. info_mesh_parser
          12. sbsbaker_info_handlers
          13. sbsrender_render_handlers
          14. output_handlers
          15. spotcolorinfo_handler
          16. thumbnail
          17. batchtools overview
        5. Execution context
          1. context
          2. functions
        6. API Change log
  5. Samples
    1. Samples overview
    2. Texturing Template Demo
    3. Batch Tools Demo
    4. Variations
    5. Texture Mat
    6. Pixel Processor Ray tracer
  6. Setup and Getting Started
    1. Setup and Getting Started overview
    2. Compatibility
    3. Frequently asked Questions
    4. Known issues
    5. SAT Cookbook
    6. Use Pysbs in different python interpreter (maya, sd, blender...)
  7. Integrations
    1. Substance Maya toolset
      1. Substance Maya Toolset overview
      2. Installing
      3. Launching
      4. Baking
        1. Baking overview
        2. Export parameters
        3. Baker parameters
        4. Mesh setup
        5. Using a template
      5. Changelog
  8. Changelog overview

gui

Module gui provides the definition of the classes relative to the GUI: - SBSGUILayout - SBSGUIObject - SBSGUILayoutComp

 class sbscommon.gui.GUIObjectList(aParentObject, aGUIObjectsAttr)  

Bases: object

Class used to provide common methods to SBSObjects that contains a list of GUIObjects: - SBSGraph - SBSDynamicValue - SBSParamsGraph

Members:
  • mParentObject (SBSObject): Parent object that contains the GUI object list.
  • mGUIObjectsAttr (str): attribute member name in the parent object that corresponds to the GUI object list.
 createComment(aCommentText='Comment', aGUIPos=None)  

Create a new comment.

Parameters:
  • aCommentText (str, optional) – The text of the comment. Default to ‘Comment’
  • aGUIPos (list of 3 float, optional) – The comment position in the graph. Default to [0,0,0]
  • aLinkToNode (str, optional) – The UID of the node to associate to this comment
Returns:

The SBSGUIObject created

 createFrame(aSize, aFrameTitle='Frame', aCommentText='', aGUIPos=None, aColor=None, aDisplayTitle=True)  

Create a new framed comment.

Parameters:
  • aSize (list of 2 float) – The frame size
  • aFrameTitle (str, optional) – The title of the frame. Default to ‘Frame’
  • aCommentText (str, optional) – The text of the frame. Empty by default
  • aGUIPos (list of 3 float, optional) – The frame position in the graph. Default to [0,0,-100]
  • aColor (list of 4 float between 0 and 1, optional.) – The frame color. Default to [0.196, 0.196, 0.509, 0.196]
  • aDisplayTitle (boolean, optional) – True to display the frame title. Default to True
Returns:

The SBSGUIObject created

 createFrameAroundNodes(aNodeList, aFrameTitle='Frame', aCommentText='', aColor=None, aDisplayTitle=True)  

Create a new framed comment around the given nodes.

Parameters:
  • aNodeList (list of class:.SBSNode) – The nodes to include in the frame
  • aFrameTitle (str, optional) – The title of the frame. Default to ‘Frame’
  • aCommentText (str, optional) – The text of the frame. Empty by default
  • aColor (list of 4 float between 0 and 1, optional.) – The frame color. Default to [0.196, 0.196, 0.509, 0.196]
  • aDisplayTitle (boolean, optional) – True to display the frame title. Default to True
Returns:

The SBSGUIObject created

Raise:

SBSImpossibleActionError

 createNavigationPin(self, aPinText, aGUIPos)  

Create a new navigation pin.

Parameters:
  • aPinText (str) – The text of the navigation pin
  • aGUIPos (list of 3 float, optional) – The navigation pin position in the graph. Default to [0,0,0]
Returns:

The SBSGUIObject created

 deleteGUIObject(aGUIObject)  

deleteGUIObject(aGUIObject): Allows to delete the given GUI object.

Parameters:aGUIObject (SBSGUIObject or str) – The GUI object to remove, as a SBSGUIObject or an UID.
Returns:True if success
Raise:api_exceptions.SBSImpossibleActionError
 getAllComments()  

Get all comments defined in the graph

Returns:a list of SBSGUIObject
 getAllFrames()  

Get all frames defined in the graph

Returns:a list of SBSGUIObject
 getAllGUIObjects()  

Get all the GUI objects defined in the graph (Comments, Frames, Navigation Pins)

Returns:a list of SBSGUIObject
 getAllNavigationPins()  

Get all the navigation pins defined in the graph

Returns:a list of SBSGUIObject
 getFrameRectAroundNodes(aNodeList)  

Return the rectangle a frame would fill to be around the given nodes.

Parameters:aNodeList (list of class:.SBSNode) – The nodes to include in the frame
Returns:A Rect
Raise:SBSImpossibleActionError
 getGUIObject(aGUIObject)  

getGUIObject(aGUIObject): Search for the given GUI object in the list

Parameters:aGUIObject (SBSGUIObject or str) – GUI object to get, identified by its uid or as a SBSGUIObject
Returns:A SBSGUIObject object if found, None otherwise
 getNodesInFrame(aFrame)  

Get all the nodes included or partially included in the given frame. The frame must be included in the parent graph, otherwise SBSImpossibleActionError is raised

Parameters:aFrame (SBSGUIObject) – The frame to consider
Returns:a list of SBSNode
Raise:SBSImpossibleActionError
 reframeAroundNodes(aFrame, aNodeList)  

Move and resize a frame to be around the given nodes.

Parameters:
  • aFrame (SBSGUIObject) – The frame to edit
  • aNodeList (list of class:.SBSNode) – The nodes to include in the frame
Raise:

SBSImpossibleActionError

 class sbscommon.gui.Rect(aTop=0, aLeft=0, aWidth=0, aHeight=0)  

Bases: object

 containsPoint(aPoint)  

Check if the given point is contained in the Rectangle.

Parameters:aPoint – The point to test
Type:list of 2 float [x, y] or tuple
Returns:True if the given point is contained in the Rectangle, False otherwise
 getCorners()  

Get the 4 corner points of this rectangle

Returns:The corners of this rectangle, as a list of tuple
 overlapsWith(aOther)  

Check if the two rectangles overlap

Parameters:aOther (Rect) – The other rectangle
Returns:True if the two rectangles overlap
 union(aOther)  

Create the union of two rectangles

Parameters:aOther (Rect) – The other rectangle
Returns:The rectangle which is the union of the two rectangles
 class sbscommon.gui.SBSGUILayout(aGPos=None, aDocked=None, aDockDistance=None, aSize=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a GUILayout (GUI position and options) as defined in a .sbs file

Members:
  • mGPos (list of 3 float, optional): position in the graph layout.
  • mDocked (str, optional): object is in a docked state.
  • mDockDistance (str, optional): original distance between the docked node and its parent (for undock purpose).
  • mSize (str, optional): size of the object.
 equals(other)  

Check if this SBSObject is equivalent to the other SBSObject. Some members may be excluded from this check, the UIDs or GUILayout for instance.

Parameters:other (SBSObject) – The SBSObject to compare to
Returns:True if the two SBSObject are similar according to their definition.
 getUidIsUsed(aUID)  

Check if the given uid is already used in the context of this SBSObject.

Parameters:aUID (str) – UID to check
Returns:True if the uid is already used, False otherwise
Raise:AttributeError if the function getUidIsUsed in not properly overloaded on this SBSObject
 parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)  

Parse recursively the given xml node to retrieve the content of the SBSObject.

Parameters:
  • aContext (Context) – execution context
  • aDirAbsPath (str) – the absolute directory containing the current parsed package (.sbs file)
  • aSBSParser (SBSParser) – the substance parser
  • aXmlNode (xml.etree.ElementTree) – the xml node to parse
 write(aSBSWriter, aXmlNode)  

Write recursively the content of the SBSObject into the given xml node.

Parameters:
  • aSBSWriter (SBSWriter) – the substance writer
  • aXmlNode (xml.etree.ElementTree) – the xml node to fill
 class sbscommon.gui.SBSGUILayoutComp(aDisplay=None, aGRoi=None, aGZoom=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a GUILayoutComp (Gui flags and options) as defined in a .sbs file

Members:
  • mDisplay (str): display type (graph, stack, etc.).
  • mGRoi (str): visualized Region Of Interest of the graph.
  • mGZoom (str): graph zoom.
 equals(other)  

Check if this SBSObject is equivalent to the other SBSObject. Some members may be excluded from this check, the UIDs or GUILayout for instance.

Parameters:other (SBSObject) – The SBSObject to compare to
Returns:True if the two SBSObject are similar according to their definition.
 getUidIsUsed(aUID)  

Check if the given uid is already used in the context of this SBSObject.

Parameters:aUID (str) – UID to check
Returns:True if the uid is already used, False otherwise
Raise:AttributeError if the function getUidIsUsed in not properly overloaded on this SBSObject
 parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)  

Parse recursively the given xml node to retrieve the content of the SBSObject.

Parameters:
  • aContext (Context) – execution context
  • aDirAbsPath (str) – the absolute directory containing the current parsed package (.sbs file)
  • aSBSParser (SBSParser) – the substance parser
  • aXmlNode (xml.etree.ElementTree) – the xml node to parse
 write(aSBSWriter, aXmlNode)  

Write recursively the content of the SBSObject into the given xml node.

Parameters:
  • aSBSWriter (SBSWriter) – the substance writer
  • aXmlNode (xml.etree.ElementTree) – the xml node to fill
 class sbscommon.gui.SBSGUIObject(aUID='', aType='', aGUIDependency=None, aGUILayout=None, aGUIName='', aOptions=None, aTitle=None, aFrameColor=None, aIsTitleVisible=None, aIsFrameVisible=None)  

Bases: pysbs.common_interfaces.sbsobject.SBSObject

Class that contains information on a GUIObject as defined in a .sbs file

Members:
  • mUID (str): node unique identifier in the /GUIObjects/ context.
  • mType (str): type of GUI object (comment, navigation pin, etc.)
  • mGUIDependency (str): dependency of this GUI Object on an object in the graph ( format : Type?uid(?uid…) )
  • mGUILayout (SBSGUILayout):
  • mGUIName (str): name of the GUI object.
  • mOptions (list of SBSOption): list of specific options of the GUI object type.
  • mTitle (str, optional): The object Title
  • mFrameColor (str, optional): frame color (RGBA Float)
  • mIsTitleVisible (str, optional): bool to set title visibility
  • mIsFrameVisible (str, optional): bool to set frame visibility
 equals(other)  

Check if this SBSObject is equivalent to the other SBSObject. Some members may be excluded from this check, the UIDs or GUILayout for instance.

Parameters:other (SBSObject) – The SBSObject to compare to
Returns:True if the two SBSObject are similar according to their definition.
 getDependencyUID()  

Get the UID of the node associated to this GUIObject.

Returns:the UID as a string if found, None otherwise
 getRect()  

Return the rectangle of this GUIObject

Returns:The rectangle as a Rect
 getUidIsUsed(aUID)  

Check if the given uid is already used in the context of this SBSObject.

Parameters:aUID (str) – UID to check
Returns:True if the uid is already used, False otherwise
Raise:AttributeError if the function getUidIsUsed in not properly overloaded on this SBSObject
 hasDependencyOn(aUID)  

Checks if this GUI Object has a dependency on the given UID

Parameters:aUID (str) – The UID to consider
Returns:True if this GUI Object has a dependency on the object with the given UID, False otherwise
 isAComment()  
Returns:True if this GUIObject is a simple comment
 isAFrame()  
Returns:True if this GUIObject is a framed comment
 isANavigationPin()  
Returns:True if this GUIObject is a navigation pin
 parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)  

Parse recursively the given xml node to retrieve the content of the SBSObject.

Parameters:
  • aContext (Context) – execution context
  • aDirAbsPath (str) – the absolute directory containing the current parsed package (.sbs file)
  • aSBSParser (SBSParser) – the substance parser
  • aXmlNode (xml.etree.ElementTree) – the xml node to parse
 sDefaultColor = [0.196078435, 0.196078435, 0.509803951, 0.196078435]  
 write(aSBSWriter, aXmlNode)  

Write recursively the content of the SBSObject into the given xml node.

Parameters:
  • aSBSWriter (SBSWriter) – the substance writer
  • aXmlNode (xml.etree.ElementTree) – the xml node to fill

 Adobe

Get help faster and easier

New user?