- Substance 3D home
- Home
- Command Line Tools
- Command Line overview
- sbsbaker
- sbscooker
- sbsmtools
- sbsmutator
- sbsrender
- sbsupdater
- Command Line overview
- Pysbs - Python API
- Pysbs - Python API overview
- Getting started
- General topics
- Examples
- API Content
- API Content overview
- Substance definitions
- Common interfaces
- compnode
- context projectmgr
- graph
- mdl
- modelgraphindex
- modelannotationnames
- modelgraph
- modelgraphgenerator
- modelgraphimplementation
- modelnodenames
- modeloperand
- modulegraphindex
- moduleannotation
- moduleconnection
- modulegraph
- modulegraphgenerator
- modulegraphimplementation
- modulegraphlibrary
- modulegraphregister
- modulenode
- modulenodeimplementation
- modulenodeinstance
- moduleoperand
- moduleoutputbridging
- moduleparaminput
- params
- projectmgrdoc
- sbsarchive
- sbscommon
- sbspreset
- sbsproject
- substance
- Libraries
- sbsenum
- sbslibrary
- sbsbakerslibrary
- Helpers
- Execution context
- API Change log
- Samples
- Setup and Getting Started
- Integrations
- Substance Maya toolset
- 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.
- mParentObject (
createComment(aCommentText='Comment', aGUIPos=None)
Create a new comment.
Parameters: |
|
---|---|
Returns: | The |
createFrame(aSize, aFrameTitle='Frame', aCommentText='', aGUIPos=None, aColor=None, aDisplayTitle=True)
Create a new framed comment.
Parameters: |
|
---|---|
Returns: | The |
createFrameAroundNodes(aNodeList, aFrameTitle='Frame', aCommentText='', aColor=None, aDisplayTitle=True)
Create a new framed comment around the given nodes.
Parameters: |
|
---|---|
Returns: | The |
Raise: | SBSImpossibleActionError |
createNavigationPin(self, aPinText, aGUIPos)
Create a new navigation pin.
Parameters: |
|
---|---|
Returns: | The |
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: |
|
---|---|
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.
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.
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|
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.
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.
write(aSBSWriter, aXmlNode)
Write recursively the content of the SBSObject into the given xml node.
Parameters: |
|
---|
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.
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.
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: |
|
---|