- 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
sbsargui
Module sbsargui aims to define SBSARObjects that are relative to the GUI as saved in a .sbsar file, mostly SBSARInputGui
, SBSAROutputGui
and SBSARGuiGroup
.
class sbsarchive.sbsargui.SBSARGuiGroup(aIdentifier='', aLabel='', aDescription=None, aDefaultState=None, aOrder=None)
Bases: pysbs.common_interfaces.sbsarobject.SBSARObject
Class that contains information on a GUI group as defined in a .sbsar file
- Members:
- mIdentifier (str): Unique identifier of the group of parameter.
- mLabel (str): Label of the group of parameter.
- mDescription (str, optional): Description
- mDefaultState (str, optional): Default state (‘folded’,’unfolded’).
- mOrder (str, optional): Group order
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
Parse recursively the given xml node to retrieve the content of the SBSObject.
class sbsarchive.sbsargui.SBSARInputGui(aWidget='', aLabel='', aDescription=None, aGroup=None, aOrder=None, aState=None, aVisibleIf=None, aGuiAngle=None, aGuiComboBox=None, aGuiImage=None, aGuiSlider=None, aShowas=None)
Bases: pysbs.common_interfaces.sbsarobject.SBSARObject
Class that contains information on the GUI widget of an input as defined in a .sbsar file
- Members:
- mWidget (str): Kind of widget associated to this input parameter.
- mLabel (str): Label of the input (unique).
- mDescription (str, optional): Description.
- mGroup (str, optional): Group of parameters.
- mState (str, optional): State of the input (‘visible’,’hidden’,’disabled’).
- mOrder (str, optional): Input order.
- mVisibleIf (str, optional): Conditional visibility definition.
- mGuiAngle (
SBSARGuiAngle
, optional): Angle widget definition, if the widget is of kind ‘angle’ - mGuiComboBox (
SBSARGuiComboBox
, optional): ComboBox widget definition, if the widget is of kind ‘combobox’ - mGuiImage (
SBSARGuiImage
, optional): Image widget definition, if the widget is of kind ‘image’ - mGuiSlider (
SBSARGuiSlider
, optional): Slider widget definition, if the widget is of kind ‘slider’ - mShowas (str, optional): defines whether the input is should be shown as a pin or tweakable
aTweakIdentifier = 'tweak'
getAttribute(aAttributeIdentifier)
Get the given attribute value
Parameters: | aAttributeIdentifier (AttributesEnum ) – the attribute identifier |
---|---|
Returns: | the attribute value if defined, None otherwise |
getClamp()
Returns: | the clamp as a boolean if defined for this parameter, None if not defined |
---|
getDropDownList()
Returns: | the map{value(int):label(str)} corresponding to the drop down definition if defined for this parameter, None otherwise. |
---|
getGroup()
Get the GUI group identifier containing this input
Returns: | The GUI group as a string if defined, None otherwise |
---|
getLabelFalse()
Returns the label for the false option if it’s valid for this input
Returns: | str with the label if it’s a button, otherwise None |
---|
getLabelTrue()
Returns the label for the true option if it’s valid for this input
Returns: | str with the label if it’s a button, otherwise None |
---|
getLabels()
Returns: | the list of all labels defined for this parameter, in the right order, as a list of strings. None if not defined |
---|
getMaxValue()
Returns: | the maximum parameter value in the type of the parameter (int or float), None if not defined |
---|
getMinValue()
Returns: | the minimum parameter value in the type of the parameter (int or float), None if not defined |
---|
getStep()
Returns: | the step value (in the type of the parameter) of the widget for this parameter, None if not defined |
---|
getUsages()
Get the usages of this param input
Returns: | the list of SBSARUsage defined on this image input |
---|
getWidget()
Get the GuiWidget object defined on this parameters. This will return None for a Button widget, a Transformation widget or a Color widget.
Returns: | The widget as a SBSARObject if defined, None otherwise |
---|
hasUsage(aUsage)
Check if the given usage is defined on this image input
Parameters: | aUsage (str or UsageEnum ) – The usage to look for |
---|---|
Returns: | True if the given usage is defined on this param input, False otherwise |
isAButton()
Check if this input is a parameter with a toggle button widget.
Returns: | True if this is an input parameter with a toggle button widget, False otherwise |
---|
isAColor()
Check if this input is a parameter with a color widget.
Returns: | True if this is an input parameter with a color widget, False otherwise |
---|
isAComboBox()
Check if this input is a parameter with a combo box widget.
Returns: | True if this is an input parameter with a combo box widget, False otherwise |
---|
isASlider()
Check if this input is a parameter with a slider widget.
Returns: | True if this is an input parameter with a slider widget, False otherwise |
---|
isAnAngle()
Check if this input is a parameter with an angle widget.
Returns: | True if this is an input parameter with an angle widget, False otherwise |
---|
isAnInputImage()
Check if this input is of kind image.
Returns: | True if this is an input image, False otherwise |
---|
isAnInputParameter()
Check if this input is a parameter.
Returns: | True if this is an input parameter, False otherwise |
---|
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
Parse recursively the given xml node to retrieve the content of the SBSObject.
sAngleWidget = 'angle'
sButtonWidget = 'togglebutton'
sCheckBoxWidget = 'checkbox'
sColorWidget = 'color'
sComboBoxWidget = 'combobox'
sDefaultWidget = 'default'
sImageWidget = 'image'
sNormalFormatIdentifier = '$normalformat'
sOutputSizeIdentifier = '$outputsize'
sPinIdentifier = 'pin'
sPointWidget = 'point'
sRandomSeedIdentifier = '$randomseed'
sRectWidget = 'rect'
sSliderWidget = 'slider'
sSpinboxWidget = 'spinbox'
sTimeIdentifier = '$time'
class sbsarchive.sbsargui.SBSAROutputGui(aLabel='', aDescription=None, aGroup=None, aVisibleIf=None, aUsages=None)
Bases: pysbs.common_interfaces.sbsarobject.SBSARObject
Class that contains information on the GUI widget of an input as defined in a .sbsar file
- Members:
- mLabel (str): Label of the input (unique).
- mDescription (str, optional): Description.
- mGroup (str, optional): Group of parameters.
- mVisibleIf (str, optional): Conditional visibility definition.
- mUsages (list of
SBSARUsage
, optional): Usages of this output (‘’ is the .sbsar file)
getAttribute(aAttributeIdentifier)
Get the given attribute value
Parameters: | aAttributeIdentifier (AttributesEnum ) – the attribute identifier |
---|---|
Returns: | the attribute value if defined, None otherwise |
getUsages()
Get the usages of this param output
Returns: | the list of SBSARUsage defined on this output |
---|
hasUsage(aUsage)
Check if the given usage is defined on this output
Parameters: | aUsage (str or UsageEnum ) – The usage to look for |
---|---|
Returns: | True if the given usage is defined on this output, False otherwise |
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
Parse recursively the given xml node to retrieve the content of the SBSObject.