Difference between revisions of "NetworkEditor Class"

From TouchDesigner Documentation
Jump to: navigation, search
(NetworkEditor Class Auto Create)
m
(Tag: 2018.28070)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{TDClassSummary|summary=The NetworkEditor class describes an instance of a Network Editor. They are subclasses of the Pane Class, which can be accessed from the ui object.}}
+
{{TDClassSummary|label=NetworkEditor|summary=The NetworkEditor class describes an instance of a [[Network Editor]]. They are subclasses of the [[Pane Class]], which can be accessed from the [[UI Class|ui]] object.}}
{{HelpbodyBegin}}
+
<section begin=HELPBODY />
 
{{ClassMemberSection|empty=
 
{{ClassMemberSection|empty=
 
|Sectionsummary=
 
|Sectionsummary=
Line 8: Line 8:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showBackdropCHOPs
 
     |name=showBackdropCHOPs
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
     |text=Enable or disable CHOP viewers as backdrops.
+
     |text=Enable or disable [[CHOP]] viewers as backdrops.}}
}}
 
 
{{ClassMember
 
{{ClassMember
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showBackdropGeometry
 
     |name=showBackdropGeometry
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
     |text=Enable or disable SOP and Geometry object viewers as backdrops.
+
     |text=Enable or disable [[SOP]] and [[Geometry Object|Geometry object]] viewers as backdrops.}}
}}
 
 
{{ClassMember
 
{{ClassMember
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showBackdropTOPs
 
     |name=showBackdropTOPs
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
     |text=Enable or disable TOP viewers as backdrops.
+
     |text=Enable or disable [[TOP]] viewers as backdrops.}}
}}
 
 
{{ClassMember
 
{{ClassMember
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showColorPalette
 
     |name=showColorPalette
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
 
     |text=Enable or disable display of the operator color palette selector.
 
     |text=Enable or disable display of the operator color palette selector.
 
}}
 
}}
Line 36: Line 33:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showDataLinks
 
     |name=showDataLinks
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
 
     |text=Enable or disable disable of operator data links.
 
     |text=Enable or disable disable of operator data links.
 
}}
 
}}
Line 43: Line 40:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showList
 
     |name=showList
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
 
     |text=Control display of operators as a list, or connected nodes.
 
     |text=Control display of operators as a list, or connected nodes.
 
}}
 
}}
Line 50: Line 47:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showNetworkOverview
 
     |name=showNetworkOverview
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
 
     |text=Enable or disable display of the network overview.
 
     |text=Enable or disable display of the network overview.
 
}}
 
}}
Line 57: Line 54:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=showParameters
 
     |name=showParameters
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
 
     |text=Enable or disable display of the currently selected operator parameters.
 
     |text=Enable or disable display of the currently selected operator parameters.
 
}}
 
}}
Line 64: Line 61:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=straightLinks
 
     |name=straightLinks
     |returns=
+
     |type=bool
     |set=0
+
     |set=1
 
     |text=Control display of operator links as straight or curved.
 
     |text=Control display of operator links as straight or curved.
 
}}
 
}}
Line 71: Line 68:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=x
 
     |name=x
     |returns=
+
     |type=float
     |set=0
+
     |set=1
 
     |text=Get or set the x coordinate of the network editor area,  where 1 unit = 1 pixel when zoom = 1.
 
     |text=Get or set the x coordinate of the network editor area,  where 1 unit = 1 pixel when zoom = 1.
 
}}
 
}}
Line 78: Line 75:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=y
 
     |name=y
     |returns=
+
     |type=float
     |set=0
+
     |set=1
 
     |text=Get or set the y coordinate of the network editor area, where 1 unit = 1 pixel when zoom = 1.
 
     |text=Get or set the y coordinate of the network editor area, where 1 unit = 1 pixel when zoom = 1.
 
}}
 
}}
Line 85: Line 82:
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=zoom
 
     |name=zoom
     |returns=
+
     |type=float
     |set=0
+
     |set=1
 
     |text=Get or set the zoom factor of the network editor area, where a zoom factor of 1 draws each node at its unscaled resolution.
 
     |text=Get or set the zoom factor of the network editor area, where a zoom factor of 1 draws each node at its unscaled resolution.
 
}}}}
 
}}}}
Line 92: Line 89:
 
|Sectionsummary=
 
|Sectionsummary=
 
|items=
 
|items=
 
{{ClassMethod
 
    |class=NetworkEditor
 
    |name=fitHeight
 
    |call=fitHeight(height)
 
    |returns=
 
    |text=:
 
Fit the network area to specified height, specified in node units.  This affects the zoom factor.
 
height - The height to fit to.
 
}}
 
 
{{ClassMethod
 
{{ClassMethod
 
     |class=NetworkEditor
 
     |class=NetworkEditor
 
     |name=fitWidth
 
     |name=fitWidth
 
     |call=fitWidth(width)
 
     |call=fitWidth(width)
     |returns=
+
     |returns=None
     |text=:
+
     |text=Fit the network area to specified width, specified in node units.  This affects the zoom factor.
Fit the network area to specified width, specified in node units.  This affects the zoom factor.
+
*width - The width to fit to.
width - The width to fit to.
 
 
}}
 
}}
 
{{ClassMethod
 
{{ClassMethod
 
     |class=NetworkEditor
 
     |class=NetworkEditor
     |name=homeSelected
+
     |name=fitHeight
     |call=homeSelected(zoom=True)
+
     |call=fitHeight(height)
     |returns=
+
     |returns=None
     |text=:
+
     |text=Fit the network area to specified height, specified in node units. This affects the zoom factor.
Home all selected operators in the network.
+
*height - The height to fit to.
zoom - (Keyword, Optional) When true, the view will be scaled accordingly, otherwise the nodes will only be re-centered.
 
 
}}
 
}}
 
{{ClassMethod
 
{{ClassMethod
Line 124: Line 109:
 
     |name=home
 
     |name=home
 
     |call=home(zoom=True, op=None)
 
     |call=home(zoom=True, op=None)
     |returns=
+
     |returns=None
     |text=:
+
     |text=Home all operators in the network.
Home all operators in the network.
+
*zoom - (Keyword, Optional) When true, the view will be scaled accordingly, otherwise the nodes will only be re-centered.
zoom - (Keyword, Optional) When true, the view will be scaled accordingly, otherwise the nodes will only be re-centered.
+
*op - (Keyword, Optional) If an operator is specified, the network will be homed around its location.
op - (Keyword, Optional) If an operator is specified, the network will be homed around its location.
+
<syntaxhighlight lang=python>
 
p = ui.panes['pane1']
 
p = ui.panes['pane1']
 
n = op('/project1')
 
n = op('/project1')
Line 134: Line 119:
 
p = ui.panes[2]
 
p = ui.panes[2]
 
p.home(zoom=True)
 
p.home(zoom=True)
}}}}
+
</syntaxhighlight>
{{HelpbodyEnd}}
+
}}
 +
{{ClassMethod
 +
    |class=NetworkEditor
 +
    |name=homeSelected
 +
    |call=homeSelected(zoom=True)
 +
    |returns=None
 +
    |text=Home all selected operators in the network.
 +
*zoom - (Keyword, Optional) When true, the view will be scaled accordingly, otherwise the nodes will only be re-centered.
 +
}}
 +
{{ClassMethod
 +
    |class=NetworkEditor
 +
    |name=placeOPs
 +
    |call=placeOPs(listOfOPs, inputIndex=None, outputIndex=None, delOP=None, undoName='Operators')
 +
    |returns=None
 +
    |text=Use the mouse to place the specified operators in the pane.
 +
*listOfOps - The list of operators to be placed.
 +
*inputIndex - If specified, which input index to connect to.
 +
*outputIndex - If specified, which output index to connect to.
 +
*delOP - If specified, deletes that operator immediately after placing the listOfOPs.
 +
*undoName - Describes the [[Undo]] operation.}}
 +
}}
 +
<section end=HELPBODY />
 +
{{ClassInheritance|class=Pane}}
 
{{History}}
 
{{History}}
 
{{#invoke:Category|list|Python Reference}}
 
{{#invoke:Category|list|Python Reference}}

Latest revision as of 13:02, 13 March 2019

The NetworkEditor class describes an instance of a Network Editor. They are subclasses of the Pane Class, which can be accessed from the ui object.


Members[edit]

showBackdropCHOPsbool :

Enable or disable CHOP viewers as backdrops.

showBackdropGeometrybool :

Enable or disable SOP and Geometry object viewers as backdrops.

showBackdropTOPsbool :

Enable or disable TOP viewers as backdrops.

showColorPalettebool :

Enable or disable display of the operator color palette selector.

showDataLinksbool :

Enable or disable disable of operator data links.

showListbool :

Control display of operators as a list, or connected nodes.

showNetworkOverviewbool :

Enable or disable display of the network overview.

showParametersbool :

Enable or disable display of the currently selected operator parameters.

straightLinksbool :

Control display of operator links as straight or curved.

xfloat :

Get or set the x coordinate of the network editor area, where 1 unit = 1 pixel when zoom = 1.

yfloat :

Get or set the y coordinate of the network editor area, where 1 unit = 1 pixel when zoom = 1.

zoomfloat :

Get or set the zoom factor of the network editor area, where a zoom factor of 1 draws each node at its unscaled resolution.

Methods[edit]

fitWidth(width)None:

Fit the network area to specified width, specified in node units. This affects the zoom factor.

  • width - The width to fit to.

fitHeight(height)None:

Fit the network area to specified height, specified in node units. This affects the zoom factor.

  • height - The height to fit to.

home(zoom=True, op=None)None:

Home all operators in the network.

  • zoom - (Keyword, Optional) When true, the view will be scaled accordingly, otherwise the nodes will only be re-centered.
  • op - (Keyword, Optional) If an operator is specified, the network will be homed around its location.
p = ui.panes['pane1']
n = op('/project1')
p.home(op=n)
p = ui.panes[2]
p.home(zoom=True)

homeSelected(zoom=True)None:

Home all selected operators in the network.

  • zoom - (Keyword, Optional) When true, the view will be scaled accordingly, otherwise the nodes will only be re-centered.

placeOPs(listOfOPs, inputIndex=None, outputIndex=None, delOP=None, undoName='Operators')None:

Use the mouse to place the specified operators in the pane.

  • listOfOps - The list of operators to be placed.
  • inputIndex - If specified, which input index to connect to.
  • outputIndex - If specified, which output index to connect to.
  • delOP - If specified, deletes that operator immediately after placing the listOfOPs.
  • undoName - Describes the Undo operation.

Pane Class[edit]

Members[edit]

ownerCOMP :

Get or set the component this pane points to.

idint (Read Only):

A unique numeric identifier.

linkint :

Get or set the numeric link index.

enablebool :

Get or set mouse and keyboard interactivity on the pane.

maximizebool :

Enable or disable the pane maximize state.

namestr :

Get or set the pane name.

ratiofloat :

Get or set the split proportion of the pane, if the pane was previously split.

bottomLefttuple(x,y,u,v) (Read Only):

The coordinates of the bottom left corner, expressed in both pixels and uv offsets, in a named tuple.

topRighttuple(x,y,u,v) (Read Only):

The coordinates of the top right corner, expressed in both pixels and uv offsets, in a named tuple.

typePaneType (Read Only):

The enumerated type of the pane. Example: NetworkEditor.

The enumeration is called PaneType and consists of:

  • PaneType.NETWORKEDITOR
  • PaneType.PANEL
  • PaneType.GEOMETRYVIEWER
  • PaneType.TOPVIEWER
  • PaneType.CHOPVIEWER
  • PaneType.ANIMATIONEDITOR
  • PaneType.PARAMETERS
  • PaneType.TEXTPORT

Methods[edit]

changeType(paneType)td.Pane:

Change the pane to the specified type. Will return a new Pane object that represents the Pane. After being called, the current Pane instance will no longer be valid.

  • paneType - The type of pane to change this pane to.
p = ui.panes[0]
p = p.changeType(PaneType.TOPVIEWER)  # note: must re-assign p to new object.

close()None:

Close the pane.

floatingCopy()td.Pane:

Return a floating copy of the pane.

splitBottom()td.Pane:

Split the bottom portion of the pane into a new pane.

splitLeft()td.Pane:

Split the left portion of the pane into a new pane.

splitRight()td.Pane:

Split the right portion of the pane into a new pane.

splitTop()td.Pane:

Split the top portion of the pane into a new pane.

tearAway()bool:

Detach the pane into a floating window. Returns True if successful.

TouchDesigner Build:

An Operator Family that contains its own Network inside. There are twelve 3D Object Component and eight 2D Panel Component types. See also Network Path.

A work area in TouchDesigner's layout that includes the Network Editor and 7 other pane types used for different tasks. The TouchDesigner interface can consist of a single pane, or be split into multiple panes.