User Guide Cancel

sbsargui | Substance 3D Automation ToolKit

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)
class sbsarchive.sbsargui.SBSARGuiGroup(aIdentifier='', aLabel='', aDescription=None, aDefaultState=None, aOrder=None)
 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(aContext, aDirAbsPath, aSBSParser, aXmlNode)
 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
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)
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)
 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'
aTweakIdentifier = 'tweak'
 aTweakIdentifier = 'tweak'  
getAttribute(aAttributeIdentifier)
getAttribute(aAttributeIdentifier)
 getAttribute(aAttributeIdentifier)  

Get the given attribute value

Parameters:aAttributeIdentifier (AttributesEnum) – the attribute identifier
Returns:the attribute value if defined, None otherwise
getClamp()
getClamp()
 getClamp()  
Returns:the clamp as a boolean if defined for this parameter, None if not defined
getDropDownList()
getDropDownList()
 getDropDownList()  
Returns:the map{value(int):label(str)} corresponding to the drop down definition if defined for this parameter, None otherwise.
getGroup()
getGroup()
 getGroup()  

Get the GUI group identifier containing this input

Returns:The GUI group as a string if defined, None otherwise
getLabelFalse()
getLabelFalse()
 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()
getLabelTrue()
 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()
getLabels()
 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()
getMaxValue()
 getMaxValue()  
Returns:the maximum parameter value in the type of the parameter (int or float), None if not defined
getMinValue()
getMinValue()
 getMinValue()  
Returns:the minimum parameter value in the type of the parameter (int or float), None if not defined
getStep()
getStep()
 getStep()  
Returns:the step value (in the type of the parameter) of the widget for this parameter, None if not defined
getUsages()
getUsages()
 getUsages()  

Get the usages of this param input

Returns:the list of SBSARUsage defined on this image input
getWidget()
getWidget()
 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)
hasUsage(aUsage)
 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()
isAButton()
 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()
isAColor()
 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()
isAComboBox()
 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()
isASlider()
 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()
isAnAngle()
 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()
isAnInputImage()
 isAnInputImage()  

Check if this input is of kind image.

Returns:True if this is an input image, False otherwise
isAnInputParameter()
isAnInputParameter()
 isAnInputParameter()  

Check if this input is a parameter.

Returns:True if this is an input parameter, False otherwise
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
parse(aContext, aDirAbsPath, aSBSParser, aXmlNode)
 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
sAngleWidget = 'angle'
sAngleWidget = 'angle'
 sAngleWidget = 'angle'  
sButtonWidget = 'togglebutton'
sButtonWidget = 'togglebutton'
 sButtonWidget = 'togglebutton'  
sCheckBoxWidget = 'checkbox'
sCheckBoxWidget = 'checkbox'
 sCheckBoxWidget = 'checkbox'  
sColorWidget = 'color'
sColorWidget = 'color'
 sColorWidget = 'color'  
sComboBoxWidget = 'combobox'
sComboBoxWidget = 'combobox'
 sComboBoxWidget = 'combobox'  
sDefaultWidget = 'default'
sDefaultWidget = 'default'
 sDefaultWidget = 'default'  
sImageWidget = 'image'
sImageWidget = 'image'
 sImageWidget = 'image'  
sNormalFormatIdentifier = '$normalformat'
sNormalFormatIdentifier = '$normalformat'
 sNormalFormatIdentifier = '$normalformat'  
sOutputSizeIdentifier = '$outputsize'
sOutputSizeIdentifier = '$outputsize'
 sOutputSizeIdentifier = '$outputsize'  
sPinIdentifier = 'pin'
sPinIdentifier = 'pin'
 sPinIdentifier = 'pin'  
sPointWidget = 'point'
sPointWidget = 'point'
 sPointWidget = 'point'  
sRandomSeedIdentifier = '$randomseed'
sRandomSeedIdentifier = '$randomseed'
 sRandomSeedIdentifier = '$randomseed'  
sRectWidget = 'rect'
sRectWidget = 'rect'
 sRectWidget = 'rect'  
sSliderWidget = 'slider'
sSliderWidget = 'slider'
 sSliderWidget = 'slider'  
sSpinboxWidget = 'spinbox'
sSpinboxWidget = 'spinbox'
 sSpinboxWidget = 'spinbox'  
sTimeIdentifier = '$time'
sTimeIdentifier = '$time'
 sTimeIdentifier = '$time'  
class sbsarchive.sbsargui.SBSAROutputGui(aLabel='', aDescription=None, aGroup=None, aVisibleIf=None, aUsages=None)
class sbsarchive.sbsargui.SBSAROutputGui(aLabel='', aDescription=None, aGroup=None, aVisibleIf=None, aUsages=None)
 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)
getAttribute(aAttributeIdentifier)
 getAttribute(aAttributeIdentifier)  

Get the given attribute value

Parameters:aAttributeIdentifier (AttributesEnum) – the attribute identifier
Returns:the attribute value if defined, None otherwise
getUsages()
getUsages()
 getUsages()  

Get the usages of this param output

Returns:the list of SBSARUsage defined on this output
hasUsage(aUsage)
hasUsage(aUsage)
 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(aContext, aDirAbsPath, aSBSParser, aXmlNode)
 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

Get help faster and easier

New user?