pyfrost.main

Convenient class used to create bifrost node graphs in python.

author

Benoit Gielly <benoit.gielly@gmail.com>

Bifrost VNN command documentation https://help.autodesk.com/view/BIFROST/ENU/?guid=__CommandsPython_index_html

class Graph(board=None)[source]

Bases: object

Create a new bifrost graph object.

board_name = 'default'
__init__(board=None)[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__()[source]

Return repr(self).

__str__()[source]

Return str(self).

__getitem__(key)[source]
get(name)[source]

Get given string as node or attr.

property name

Get the name of the board.

property nodes

Get nodes at the board/root level.

create_node(type_, parent='/', name=None)[source]

Create a new bifrost node in the graph.

from_json(path)[source]

Create a compound from JSON file.

class Node(graph, parent, nodetype=None, name=None)[source]

Bases: object

Create Node object.

__init__(graph, parent, nodetype=None, name=None)[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__(*args, **kwargs)[source]

Return repr(self).

__str__()[source]

Return str(self).

__getitem__(key)[source]
attr(value)[source]

Return the attribute class.

node(value)[source]

Get a child of this node.

get_children()[source]

Get children nodes.

create_node(type_, name=None)[source]

Create a new node in the current compound.

rename(name)[source]

Rename node.

Note

the renameNode option doesn’t return the new name, so the only way to figure out the unique name is to query all nodes, rename, query again and diff…(cool stuff, right?!)

property path

Get node’s path.

property name

Get node’s name.

property parent

Get node’s parent.

property type

Get node’s type.

property uuid

Get node’s UUID.

set_metadata(metadata)[source]

Set node metadata.

class Attribute(node_object, attribute=None)[source]

Bases: object

Create Attribute object.

__init__(node_object, attribute=None)[source]

Initialize self. See help(type(self)) for accurate signature.

__str__()[source]

Return str(self).

__repr__()[source]

Return repr(self).

__rshift__(plug)[source]
__floordiv__(plug)[source]
property exists

Check if attribute exists.

property type

Get attribute type.

property value

Get and set attribute value.

add(direction, datatype='auto', value=None)[source]

Add input plug on given node.

connect(target)[source]

Connect plugs.

disconnect(target)[source]

Disconnect plugs.