- 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
mdlmanager
Module mdlmanager provides the class MDLManager
that allows requesting a native mdl node information.
class mdl.mdlmanager.MDLManager
Bases: object
Class used handle the MDL library and to request information on a MDL instance
MATERIAL_CONSTRUCTOR_FUNCTION = 'mdl::material(bool,material_surface,material_surface,color,material_volume,material_geometry,hair_bsdf)'
static addRootPath()
Add the given absolute path to the list of mdl root paths
Parameters: | aPath (str) – The absolute path to the directory to add |
---|---|
Raise: | IOError in case the provided path does not exists |
static extractMDLModulesFrom(aRootPaths)
Call mdltools executable to extract the JSON data of the mdl module found in the given list of root path.
Parameters: | aRootPaths (list of strings) – The root path list to consider |
---|---|
Returns: | the number of extracted items |
static getAcceptConnectionByDefaultForType(aTypePath, aParamListContainsRefOrMaterial)
Get the default connectivity status for an input pin, depending on the given type
Parameters: | aTypePath (str) – the mdl path of the type |
---|---|
Returns: | True if by default this type accepts connection, False otherwise |
static getConstantDefaultAnnotations(aTypePath, aExposed)
Get the list of annotation definition for a MDL constant node.
Parameters: |
|
---|---|
Returns: | a list of |
static getGraphDefaultAnnotations()
Get the list of annotation definition for a MDL graph.
Returns: | a list of MDLAnnotation |
---|
static getMDLAnnotationDefinition(aAnnotation)
Get the annotation definition
Parameters: | aAnnotation (MDLAnnotationEnum or str) – The annotation to get, as an enumeration value, or a complete mdl path |
---|---|
Returns: | The annotation definition as a MDLAnnotationDef |
static getMDLNodeDefinition(aPath)
Get the MDLNodeDef object corresponding to the given mdl path
Parameters: | aPath (string) – The mdl path (for instance ‘mdl::base::color_layer(color,float,::base::color_layer_mode)’) |
---|---|
Returns: | The MDLNodeDef object if the path is found, None otherwise |
static getMDLTypeDefinition(aPath)
Get the MDLTypeDef object corresponding to the given mdl path
Parameters: | aPath (string) – The mdl path (for instance ‘mdl::color’) |
---|---|
Returns: | The MDLTypeDef object if the path is found, None otherwise |
static getRootPaths()
Get the list of MDL root paths
Returns: | The MDL root paths package path as a list of strings |
---|
static initAllMDLModules()
Initialize the MDL library with all the modules found in the MDL root paths
static isAColor(aTypePath)
Check whether the given type is related to a color or not.
Returns: | True if this type can be interpreted as a color, False otherwise |
---|
static isModulePathDenyListed(aPath)
Check if the given mdl path is deny listed and cannot be instantiated as a node
Parameters: | aPath (str) – The path to check |
---|---|
Returns: | True if the path is deny listed, False otherwise |
static parseJsonData(jsonData)
Parse the given JSON data to extract the MDL functions and materials found in it
Parameters: | jsonData – The JSON data, in the format created by ‘mdltools’ executable |
---|---|
Returns: | the number of extracted items |
static resolveVersionnedFunctionPath(path)
Check if the parsed path match mdltools MDL specification, if not change it to a versionned function path
Parameters: | path (str) – mdl path to resolve |
---|---|
Returns: | str, resolved path, same as argument if not resolved required |
Raise: | api_exceptions.SBSLibraryError |
setRootPaths(aPathList)
If the given root path list is different from the ones already loaded, reinitialize the MDL library with the given root path. Do nothing otherwise.
Parameters: | aPathList (list of string) – the MDL root path list to set, as absolute paths |
---|