mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 02:08:08 +02:00
[core] add isInput property in Attribute desc
This commit is contained in:
parent
b22c2b5a62
commit
a0cdc65143
2 changed files with 5 additions and 5 deletions
|
@ -21,7 +21,8 @@ class Attribute(BaseObject):
|
|||
uid = Property(Variant, lambda self: self._uid, constant=True)
|
||||
group = Property(str, lambda self: self._group, constant=True)
|
||||
isOutput = Property(bool, lambda self: self._isOutput, constant=True)
|
||||
|
||||
isInput = Property(bool, lambda self: not self._isOutput, constant=True)
|
||||
|
||||
|
||||
class ListAttribute(Attribute):
|
||||
""" A list of Attributes """
|
||||
|
|
|
@ -88,7 +88,6 @@ class Attribute(BaseObject):
|
|||
self.attributeDesc = attributeDesc
|
||||
self._value = getattr(attributeDesc, 'value', None)
|
||||
self._label = getattr(attributeDesc, 'label', None)
|
||||
self._isOutput = getattr(attributeDesc, 'isOutput', False)
|
||||
|
||||
# invalidation value for output attributes
|
||||
self._invalidationValue = ""
|
||||
|
@ -125,7 +124,7 @@ class Attribute(BaseObject):
|
|||
|
||||
@property
|
||||
def isOutput(self):
|
||||
return self._isOutput
|
||||
return self.attributeDesc.isOutput
|
||||
|
||||
def uid(self):
|
||||
"""
|
||||
|
@ -142,7 +141,7 @@ class Attribute(BaseObject):
|
|||
@property
|
||||
def isLink(self):
|
||||
""" Whether the attribute is a link to another attribute. """
|
||||
return not self.isOutput and self in self.node.graph.edges.keys()
|
||||
return self.attributeDesc.isInput and self in self.node.graph.edges.keys()
|
||||
|
||||
def getLinkParam(self):
|
||||
return self.node.graph.edge(self).src if self.isLink else None
|
||||
|
@ -461,7 +460,7 @@ class Node(BaseObject):
|
|||
|
||||
# Evaluate output params
|
||||
for name, attr in self._attributes.objects.items():
|
||||
if not attr.attributeDesc.isOutput:
|
||||
if attr.attributeDesc.isInput:
|
||||
continue # skip inputs
|
||||
attr.value = attr.attributeDesc.value.format(
|
||||
nodeType=self.nodeType,
|
||||
|
|
Loading…
Add table
Reference in a new issue