mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-04 09:18:27 +02:00
Add sugar to connect attributes directly at the node creation
This commit is contained in:
parent
e47e592713
commit
85eff3509f
1 changed files with 8 additions and 2 deletions
|
@ -124,7 +124,11 @@ class Attribute(BaseObject):
|
|||
and clear the string value.
|
||||
"""
|
||||
v = self._value
|
||||
if isinstance(v, basestring) and len(v) > 2 and v[0] == '{' and v[-1] == '}':
|
||||
if isinstance(v, Attribute):
|
||||
g = self.node.graph
|
||||
g.addEdge(v, self)
|
||||
self._value = ""
|
||||
elif isinstance(v, basestring) and len(v) > 2 and v[0] == '{' and v[-1] == '}':
|
||||
# value is a link to another attribute
|
||||
g = self.node.graph
|
||||
link = v[1:-1]
|
||||
|
@ -582,7 +586,9 @@ class Graph(BaseObject):
|
|||
:return:
|
||||
:rtype: Node
|
||||
"""
|
||||
return self.addNode(Node(nodeDesc=nodeType, parent=self, **kwargs))
|
||||
node = self.addNode(Node(nodeDesc=nodeType, parent=self, **kwargs))
|
||||
node._applyExpr()
|
||||
return node
|
||||
|
||||
def _createUniqueNodeName(self, inputName):
|
||||
i = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue