mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-05 12:21:59 +02:00
[core] PushButton attribute implemented
Add PushButtonParam class and implement onAttributeClicked method
This commit is contained in:
parent
6791f02f2d
commit
eb1a0faf97
3 changed files with 31 additions and 0 deletions
|
@ -892,6 +892,19 @@ class BaseNode(BaseObject):
|
|||
if callable(m):
|
||||
m(self)
|
||||
|
||||
def onAttributeClicked(self, attr):
|
||||
""" When an attribute is clicked, a specific function can be defined in the descriptor and be called.
|
||||
|
||||
Args:
|
||||
attr (Attribute): attribute that has been clicked
|
||||
"""
|
||||
paramName = attr.name[:1].upper() + attr.name[1:]
|
||||
methodName = f'on{paramName}Clicked'
|
||||
if hasattr(self.nodeDesc, methodName):
|
||||
m = getattr(self.nodeDesc, methodName)
|
||||
if callable(m):
|
||||
m(self)
|
||||
|
||||
def updateInternals(self, cacheDir=None):
|
||||
""" Update Node's internal parameters and output attributes.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue