mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-17 08:37:17 +02:00
Add "color" as an internal attribute
Setting this attribute allows the user to change the color of a node, either by directly providing an SVG color name or an hexadecimal color code, or by picking a color with the selector.
This commit is contained in:
parent
330382ab0c
commit
21d01acc9a
4 changed files with 98 additions and 1 deletions
|
@ -532,6 +532,15 @@ class BaseNode(BaseObject):
|
|||
return label
|
||||
return self.nameToLabel(self._name)
|
||||
|
||||
def getColor(self):
|
||||
"""
|
||||
Returns:
|
||||
str: the user-provided custom color of the node if it exists, empty string otherwise
|
||||
"""
|
||||
if self.hasInternalAttribute("color"):
|
||||
return self.internalAttribute("color").value.strip()
|
||||
return ""
|
||||
|
||||
@Slot(str, result=str)
|
||||
def nameToLabel(self, name):
|
||||
"""
|
||||
|
@ -1088,6 +1097,7 @@ class BaseNode(BaseObject):
|
|||
|
||||
name = Property(str, getName, constant=True)
|
||||
label = Property(str, getLabel, constant=True)
|
||||
color = Property(str, getColor, constant=True)
|
||||
nodeType = Property(str, nodeType.fget, constant=True)
|
||||
documentation = Property(str, getDocumentation, constant=True)
|
||||
positionChanged = Signal()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue