mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-20 20:46:28 +02:00
[processGraph] Attribute.value as an "hybrid" property
Use "hybrid" property to simplify naming of properties. No matter the backend used (qt or core), the property is always accessible via its name, without differently named getter or setter methods.
This commit is contained in:
parent
d556547d0b
commit
a81aa53a6b
2 changed files with 12 additions and 7 deletions
|
@ -117,11 +117,14 @@ class SetAttributeCommand(GraphCommand):
|
|||
self.nodeName = attribute.node.getName()
|
||||
self.attrName = attribute.getName()
|
||||
self.value = value
|
||||
self.oldValue = attribute.getValue()
|
||||
self.oldValue = attribute.value
|
||||
self.setText("Set Attribute '{}'".format(attribute.fullName()))
|
||||
|
||||
def redoImpl(self):
|
||||
self.graph.node(self.nodeName).attribute(self.attrName).setValue(self.value)
|
||||
if self.value == self.oldValue:
|
||||
return False
|
||||
self.graph.node(self.nodeName).attribute(self.attrName).value = self.value
|
||||
return True
|
||||
|
||||
def undoImpl(self):
|
||||
self.graph.node(self.nodeName).attribute(self.attrName).setValue(self.oldValue)
|
||||
self.graph.node(self.nodeName).attribute(self.attrName).value = self.oldValue
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue