sbscleaner module

sbscleaner.cleanSubstance(aSBSDocument, aCleanGraphNodes=True, aCleanFunctionNodes=True, aCleanGraphParameters=True, aCleanFunctionParameters=True)
Global clean function, that allows to clean:
  • Clean the useless compositing nodes in the Substance graphs

  • Clean the useless function nodes in the functions and all dynamic values (dynamic nodes parameters, pixel processor function)

  • Clean the useless graph input parameters

  • Clean the useless function input parameters

  • Clean the dependencies unused in the package

Parameters:
  • aSBSDocument (SBSDocument) – the substance to clean

  • aCleanGraphNodes (bool, optional) – True to clean the useless compositing nodes in the substance graphs. Default to True

  • aCleanFunctionNodes (bool, optional) – True to clean the useless function nodes in the functions. Default to True

  • aCleanGraphParameters (bool, optional) – True to clean the useless compositing nodes in the substance graphs. Default to True

  • aCleanFunctionParameters (bool, optional) – True to clean the useless compositing nodes in the substance graphs. Default to True

  • aCleanUnusedDependencies (bool, optional) – True to clean the dependencies unused in the package. Default to True

sbscleaner.cleanUnusedDependencies(aSBSDocument)

Remove all the unused dependencies in the given package.

Parameters:

aSBSDocument (SBSDocument) – the substance to clean

sbscleaner.cleanUselessNodesInDynamicValue(aDynamicValue)

Delete all the useless nodes in the given dynamic value, meaning the ones that are not connected to the output node.

Parameters:

aDynamicValue (SBSDynamicValue) – the graph to clean

sbscleaner.cleanUselessNodesInFunction(aFunction)

Delete all the useless nodes in the given function, meaning the ones that are not connected to the output node.

Parameters:

aFunction (SBSFunction) – the graph to clean

sbscleaner.cleanUselessNodesInGraph(aGraph)

Delete all the useless nodes in the given graph, meaning the ones that are not connected to an output.

Parameters:

aGraph (SBSGraph) – the graph to clean

sbscleaner.cleanUselessParametersInFunction(aFunction)

Delete all the useless input parameters in the given function, meaning the ones that are not used by the dynamic function or a VisibleIf condition.

Parameters:

aFunction (SBSFunction) – the graph to clean

sbscleaner.cleanUselessParametersInGraph(aGraph)

Delete all the useless input parameters in the given graph, meaning the ones that are not used by a dynamic function or a VisibleIf condition.

Parameters:

aGraph (SBSGraph) – the graph to clean

sbscleaner.getUselessNodesInDynamicValue(aDynamicValue)

Get all the useless nodes in the given dynamic value, meaning the ones that are not connected to the output node.

Parameters:

aDynamicValue (SBSDynamicValue) – the dynamic value to clean

Returns:

the list of useless SBSParamNode

sbscleaner.getUselessNodesInFunction(aFunction)

Get all the useless nodes in the given function, meaning the ones that are not connected to the output node.

Parameters:

aFunction (SBSFunction) – the graph to clean

Returns:

the list of useless SBSParamNode

sbscleaner.getUselessNodesInGraph(aGraph)

Get all the useless nodes in the given graph, meaning the ones that are not connected to an output.

Parameters:

aGraph (SBSGraph) – the graph to clean

Returns:

the list of useless SBSCompNode

sbscleaner.getUselessParametersInFunction(aFunction)

Get all the useless input parameters in the given function, meaning the ones that are not used by the function graph.

Parameters:

aFunction (SBSFunction) – the function to clean

Returns:

the list of useless SBSParamInput

sbscleaner.getUselessParametersInGraph(aGraph)

Get all the useless input parameters in the given graph, meaning the ones that are not used by a dynamic function or a VisibleIf condition.

Parameters:

aGraph (SBSGraph) – the graph to clean

Returns:

the list of useless SBSParamInput