mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-31 23:38:48 +02:00
Add "label" as an internal attribute
Setting the "label" internal attribute allows to give a custom label to replace the node's default label.
This commit is contained in:
parent
9bc9e2c129
commit
330382ab0c
4 changed files with 31 additions and 1 deletions
|
@ -524,8 +524,12 @@ class BaseNode(BaseObject):
|
|||
def getLabel(self):
|
||||
"""
|
||||
Returns:
|
||||
str: the high-level label of this node
|
||||
str: the user-provided label if it exists, the high-level label of this node otherwise
|
||||
"""
|
||||
if self.hasInternalAttribute("label"):
|
||||
label = self.internalAttribute("label").value.strip()
|
||||
if label:
|
||||
return label
|
||||
return self.nameToLabel(self._name)
|
||||
|
||||
@Slot(str, result=str)
|
||||
|
@ -856,6 +860,9 @@ class BaseNode(BaseObject):
|
|||
if self.internalFolder != folder:
|
||||
self.internalFolderChanged.emit()
|
||||
|
||||
def updateInternalAttributes(self):
|
||||
self.internalAttributesChanged.emit()
|
||||
|
||||
@property
|
||||
def internalFolder(self):
|
||||
return self._internalFolder.format(**self._cmdVars)
|
||||
|
@ -1089,6 +1096,7 @@ class BaseNode(BaseObject):
|
|||
y = Property(float, lambda self: self._position.y, notify=positionChanged)
|
||||
attributes = Property(BaseObject, getAttributes, constant=True)
|
||||
internalAttributes = Property(BaseObject, getInternalAttributes, constant=True)
|
||||
internalAttributesChanged = Signal()
|
||||
internalFolderChanged = Signal()
|
||||
internalFolder = Property(str, internalFolder.fget, notify=internalFolderChanged)
|
||||
depthChanged = Signal()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue