mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-19 03:56:26 +02:00
[ui] GraphEditor: only connect compatible attributes
This commit is contained in:
parent
85044e50cb
commit
5fb6a5fb0f
3 changed files with 35 additions and 18 deletions
|
@ -227,6 +227,9 @@ class AddEdgeCommand(GraphCommand):
|
|||
self.dstAttr = dst.getFullName()
|
||||
self.setText("Connect '{}'->'{}'".format(self.srcAttr, self.dstAttr))
|
||||
|
||||
if src.baseType != dst.baseType:
|
||||
raise ValueError("Attribute types are not compatible and cannot be connected: '{}'({})->'{}'({})".format(self.srcAttr, src.baseType, self.dstAttr, dst.baseType))
|
||||
|
||||
def redoImpl(self):
|
||||
self.graph.addEdge(self.graph.attribute(self.srcAttr), self.graph.attribute(self.dstAttr))
|
||||
return True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue