User Guide Cancel

ag_layout | Substance 3D Automation ToolKit

ag_layout

Module ag_layout provides the definition of the functions layoutGraph(), and layoutDoc() for automatically organizing the nodes in a graph or all graphs in a document respectively.

class autograph.ag_layout.NodesToKeepEnum
class autograph.ag_layout.NodesToKeepEnum
class autograph.ag_layout.NodesToKeepEnum

Bases: object

Enumeration of what nodes to keep when laying out a graph

KEEP_ALL_NODES= 0
KEEP_COMPUTED_NODES= 1
KEEP_COMPUTED_AND_INPUT_NODES= 2
KEEP_ALL_NODES= 0 KEEP_COMPUTED_NODES= 1 KEEP_COMPUTED_AND_INPUT_NODES= 2
KEEP_ALL_NODES= 0 
KEEP_COMPUTED_NODES= 1 
KEEP_COMPUTED_AND_INPUT_NODES= 2
class autograph.ag_layout.GUIElementsToKeepEnum
class autograph.ag_layout.GUIElementsToKeepEnum
class autograph.ag_layout.GUIElementsToKeepEnum

Bases: object

Enumeration treatments of gui elements when laying out a graph

KEEP_ALL= 0
KEEP_NONE= 1
KEEP_NON_EMPTY= 2
KEEP_ALL= 0 KEEP_NONE= 1 KEEP_NON_EMPTY= 2
KEEP_ALL= 0 
KEEP_NONE= 1 
KEEP_NON_EMPTY= 2
class autograph.ag_layout.GraphFlowDirectionEnum
class autograph.ag_layout.GraphFlowDirectionEnum
class autograph.ag_layout.GraphFlowDirectionEnum

Bases: object

Enumeration layout directions for graphs

RIGHTWARD= 0
UPWARD= 1
RIGHTWARD= 0 UPWARD= 1
RIGHTWARD= 0 
UPWARD= 1
class autograph.ag_layout.GraphLayoutAlignment
class autograph.ag_layout.GraphLayoutAlignment
class autograph.ag_layout.GraphLayoutAlignment

Bases: object

Enumeration what side of a graph to align when laying out a graph

OUTPUTS= 0
INPUTS= 1
OUTPUTS= 0 INPUTS= 1
OUTPUTS= 0 
INPUTS= 1
autograph.ag_layout.layoutGraph(graph, aNodeSpacing=160, aNodeShift=(80, 0), nodesToKeep=0, layoutAlignment=0, commentsToKeep=0, framesToKeep=0, navigationPinsToKeep=0)
autograph.ag_layout.layoutGraph(graph, aNodeSpacing=160, aNodeShift=(80, 0), nodesToKeep=0, layoutAlignment=0, commentsToKeep=0, framesToKeep=0, navigationPinsToKeep=0)
autograph.ag_layout.layoutGraph(graph, aNodeSpacing=160, aNodeShift=(80, 0), nodesToKeep=0, layoutAlignment=0, commentsToKeep=0, framesToKeep=0, navigationPinsToKeep=0)

Lays out a graph

Parameters:
Returns:

None

autograph.ag_layout.layoutDoc(sbsDoc, aNodeSpacing=160, aNodeShift=(80, 0), nodesToKeep=0, layoutAlignment=0, commentsToKeep=0, framesToKeep=0, navigationPinsToKeep=0)
autograph.ag_layout.layoutDoc(sbsDoc, aNodeSpacing=160, aNodeShift=(80, 0), nodesToKeep=0, layoutAlignment=0, commentsToKeep=0, framesToKeep=0, navigationPinsToKeep=0)
autograph.ag_layout.layoutDoc(sbsDoc, aNodeSpacing=160, aNodeShift=(80, 0), nodesToKeep=0, layoutAlignment=0, commentsToKeep=0, framesToKeep=0, navigationPinsToKeep=0)

Layout all graphs in an sbs document

Parameters:
  • sbsDoc – Document to layout
  • aNodeSpacing (int) – distance to keep between nodes when laying them out
  • aNodeShift (tuple of int) – Start position for the laid out graphs
  • nodesToKeep (NodesToKeepEnum) – What nodes to keep in the graph
  • layoutAlignment (GraphLayoutAlignment) – Enum selecting whether to traverse from inputs or outputs
  • commentsToKeep (GUIElementsToKeepEnum) – Whether to delete or keep comments
  • framesToKeep (GUIElementsToKeepEnum) – Whether to delete or keep frames
  • navigationPinsToKeep (GUIElementsToKeepEnum) – Whether to delete or keep navigation pins
Returns:

None

Get help faster and easier

New user?