mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-06 03:17:19 +02:00
[core] Coloring a Node: Exposed the Node Color to be set externally
This commit is contained in:
parent
b5dda4efd0
commit
58a9b74a72
1 changed files with 13 additions and 4 deletions
|
@ -556,6 +556,15 @@ class BaseNode(BaseObject):
|
||||||
return self.internalAttribute("color").value.strip()
|
return self.internalAttribute("color").value.strip()
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
def setColor(self, color: str):
|
||||||
|
""" Sets the color of the Node.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
color (str): The hex of the color to set on the node.
|
||||||
|
"""
|
||||||
|
if self.hasInternalAttribute("color"):
|
||||||
|
self.internalAttribute("color").value = color
|
||||||
|
|
||||||
def getInvalidationMessage(self):
|
def getInvalidationMessage(self):
|
||||||
"""
|
"""
|
||||||
Returns:
|
Returns:
|
||||||
|
@ -967,7 +976,7 @@ class BaseNode(BaseObject):
|
||||||
if attr.value is None:
|
if attr.value is None:
|
||||||
# Discard dynamic values depending on the graph processing.
|
# Discard dynamic values depending on the graph processing.
|
||||||
return
|
return
|
||||||
|
|
||||||
if self.graph and self.graph.isLoading:
|
if self.graph and self.graph.isLoading:
|
||||||
# Do not trigger attribute callbacks during the graph loading.
|
# Do not trigger attribute callbacks during the graph loading.
|
||||||
return
|
return
|
||||||
|
@ -1356,7 +1365,7 @@ class BaseNode(BaseObject):
|
||||||
False otherwise.
|
False otherwise.
|
||||||
"""
|
"""
|
||||||
for attr in self._attributes:
|
for attr in self._attributes:
|
||||||
if attr.enabled and attr.isOutput and (attr.desc.semantic == "sequence" or
|
if attr.enabled and attr.isOutput and (attr.desc.semantic == "sequence" or
|
||||||
attr.desc.semantic == "imageList"):
|
attr.desc.semantic == "imageList"):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
@ -1386,7 +1395,7 @@ class BaseNode(BaseObject):
|
||||||
internalAttributes = Property(BaseObject, getInternalAttributes, constant=True)
|
internalAttributes = Property(BaseObject, getInternalAttributes, constant=True)
|
||||||
internalAttributesChanged = Signal()
|
internalAttributesChanged = Signal()
|
||||||
label = Property(str, getLabel, notify=internalAttributesChanged)
|
label = Property(str, getLabel, notify=internalAttributesChanged)
|
||||||
color = Property(str, getColor, notify=internalAttributesChanged)
|
color = Property(str, getColor, setColor, notify=internalAttributesChanged)
|
||||||
invalidation = Property(str, getInvalidationMessage, notify=internalAttributesChanged)
|
invalidation = Property(str, getInvalidationMessage, notify=internalAttributesChanged)
|
||||||
comment = Property(str, getComment, notify=internalAttributesChanged)
|
comment = Property(str, getComment, notify=internalAttributesChanged)
|
||||||
internalFolderChanged = Signal()
|
internalFolderChanged = Signal()
|
||||||
|
@ -1909,7 +1918,7 @@ def nodeFactory(nodeDict, name=None, template=False, uidConflict=False):
|
||||||
# do not perform that check for internal attributes because there is no point in
|
# do not perform that check for internal attributes because there is no point in
|
||||||
# raising compatibility issues if their number differs: in that case, it is only useful
|
# raising compatibility issues if their number differs: in that case, it is only useful
|
||||||
# if some internal attributes do not exist or are invalid
|
# if some internal attributes do not exist or are invalid
|
||||||
if not template and (sorted([attr.name for attr in nodeDesc.inputs
|
if not template and (sorted([attr.name for attr in nodeDesc.inputs
|
||||||
if not isinstance(attr, desc.PushButtonParam)]) != sorted(inputs.keys()) or
|
if not isinstance(attr, desc.PushButtonParam)]) != sorted(inputs.keys()) or
|
||||||
sorted([attr.name for attr in nodeDesc.outputs if not attr.isDynamicValue]) !=
|
sorted([attr.name for attr in nodeDesc.outputs if not attr.isDynamicValue]) !=
|
||||||
sorted(outputs.keys())):
|
sorted(outputs.keys())):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue