add_node_component
add_node_component
¶
Attributes¶
LOGGER = logging.getLogger(__name__)
module-attribute
¶
Classes¶
AddNodeComponentCommand(node, type_id, name=None, parent=None)
¶
Bases: NyxCommand
Add a new component to a node.
Initialize AddNodeComponentCommand.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node
|
Node
|
node receiving the component. |
required |
type_id
|
str
|
registered component type id. |
required |
name
|
str | None
|
component name. Defaults to the type's default name. |
None
|
parent
|
QUndoCommand | None
|
parent command. |
None
|
Source code in src/nyx/core/commands/add_node_component.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | |
Attributes¶
MODIFIES_STRUCTURE = True
class-attribute
instance-attribute
¶
component_uuid = None
instance-attribute
¶
name = name
instance-attribute
¶
node_uuid = node.uuid
instance-attribute
¶
result_component
property
¶
NodeComponent: component created by the command.
type_id = type_id
instance-attribute
¶
Functions¶
redo()
¶
Create and add the component.
Source code in src/nyx/core/commands/add_node_component.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
target_nodes()
¶
list[Node]: nodes the command changes.
Source code in src/nyx/core/commands/add_node_component.py
47 48 49 | |
undo()
¶
Remove the added component.
Source code in src/nyx/core/commands/add_node_component.py
67 68 69 70 71 | |
validate()
¶
Check the node exists and the component type is registered.
Source code in src/nyx/core/commands/add_node_component.py
73 74 75 76 77 78 79 80 81 82 | |