bgdev.api.attribute

Attribute utilities using OpenMaya.

author

Benoit Gielly (benoit.gielly@gmail.com)

get_alias(plug)[source]

Get given plug’s alias if any.

get_alias_list(node)[source]

Get all alias attribute in pair from given node.

get_attr(plug)[source]

Get the given plug’s value.

Parameters

plug (str) – Name of the plug (must be “node.attr”)

Returns

Depends on the plug type.

Return type

type

get_multi_indices(plug)[source]

Get the plug’s multi-indices.

get_next_index(plug)[source]

Get next available index in given plug.

get_node_aliases(node, attr='weight', indices=False)[source]

Get a list of given node’s aliases ordered by their index.

Parameters
  • node (str) – The node whose aliases will be queried.

  • attr (str) – The name of the attribute to query.

  • indices (bool) – If True, returns a dict with indices as values.

Returns

List of aliases in index order.

Return type

list or dict

is_free(plug)[source]

Get the plug’s isFreeToChange state.

is_locked(plug)[source]

Get the plug’s locked state.

set_alias(plug, alias, remove=False)[source]

Set or remove an alias on given plug.