-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BoundingBox] fix automatic bounding box
- fix circular dependacy issue in import - fix dirty hack for reading python variable "automaticBBoxValid" in qml
- Loading branch information
Showing
5 changed files
with
61 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from meshroom.nodes.aliceVision.Meshing import boundingBoxMonitor | ||
from meshroom.core.node import Node | ||
from meshroom.common import Property, Signal | ||
|
||
class MeshingNode(Node): | ||
def __init__(self, nodeType, position=None, parent=None, **kwargs): | ||
super().__init__(nodeType, position, parent, **kwargs) | ||
self.internalFolderChanged.connect(self.checkBBox) | ||
self.globalStatusChanged.connect(self.checkBBox) | ||
self._automaticBBoxValid = False | ||
|
||
@property | ||
def automaticBBoxValid(self): | ||
return self._automaticBBoxValid | ||
|
||
@automaticBBoxValid.setter | ||
def automaticBBoxValid(self, value): | ||
self._automaticBBoxValid = value | ||
self.automaticBBoxValidChanged.emit() | ||
|
||
automaticBBoxValidChanged = Signal() | ||
automaticBBoxValid = Property(bool, automaticBBoxValid.fget, automaticBBoxValid.fset, notify=automaticBBoxValidChanged) | ||
|
||
def checkBBox(self): | ||
"""Load automatic bounding box if needed.""" | ||
if self.useBoundingBox.value: | ||
return | ||
self.automaticBBoxValid = False | ||
with boundingBoxMonitor(self, checkOnce=True) as thread: | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import TYPE_CHECKING | ||
|
||
def getNodeClass(nodeType: str): | ||
""" | ||
Returns the appropriate subclass of `meshroom.core.node.Node` based on `nodeType`. | ||
Inputs | ||
------ | ||
nodeType: str | ||
the name of the node type | ||
Returns | ||
------- | ||
type[Node] | ||
the corresponding type class | ||
""" | ||
if nodeType=="Meshing": | ||
from meshroom.core.nodes.MeshingNode import MeshingNode | ||
cls = MeshingNode | ||
else: | ||
from meshroom.core.node import Node | ||
cls = Node | ||
return cls |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters