mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-21 13:06:28 +02:00
[core] Node: add 'label' property
high-level label for nodes, without '_' and including index if > 1
This commit is contained in:
parent
3dad1e3aac
commit
d2aba176dc
1 changed files with 9 additions and 0 deletions
|
@ -362,6 +362,14 @@ class BaseNode(BaseObject):
|
|||
def getName(self):
|
||||
return self._name
|
||||
|
||||
def getLabel(self):
|
||||
"""
|
||||
Returns:
|
||||
str: the high-level label of this node
|
||||
"""
|
||||
t, idx = self._name.split("_")
|
||||
return "{}{}".format(t, idx if int(idx) > 1 else "")
|
||||
|
||||
@property
|
||||
def packageFullName(self):
|
||||
return '-'.join([self.packageName, self.packageVersion])
|
||||
|
@ -615,6 +623,7 @@ class BaseNode(BaseObject):
|
|||
return self.name
|
||||
|
||||
name = Property(str, getName, constant=True)
|
||||
label = Property(str, getLabel, constant=True)
|
||||
nodeType = Property(str, nodeType.fget, constant=True)
|
||||
positionChanged = Signal()
|
||||
position = Property(Variant, position.fget, position.fset, notify=positionChanged)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue