mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-05-17 19:16:26 +02:00
Add abstract InitNode
InitNode is an abstract class which is meant to be inherited by all the initialization nodes (such as CameraInit), included those that might be created by the user. InitNode contains methods that can be reimplemented by the children classes if necessary. This abstract class allows to keep on using scripts such as meshroom_batch without having to modify them specifically or being limited to using a CameraInit node.
This commit is contained in:
parent
96b4ec8d1d
commit
659c8a05ed
4 changed files with 111 additions and 38 deletions
|
@ -547,6 +547,14 @@ class Graph(BaseObject):
|
|||
nodes = [n for n in self._nodes.values() if n.nodeType == nodeType]
|
||||
return self.sortNodesByIndex(nodes) if sortedByIndex else nodes
|
||||
|
||||
def findInitNodes(self):
|
||||
"""
|
||||
Returns:
|
||||
list[Node]: the list of Init nodes (nodes inheriting from InitNode)
|
||||
"""
|
||||
nodes = [n for n in self._nodes.values() if isinstance(n.nodeDesc, meshroom.core.desc.InitNode)]
|
||||
return nodes
|
||||
|
||||
def findNodeCandidates(self, nodeNameExpr):
|
||||
pattern = re.compile(nodeNameExpr)
|
||||
return [v for k, v in self._nodes.objects.items() if pattern.match(k)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue