Plug

- class Plug
A node plug.
A Plug is a node attribute. It can hold a Value object.
A Plug can be an input Plug, in that case, another plug can be connected into it and propagate its value in it.
A plug can be an output Plug, in that case, its value is evaluated using dependancies on other plugs and an evaluation function. Output Plugs can’t have an input connection.
The Value of a Plug can be :
The Plug stored Value
The Value of the input connected Plug, for input Plugs.
The computed Value for output Plugs.:cvar int32_t AllFrames: Static.
Methods
__eq__Return self==value.
__hash__Return hash(self).
Constructor(s)
__ne__Return self!=value.
add_dynamic_valued_dependencyadd_notification_dependency(dependence, ...)- type dependence
Plug
add_valued_dependencyas_Box3f()Returns the plug value as a Box3f.
Returns the plug value as a Color4f.
as_M44d()Returns the plug value as a M44d.
as_Quatd()Returns the plug value as a Quatd.
as_V2d()Returns the plug value as a V2d.
as_V2i()Returns the plug value as a V2i.
as_V3d()Returns the plug value as a V3d.
as_V3i()Returns the plug value as a V3i.
as_V4d()Returns the plug value as a V4d.
as_V4i()Returns the plug value as a V4i.
as_bool()Returns the plug value as a bool.
Returns the plug value as a double.
as_float()Returns the plug value as a float.
as_int()Returns the plug value as an integer.
Returns the plug value as a string.
Returns the plug value as a user data.
can_connect(other)Check if the plug can be connected.
channel()If this plug has a single channel, return it, return nullptr otherwise.
- rtype
list(Plug)
channels()Return all the plug's channels.
connect(src, undo_stack, serialize)Connect src to this plug.
Return the default plug value.
depend_on(plugs)Return true if this plug depends on one of the plugs.
Returns the plug's description.
disconnect(undo_stack)Disconnect the plug connected into this.
disconnect_outputs(undo_stack)Disconnect all the plugs this plug is connected into.
Returns the path of this plug starting at the document node.
flags()Return the plug flags.
has_node()- rtype
bool
input()Get the input plug.
Get the connection chain origin of a plug.
Return true if this plug is animable.
Return true if the plug connects when a node is dropped over a connection.
Return true if this plug is a channel.
Return true if the plug has an input connection.
Return true if the node connection has to be serialized.
Return true if the plug value is constant in time.
Return true if the plug is dynamic.
Return true if this plug is evaluated.
Return true if this plug should be ignored by users and the UI.
Return true if this plug is keyable.
Return true if the plug is a main plug, i-e, is displayed by default.
Return true if this plug is mutable (i.e.
Return true if this plug is an output.
Return true if the input connection has been done in a referenced node.
Return true if the plug is dynamic and comes from a referenced node.
Get the plug keys in targeted layer.
key_frames_in_layer(layer)Get the plug keys in the layer.
name()Return the plug name.
Returns the name of this plug to be displayed in UI (extracted from the 'nice_name' property of the description).
node()- rtype
Node
Return a node delegate for this plug.
- rtype
list(Plug)
outputs()Return the node plugs iteration.
Remove all the dynamic valued dependencies from this plug.
- type notify
bool
remove_all_valued_dependencies(undo_stack)- type undo_stack
bool
remove_dynamic_valued_dependencyremove_notification_dependency(dependence, ...)- type dependence
Plug
remove_valued_dependencyReturn the rest plug value.
set_default_value(value)Set the default value of this plug.
set_description(description, undo_stack)Set the description of this plug.
set_flags(flags)Set the plug flags.
set_value(value, undo_stack)Set a value.
status()Return the plug status.
touchtype_name(mode)Returns the name of the type the plug.
value(qc, mode)Get the plug value.
Return all valued dependencies of this plug, ordered by their indices.
The number of valued dependencies for this plug.
- class Flags
Members:
none :
cache :
time_varying :
serial :
hidden :
channel :
main :
auto_connect :
no_input :
background :
- __init__()
- __init__()
Constructor(s)
Plug (name: unicode,value: Value,flags: int)
Create a free plug (i.e. not attached to a Node).
- Parameters
name (unicode) - Name of the plug
value (Value) - Value of the plug
flags (int) - Plug flags
- as_Box3f() Imath.Box3f
Returns the plug value as a Box3f.
You must be sure the plug value is a Box3f or you will have an empty box.
- Return type
- as_Color4f() Imath.Color4f
Returns the plug value as a Color4f.
You must be sure the plug value is a Color4f or you will have {0,0,0,0}.
- Return type
- as_M44d() Imath.M44d
Returns the plug value as a M44d.
You must be sure the plug value is a M44d or you will have an identity matrix.
- Return type
- as_Quatd() Imath.Quatd
Returns the plug value as a Quatd.
You must be sure the plug value is a Quatd or you will have an identity quaternion.
- Return type
- as_V2d() Imath.V2d
Returns the plug value as a V2d.
You must be sure the plug value is a V2d or you will have {0,0}.
- Return type
- as_V2i() Imath.V2i
Returns the plug value as a V2i.
You must be sure the plug value is a V2i or you will have {0,0}.
- Return type
- as_V3d() Imath.V3d
Returns the plug value as a V3d.
You must be sure the plug value is a V3d or you will have {0,0,0}.
- Return type
- as_V3i() Imath.V3i
Returns the plug value as a V3i.
You must be sure the plug value is a V3i or you will have {0,0,0}.
- Return type
- as_V4d() Imath.V4d
Returns the plug value as a V4d.
You must be sure the plug value is a V4d or you will have {0,0,0,0}.
- Return type
- as_V4i() Imath.V4i
Returns the plug value as a V4i.
You must be sure the plug value is a V4i or you will have {0,0,0,0}.
- Return type
- as_bool() bool
Returns the plug value as a bool.
You must be sure the plug value is an integer, a float or a boolean or you get false.
- Return type
bool
- as_double() double
Returns the plug value as a double.
You must be sure the plug value is an integer, a float or a boolean or you get 0.0.
- Return type
double
- as_float() float
Returns the plug value as a float.
You must be sure the plug value is an integer, a float or a boolean or you get 0.f.
- Return type
float
- as_int() int
Returns the plug value as an integer.
You must be sure the plug value is an integer, a float or a boolean or you get 0.
- Return type
int
- as_string() unicode
Returns the plug value as a string.
You must be sure the plug value is a string or you will have an empty string.
- Return type
unicode
- as_user_data() UserData
Returns the plug value as a user data.
If the underlying time is not a used data, a nullptr is returned.
- Return type
- can_connect(other: Plug) bool
Check if the plug can be connected.
Check if a loop would be created by connecting those two plugs
- Parameters
other (Plug) – The plug to be connected
- Return type
bool
- channel() Channel
If this plug has a single channel, return it, return nullptr otherwise.
- Return type
channel(channel_type: ChannelType) -> Channel
Return the specified channel if available, return nullptr otherwise.
- Return type
channel() -> Channel
If this plug has a single channel, return it, return nullptr otherwise.
- Return type
channel(channel_type: ChannelType) -> Channel
Return the specified channel if available, return nullptr otherwise.
- Return type
- connect(src: Plug, undo_stack: bool, serialize: bool) None
Connect src to this plug.
The value of src will be propagated to this plug.If true, the connection will be serialized in the file. If undo_stack is true, the connection is assumed to be serialized, and serialize is ignored.
- Parameters
src (Plug) – The source plug
undo_stack (bool) – If true, the connection is reverted if an undo is performed. Ignored if undo_stack is true.
- default_value() Value
Return the default plug value.
The default value is the value the plug has been created with. This is not the REST value (the value with no animation).
- Return type
- depend_on(plugs) bool
Return true if this plug depends on one of the plugs.
- Parameters
plugs – A list of plug to check for dependency
- Return type
bool
- description() AttributeDescriptor
Returns the plug’s description.
- Return type
- disconnect(undo_stack: bool) None
Disconnect the plug connected into this.
If true, the connection is restored if an undo is performed. Ignored if undo_stack is false.
- disconnect_outputs(undo_stack: bool) None
Disconnect all the plugs this plug is connected into.
If true, the connections are restored if an undo is performed. Ignored if undo_stack is false.
- document_path() unicode
Returns the path of this plug starting at the document node.
- Return type
unicode
- flags() int
Return the plug flags.
- Return type
int
- has_node() bool
- Return type
bool
- input_origin() Plug
Get the connection chain origin of a plug.
If this plug has a connection, this method returns the connection chain origin, i.e. the plug without connection that propagate its value to this plug. If this plug is not connected, the real input is the plug itself. The connection chain origin of this plug.
Returns this plug if it is not connected.
- Return type
- is_animable() bool
Return true if this plug is animable.
- Return type
bool
- is_auto_connect() bool
Return true if the plug connects when a node is dropped over a connection.
A node should have an input and an output plug for every types the node can auto connect.
- Return type
bool
- is_channel() bool
Return true if this plug is a channel. A channel is a plug visible and animatable by the animator.
- Return type
bool
- is_connected() bool
Return true if the plug has an input connection.
- Return type
bool
- is_connection_serialized() bool
Return true if the node connection has to be serialized.
- Return type
bool
- is_constant() bool
Return true if the plug value is constant in time.
- Return type
bool
- is_dynamic() bool
Return true if the plug is dynamic.
A dynamic plug can be dynamically created or removed, except if it comes from a referenced node.
- Return type
bool
- is_evaluated() bool
Return true if this plug is evaluated.
- Return type
bool
- is_internal() bool
Return true if this plug should be ignored by users and the UI.
- Return type
bool
- is_keyable() bool
Return true if this plug is keyable.
- Return type
bool
- is_main_plug() bool
Return true if the plug is a main plug, i-e, is displayed by default.
- Return type
bool
- is_mutable() bool
Return true if this plug is mutable (i.e. can be modified).
- Return type
bool
- is_output() bool
Return true if this plug is an output.
- Return type
bool
- is_referenced_connection() bool
Return true if the input connection has been done in a referenced node.
- Return type
bool
- is_referenced_dynamic() bool
Return true if the plug is dynamic and comes from a referenced node.
A dynamic plug can be dynamically created or removed, except if it comes from a referenced node.
- Return type
bool
- key_frames()
Get the plug keys in targeted layer.
- name() unicode
Return the plug name.
- Return type
unicode
- nice_name() unicode
Returns the name of this plug to be displayed in UI (extracted from the ‘nice_name’ property of the description).
- Return type
unicode
- node_delegate() NodeDelegate
Return a node delegate for this plug.
- Return type
- outputs() Outputs
Return the node plugs iteration.
- Return type
Outputs
- remove_all_dynamic_valued_dependencies(undo_stack: bool) None
Remove all the dynamic valued dependencies from this plug. Internal dependencies are not removed.
- remove_all_notification_dependencies(notify: bool) None
- remove_all_valued_dependencies(undo_stack: bool) None
- rest_value() Value
Return the rest plug value.
The rest value is the value of the plug without animation (all animation layers disabled). This is not the DEFAULT value (the initial plug’s value).
- Return type
- set_description(description: unicode, undo_stack: bool) None
Set the description of this plug.
set_description(description: unicode,undo_stack: bool) -> None
Set the description of this plug.
- set_flags(flags: int) None
Set the plug flags.
- set_value(value: Value, undo_stack: bool) None
Set a value.
set_value(value: Value,pi: PartialInvalidationPtr,undo_stack: bool) -> None
Set a value along with PartialInvalidation data.
set_value(value: Value,mc: ModificationContext) -> None
Set a value.
set_value(value: Value,mc: ModificationContext,start: int32_t,end: int32_t) -> None
Set a value with a custom invalidation range.
The plug is set to the new value, but its back dependent plugs will be invalidated but only on the frame range specified by the user.
set_value(value: Value,undo_stack: bool) -> None
Set a value.
set_value(value: Value,pi: PartialInvalidationPtr,undo_stack: bool) -> None
Set a value along with PartialInvalidation data.
set_value(value: Value,mc: ModificationContext) -> None
Set a value.
set_value(value: Value,mc: ModificationContext,start: int32_t,end: int32_t) -> None
Set a value with a custom invalidation range.
The plug is set to the new value, but its back dependent plugs will be invalidated but only on the frame range specified by the user.
- status() Plug.Status
Return the plug status.
Check if the plug is overriden, animated or untouched
- Return type
Plug.Status
- type_name(mode: TypeEvaluationMode) unicode
Returns the name of the type the plug.
- Return type
unicode
- static validate_name(plug_name: unicode) bool
Return true if the name is a valid plug name.
- Return type
bool
- value(qc: QueryContext, mode: EvaluationMode) Value
Get the plug value.
- Parameters
qc (QueryContext) – Specifies the context of the value query (the frame or the default value)
mode (EvaluationMode) – Specifies the method to use to evaluate the value
- Return type
value(qc: QueryContext,mode: EvaluationMode) -> Value
Get the plug value.
- Parameters
qc (QueryContext) – Specifies the context of the value query (the frame or the default value)
mode (EvaluationMode) – Specifies the method to use to evaluate the value
- Return type
value(qc: QueryContext,mode: EvaluationMode) -> Value
Get the plug value.
- Parameters
qc (QueryContext) – Specifies the context of the value query (the frame or the default value)
mode (EvaluationMode) – Specifies the method to use to evaluate the value
- Return type
value(qc: QueryContext,mode: EvaluationMode) -> Value
Get the plug value.
- Parameters
qc (QueryContext) – Specifies the context of the value query (the frame or the default value)
mode (EvaluationMode) – Specifies the method to use to evaluate the value
- Return type
value(qc: QueryContext,mode: EvaluationMode) -> Value
Get the plug value.
- Parameters
qc (QueryContext) – Specifies the context of the value query (the frame or the default value)
mode (EvaluationMode) – Specifies the method to use to evaluate the value
- Return type
- valued_dependencies()
Return all valued dependencies of this plug, ordered by their indices.
- Return type
list(Plug)
- valued_dependencies_count() int
The number of valued dependencies for this plug.
- Return type
int