User Guide Cancel

mdllibclasses | 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

mdllibclasses

Module mdllibclasses provides all the classes used by the MDL library for the definition of all MDL entities. In particular, it defines the classes:

 class mdl.mdllibclasses.MDLAnnotationDef(aPath='', aParameters=None)  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL node annotation.

Members:
  • mPath (str): path of the mdl node
  • mParameters (list of MDLNodeDefParamValue): the parameters available on this node.
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 fromMDLAnnotation(aAnnotation)  

Build the MDLAnnotationDef from a MDLAnnotation object

Parameters:aAnnotation (MDLAnnotation) – The operand to use to build this parameter
 toMDLAnnotation()  

Build the MDLAnnotation from this MDLAnnotationDef object

Returns:a MDLAnnotation object
 class mdl.mdllibclasses.MDLLibObject  

Bases: object

Base class of all MDL library classes.

 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 class mdl.mdllibclasses.MDLNodeDef(aPath='', aAnnotations=None, aParameters=None, aInputs=None, aOutputs=None, aIsSelector=False, aIsMaterial=False, aIsPassthrough=False)  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL node.

Members:
  • mPath (str): path of the mdl node
  • mAnnotations (list of MDLAnnotation): the annotations of the node.
  • mParameters (list of MDLNodeDefParam): the parameters available on this node.
  • mInputs (list of MDLNodeDefInput): the outputs of this node.
  • mOutputs (list of MDLNodeDefOutput): the outputs of this node.
  • mIsSelector (bool): Define if this node is a selector node
  • mIsMaterial (bool): Define if this node is a material
  • mIsPassthrough (bool): Define if this node is a passthrough node (NOTE: not an actual MDL definition)
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 getAllInputIdentifiers()  

Get all the input identifiers as strings of this node definition

Returns:a list of string
 getAllInputs()  

Get all the inputs in this node definition

Returns:a list of MDLNodeDefInput
 getAllOutputIdentifiers()  

Get all the output identifiers as strings of this node definition

Returns:a list of string
 getAllOutputs()  

Get all the outputs in this node definition

Returns:a list of MDLNodeDefOutput
 getAllParameterIdentifiers()  

Get all the parameter identifiers as strings of this node definition

Returns:a list of string
 getAllParameters()  

Get all the parameters in this node definition

Returns:a list of MDLNodeDefParam
 getDefaultOperands()  

Get the list of default operands corresponding to the parameters available on this node definition

Parameters:aCheckType (bool, optional) – True to check the default connection visibility depending on the type of the operand. Default to False
Returns:a list of MDLOperand
 getFirstInputOfType(aType)  

Get the first MDLInputDef with the given type.

Parameters:aType (str) – mdl path of the required type
Returns:a MDLInputDef object if found, None otherwise
 getFirstOutputOfType(aType)  

Get the first MDLOutputDef with the given type.

Parameters:aType (str) – mdl path of the required type
Returns:a MDLOutputDef object if found, None otherwise
 getInput(aInput)  

Get the input with the given identifier.

Parameters:aInput (str) – The required input
Returns:a MDLNodeDefInput if found, None otherwise
 getOutput(aOutput = None)  

Get the output with the given identifier. If aOutput is None, return the first output if it exists.

Parameters:aOutput (str) – The required output
Returns:a MDLNodeDefOutput if found, None otherwise
 getParameter(aParameter)  

Get the required parameter

Parameters:aParameter (str) – The name of the parameter to get
Returns:a MDLNodeDefParam object if found, None otherwise
 class mdl.mdllibclasses.MDLNodeDefInput(aIdentifier='input', aType=None)  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL node input.

Members:
  • mIdentifier (str): identifier of the output
  • mType (MDLNodeDefType): type of the output
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 fromMDLInputBridging(aInputBridging, aSBSGraph)  

Build the MDLNodeDefInput from a MDLInputBridging object

Parameters:aInputBridging (MDLInputBridging) – The operand to use to build this input
 fromMDLOperand(aOperand)  

Build the MDLNodeDefInput from a MDLOperand object

Parameters:aOperand (MDLOperand) – The operand to use to build this input
 getIdentifierStr()  

Gets the identifier of the input

Returns:The identifier as a string
 getType()  

Get the mdl path of the type of this input

Returns:The mdl type as a string
 class mdl.mdllibclasses.MDLNodeDefOutput(aIdentifier='output', aType=None)  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL node output.

Members:
  • mIdentifier (str): identifier of the output
  • mType (MDLNodeDefType): type of the output
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 fromMDLOutputBridging(aOutputBridging, aSBSGraph)  

Build the MDLNodeDefOutput from a MDLOutputBridging object

Parameters:
  • aOutputBridging (MDLInputBridging) – The operand to use to build this input
  • aSBSGraph (SBSGraph) – The Substance Graph referenced by the input bridging
 getIdentifierStr()  

Gets the identifier of the output

Returns:The identifier as a string
 getType()  

Get the mdl path of the type of this output

Returns:The mdl type as a string
 class mdl.mdllibclasses.MDLNodeDefParam(aName='', aAnnotations=None, aDefaultMDLValue=None, aDefaultValue=None, aDefaultValueType=None, aTypeName='', aTypePath='', aTypeModifier='')  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL node parameter.

Members:
  • mName (str): name of the parameter
  • mAnnotations (list of MDLAnnotationDef): annotations associated to this parameter
  • DefaultValue (str or MDLOperand): the default value of this parameter
  • mType (MDLNodeDefType): type of the parameter
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 fromMDLOperand(aOperand, copyValue=False)  

Build the MDLNodeDefParam from a MDLOperand object

Parameters:
  • aOperand (MDLOperand) – The operand to use to build this parameter
  • copyValue (bool, optional) – True to set the value of the operand as the default parameter value. Default to False
 fromMDLParameter(aParameter, copyValue=False)  

fromSBSParameter(aParameter, copyValue=False) Build the MDLNodeDefParam from a MDLParameter object

Parameters:
  • aParameter (MDLParameter) – The operand to use to build this parameter
  • copyValue (bool, optional) – True to set the value of the parameter as the default parameter value. Default to False
 getAnnotation(aAnnotation)  

Get the annotation definition of the given annotation if defined in the parameter definition

Parameters:aAnnotation (MDLAnnotationEnum) – The annotation to look for
Returns:The annotation as a MDLAnnotationDef if found, None otherwise
 getDefaultValue()  

Get the default value of this parameter

Returns:The default value
 getType()  

Get the mdl path of the type of this parameter

Returns:The mdl type as a string
 toMDLOperand()  

Convert this parameter definition to the appropriate MDLOperand.

Returns:a MDLOperand
 class mdl.mdllibclasses.MDLNodeDefParamValue(aName='', aValue='', aType='')  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL node parameter value.

Members:
  • mName (str): name of the parameter
  • mValue (str): value of the parameter
  • mType (str): type of the parameter
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 getType()  

Get the mdl path of the type of this parameter

Returns:The mdl type as a string
 class mdl.mdllibclasses.MDLNodeDefType(aName='', aPath='', aModifier='auto')  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL type.

Members:
  • mName (str): name of the parameter
  • mPath (str): value of the parameter
  • mModifier (str, optional): type of the parameter. Default to ‘auto’
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 class mdl.mdllibclasses.MDLTypeDef(aPath='', aKind=0, aComponentType=None, aComponentCount=-1, aRowCount=-1, aColumnCount=-1, aArrayDeferredSize=False, aArraySizeIdentifier=None, aEnumValues=None, aStructMembers=None, aTextureShape=None)  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL type.

Members:
  • mPath (str): mdl path of the type
  • mKind (MDLTypeDefKindEnum): kind of type (‘atomic’, ‘enum’, ‘struct’, ‘vector’, …)
  • mComponentType (str, optional): For compound types, mdl path of the type of component
  • mComponentCount (int, optional): For compound types, the number of components required
  • mRowCount (int, optional): For matrix type, the number of rows
  • mColumnCount (int, optional): For matrix type, the number of columns
  • mArrayDeferredSize (bool, optional): For array type, defines if the size is known or deferred
  • mArraySizeIdentifier (str, optional): For array type, the size identifier
  • mEnumValues (dict {key(str):value(int)}, optional: enumeration type definition
  • mStructMembers (list of MDLTypeStructMemberDef, optional): struct type definition
  • mTextureShape (str, optional): For texture type, the shape of the texture
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data
 getModuleName()  

Get the module name, which is the last part of the type’s mdl path

Returns:The module name as a string
 getModulePath()  

Get the module path, which is the beginning of the type’s mdl path, without the last module name

Returns:The module path as a string
 isArray()  

Check whether the type is an array.

Returns:True if the type is an array, False otherwise
 isAtomic()  

Check whether the type is atomic.

Returns:True if the type is atomic, False otherwise
 isCall()  

Check whether the type is a call.

Returns:True if the type is a call, False otherwise
 isCompound()  

Check whether the type is a compound (vector, color, matrix).

Returns:True if the type is a compound, False otherwise
 isEnum()  

Check whether the type an enum.

Returns:True if the type is an enum, False otherwise
 isMaterial()  

Check whether the type is a material.

Returns:True if the type is a material, False otherwise
 isReference()  

Check whether the type is a reference.

Returns:True if the type is a reference, False otherwise
 isResource()  

Check whether the type is a resource of any kind (texture, bsdf_measurement, …).

Returns:True if the type is a resource, False otherwise
 isString()  

Check whether the type is a string.

Returns:True if the type is a string, False otherwise
 isStruct()  

Check whether the type is a struct.

Returns:True if the type is a struct, False otherwise
 toMDLOperand(aName = None)  

Convert this type definition to the appropriate MDLOperand, with the given name.

Parameters:aName (str, optional) – name of the operand. If None, the default name is used
Returns:a MDLOperand
 class mdl.mdllibclasses.MDLTypeStructMemberDef(aName='', aType=None)  

Bases: mdl.mdllibclasses.MDLLibObject

This class contains the definition of a MDL type of kind struct.

Members:
  • mName (str): name of the struct member
  • mType (str): mdl path of the type
 fromJSON(jsonData)  

Build the object from the given JSON data

Parameters:jsonData (dict) – JSON data

 Adobe

Get help faster and easier

New user?