maxon.Wires¶
Description¶
A port connection consists of up to eight independent wires:
The /value/ wire is used to pass data values along the connection.
The /event/ wire is used when events shall flow along the connection.
The /dependency/ wire is only needed for internal connections within evaluation nodes such as core node wrappers.
computed output port needs to have a dependency wire from each input port which is required for its computation.
The /context/ wire connects a port which shall define a context to an input port which introduces that context.
- The /hidden/ wire is used mark a connection as hidden.What this means exactly is model-specific, for example
maxon.NodesGraphModelInterfacedoesn’t show those connections. - The /inhibit/ wire is used to temporarily disable the other wires.When this wire is present, the other wires should be considered as non-existing.
- The /slink/ wire is a marker which is used for node-specific purposes, where the source port of the connectiondetermines the meaning.For example it connects the output port of a context parameter node to the input port which introduces the context.
The /tlink/ wire is a marker which is used for node-specific purposes, where the target port of the connection determines the meaning.
In most cases you only need a combination of a value, event and dependency wire.
maxon.WIRE_MODE with the following possible values:- WIRE_MODE.NONE means that there is no such wire in the connection.This does not necessarily mean that there is no such wire at all because a wire might be “inherited” from a base node system, or there may be an “implicit wire” due to an enclosing connection.
- WIRE_MODE.MIN, WIRE_MODE.NORMAL and WIRE_MODE.MAX indicate that a wire exists.The values are priorities, so whenever an ambiguity between multiple wires has to be resolved, the wires with highest priority are taken.
>>> w = Wires()
>>> for i in range(Wires.COUNT):
... print(w[i])
>>> w.value = WIRE_MODE.NONE
# Same as line above
>>> w[Wires.VALUE] = WIRE_MODE.NONE
Attributes¶
|
The index to address the context part, used in #operator[] and Wires(Int,WIRE_MODE). |
The number of wires (currently 8). |
|
|
The index to address the dependency part, used in #operator[] and Wires(Int,WIRE_MODE). |
|
The index to address the event part, used in #operator[] and Wires(Int,WIRE_MODE). |
|
The index to address the hidden part, used in #operator[] and Wires(Int,WIRE_MODE). |
|
The index to address the inhibit part, used in #operator[] and Wires(Int,WIRE_MODE). |
Constant indicating no wires at all. |
|
|
The index to address the slink part, used in #operator[] and Wires(Int,WIRE_MODE). |
|
The index to address the tlink part, used in #operator[] and Wires(Int,WIRE_MODE). |
|
The index to address the value part, used in #operator[] and Wires(Int,WIRE_MODE). |
The mode for the context part of the connection. |
|
The mode for the dependency part of the connection. |
|
The mode for the event part of the connection. |
|
The mode for the hidden part of the connection. |
|
The mode for the inhibit part of the connection. |
|
The mode for the slink part of the connection. |
|
The mode for the tlink part of the connection. |
|
The mode for the value part of the connection. |
Methods Signature¶
|
Returns a Wires value where all wire modes are set to the given mode.
|
|
Returns the parallel combination of this Wires object and other.
|
|
Returns the concatenation of this
maxon.Wires object and other. |
|
Returns the wire-wise comparison of this and other.
|
Returns the hash code of this |
|
|
Returns a
maxon.Wires object which contains only those wires of this Wires object |
|
|
|
Converts this |
|
Returns a String representation of this |
|
|
|
Checks if there is any wire. |
|
Returns the wire-wise comparison of this and other.
|
|
Returns the mode for the wire indexed by index. |
|
|
|
Create a new Wire Only few call are allowed: |
|
|
|
Generator over each value of the Wires |
|
Returns the wire-wise comparison of this and other.
|
|
Return self|value. |
|
Return repr(self). |
|
Set the mode to value for the wire indexed by index. |
|
Return str(self). |
Methods Definition¶
-
static
Wires.All(mode=63)¶ - Returns a Wires value where all wire modes are set to the given mode.With the default WIRE_MODE.ALL this can be used as a mask which represents all wires, this is useful as argument to
PortTemplate.GetConnections()to get all connections.- Parameters
mode (
maxon.WIRE_MODE) – The mode to use for all wires, WIRE_MODE.ALL by default.- Returns
Wires value having all wire modes set to mode.
- Return type
-
Wires.Combine(other)¶ - Returns the parallel combination of this Wires object and other.This takes the maximum of each wire value.
- Parameters
other (
maxon.Wires) – Another Wires object.- Returns
The parallel combination (maximum) of the wires.
- Return type
-
Wires.Concat(other)¶ - Returns the concatenation of this
maxon.Wiresobject and other.This takes the minimum of each wire value.- Parameters
other (
maxon.Wires) – Another Wires object.- Returns
The concatenation (minimum) of the wires.
- Return type
-
Wires.EqualWires(other)¶ - Returns the wire-wise comparison of this and other.This uses
maxon.WIRE_MODE.FULL_MASKfor a wire with the same value in this and other, ofmaxon.WIRE_MODE.NONEif the values differ.- Parameters
other (
maxon.Wires) – Another Wires object.- Returns
Wire-wise comparison of this and other.
- Return type
-
Wires.GetHashCode()¶ Returns the hash code of this
maxon.Wires.- Returns
Hash code of this
maxon.CLASS.- Return type
int
-
Wires.MaskByPriority(priorityMask)¶ - Returns a
maxon.Wiresobject which contains only those wires of this Wires object which aren’t below the priority values given in priorityMask.- Parameters
priorityMask (
maxon.Wires) – Another Wires object.- Returns
Those wires which aren’t below the values of priorityMask.
- Return type
-
Wires.ToInt()¶
-
Wires.ToMask()¶ Converts this
maxon.Wiresobject into a mask which uses WIRE_MODE.FULL_MASK for wires which are set in this Wires object, otherwise WIRE_MODE.NONE.- Returns
Mask object to mask those wires which are present in this Wires object.
- Return type
-
Wires.ToString()¶ Returns a String representation of this
maxon.Wires- Returns
String representation of this
maxon.Wires.- Return type
str
-
Wires.__and__(other)¶
-
Wires.__bool__()¶ Checks if there is any wire.
- Returns
True if at least one of the wire modes differs from WIRE_MODE.NONE, False otherwise.
- Return type
bool
-
Wires.__eq__(other)¶ - Returns the wire-wise comparison of this and other.This uses WIRE_MODE.FULL_MASK for a wire with the same value in this and other, of WIRE_MODE.NONE if the values differ.
- Parameters
other (
maxon.Wires) – Another Wires object.- Returns
Wire-wise comparison of this and other.
- Return type
bool
-
Wires.__getitem__(item)¶ Returns the mode for the wire indexed by index.
- Parameters
item (int) – The index of the wire, one of VALUE, EVENT, DEPENDENCY, CONTEXT, HIDDEN, INHIBIT, SLINK, TLINK.
- Returns
Mode for the wire.
- Return type
-
Wires.__iand__(other)¶
-
Wires.__init__(value=0, event=0, dependency=0, context=0, hidden=0, inhibit=0, slink=0, tlink=0)¶ Create a new Wire Only few call are allowed:
Wires(Int index, WIRE_MODE mode = WIRE_MODE.NORMAL)
Wires(WIRE_MODE mode) : value(mode), event(mode), dependency(mode)
- Wires(value=WIRE_MODE.NONE vent=WIRE_MODE.NONE, dependency=WIRE_MODE.NONE,
context=WIRE_MODE.NONE, hidden=WIRE_MODE.NONE, inhibit=WIRE_MODE.NONE, slink=WIRE_MODE.NONE, tlink=WIRE_MODE.NONE)
- Parameters
value (
maxon.WIRE_MODE) – The value to setevent (
maxon.WIRE_MODE) – The event to setdependency (
maxon.WIRE_MODE) – The dependency to setcontext (
maxon.WIRE_MODE) – The context to sethidden (
maxon.WIRE_MODE) – The hidden to setinhibit (
maxon.WIRE_MODE) – The inhibit to setslink (
maxon.WIRE_MODE) – The slink to settlink (
maxon.WIRE_MODE) – The tlink to set
-
Wires.__int__()¶
-
Wires.__invert__()¶
-
Wires.__iter__()¶ Generator over each value of the Wires
-
Wires.__ne__(other)¶ - Returns the wire-wise comparison of this and other.This uses WIRE_MODE.FULL_MASK for a wire with the same value in this and other, of WIRE_MODE.NONE if the values differ.
- Parameters
other (
maxon.Wires) – Another Wires object.- Returns
Wire-wise comparison of this and other.
- Return type
bool
-
Wires.__or__(other)¶ Return self|value.
-
Wires.__repr__()¶ Return repr(self).
-
Wires.__setitem__(key, value)¶ Set the mode to value for the wire indexed by index.
- Parameters
key (int) – The index of the wire, one of VALUE, EVENT, DEPENDENCY, CONTEXT, HIDDEN, INHIBIT, SLINK, TLINK.
value (
maxon.WIRE_MODE) – Mode for the wire.
-
Wires.__str__()¶ Return str(self).