Plug

Inheritance diagram of rumba.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).

__init__

Constructor(s)

__ne__

Return self!=value.

add_dynamic_valued_dependency

add_notification_dependency(dependence, ...)

type dependence

Plug

add_valued_dependency

as_Box3f()

Returns the plug value as a Box3f.

as_Color4f()

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.

as_double()

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.

as_string()

Returns the plug value as a string.

as_user_data()

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.

channel_plugs()

rtype

list(Plug)

channels()

Return all the plug's channels.

connect(src, undo_stack, serialize)

Connect src to this plug.

default_value()

Return the default plug value.

depend_on(plugs)

Return true if this plug depends on one of the plugs.

description()

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.

document_path()

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.

input_origin()

Get the connection chain origin of a plug.

is_animable()

Return true if this plug is animable.

is_auto_connect()

Return true if the plug connects when a node is dropped over a connection.

is_channel()

Return true if this plug is a channel.

is_connected()

Return true if the plug has an input connection.

is_connection_serialized()

Return true if the node connection has to be serialized.

is_constant()

Return true if the plug value is constant in time.

is_dynamic()

Return true if the plug is dynamic.

is_evaluated()

Return true if this plug is evaluated.

is_internal()

Return true if this plug should be ignored by users and the UI.

is_keyable()

Return true if this plug is keyable.

is_main_plug()

Return true if the plug is a main plug, i-e, is displayed by default.

is_mutable()

Return true if this plug is mutable (i.e.

is_output()

Return true if this plug is an output.

is_referenced_connection()

Return true if the input connection has been done in a referenced node.

is_referenced_dynamic()

Return true if the plug is dynamic and comes from a referenced node.

key_frames()

Get the plug keys in targeted layer.

key_frames_in_layer(layer)

Get the plug keys in the layer.

name()

Return the plug name.

nice_name()

Returns the name of this plug to be displayed in UI (extracted from the 'nice_name' property of the description).

node()

rtype

Node

node_delegate()

Return a node delegate for this plug.

notification_dependencies()

rtype

list(Plug)

outputs()

Return the node plugs iteration.

remove_all_dynamic_valued_dependencies(...)

Remove all the dynamic valued dependencies from this plug.

remove_all_notification_dependencies(notify)

type notify

bool

remove_all_valued_dependencies(undo_stack)

type undo_stack

bool

remove_dynamic_valued_dependency

remove_notification_dependency(dependence, ...)

type dependence

Plug

remove_valued_dependency

rest_value()

Return 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.

touch

type_name(mode)

Returns the name of the type the plug.

value(qc, mode)

Get the plug value.

valued_dependencies()

Return all valued dependencies of this plug, ordered by their indices.

valued_dependencies_count()

The number of valued dependencies for this plug.

class DependencyFlags

Members:

Automatic :

__init__()
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

add_notification_dependency(dependence: Plug, serialize: bool) None
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

Imath.Box3f

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

Imath.Color4f

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

Imath.M44d

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

Imath.Quatd

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

Imath.V2d

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

Imath.V2i

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

Imath.V3d

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

Imath.V3i

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

Imath.V4d

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

Imath.V4i

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

UserData

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(channel_type: ChannelType) -> Channel

Return the specified channel if available, return nullptr otherwise.

Return type

Channel

channel() -> Channel

If this plug has a single channel, return it, return nullptr otherwise.

Return type

Channel

channel(channel_type: ChannelType) -> Channel

Return the specified channel if available, return nullptr otherwise.

Return type

Channel

channel_plugs()
Return type

list(Plug)

channels()

Return all the plug’s channels.

Return type

list(Channel)

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

Value

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

AttributeDescriptor

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() Plug

Get the input plug.

Return type

Plug

Raises

RuntimeError – if the plug is not connected

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

Plug

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.

key_frames_in_layer(layer: Node)

Get the plug keys in the 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() Node
Return type

Node

node_delegate() NodeDelegate

Return a node delegate for this plug.

Return type

NodeDelegate

notification_dependencies()
Return type

list(Plug)

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
remove_notification_dependency(dependence: Plug, notify: 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

Value

set_default_value(value: Value) None

Set the default value of this plug.

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

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

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

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

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

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