Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin System #2407

Open
wants to merge 11 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
changes for uid renaming
added back menu after update

fix for existing symlink
Matthieu Hog committed Oct 8, 2024
commit b3aef333adbbd4b29f5eaa4b73c39cafcfd98ea4
10 changes: 7 additions & 3 deletions meshroom/core/plugin.py
Original file line number Diff line number Diff line change
@@ -170,7 +170,11 @@ def installPlugin(pluginUrl):
if isLocal:
os.symlink(pluginParam.nodesFolder, intallFolder)
if os.path.isdir(pluginParam.pipelineFolder):
os.symlink(pluginParam.pipelineFolder, os.path.join(pluginsPipelinesFolder, pluginParam.pluginName))
pipelineFolderLink = os.path.join(pluginsPipelinesFolder, pluginParam.pluginName)
if os.path.exists(pipelineFolderLink):
logging.warn("Plugin already installed, will overwrite")
os.unlink(pipelineFolderLink)
os.symlink(pluginParam.pipelineFolder, pipelineFolderLink)
else:
copy_tree(pluginParam.nodesFolder, intallFolder)
if os.path.isdir(pluginParam.pipelineFolder):
@@ -298,7 +302,7 @@ def getCommandLine(chunk):
raise RuntimeError("The project needs to be saved to use plugin nodes")
saved_graph = loadGraph(chunk.node.graph.filepath)
if (str(chunk.node) not in [str(f) for f in saved_graph._nodes._objects]
or chunk.node._uids[0] != saved_graph.findNode(str(chunk.node))._uids[0] ):
or chunk.node._uid != saved_graph.findNode(str(chunk.node))._uid ):
raise RuntimeError("The changes needs to be saved to use plugin nodes")

cmdPrefix = ""
@@ -342,7 +346,7 @@ def getCommandLine(chunk):

return command

# you may use these to esplicitly define Pluginnodes
# you may use these to explicitly define Pluginnodes
class PluginNode(desc.Node):
pass

31 changes: 21 additions & 10 deletions meshroom/ui/qml/Application.qml
Original file line number Diff line number Diff line change
@@ -825,6 +825,18 @@ Page {
ToolTip.visible: hovered
ToolTip.text: removeImagesFromAllGroupsAction.tooltip
}

MenuItem {
action: installPluginFromFolderAction
ToolTip.visible: hovered
ToolTip.text: "Install plugin from a folder"
}

MenuItem {
action: installPluginFromURLAction
ToolTip.visible: hovered
ToolTip.text: "Install plugin from a local or online url"
}
}
MenuSeparator { }
Action {
@@ -1298,18 +1310,17 @@ Page {
var n = _reconstruction.upgradeNode(node)
_reconstruction.selectedNode = n
}
}

onDoBuild: {
try {
_reconstruction.buildNode(node.name)
node.isNotBuilt=false
} catch (error) {
//NOTE: could do an error popup
console.log("Build error:")
console.log(error)
onDoBuild: {
try {
_reconstruction.buildNode(node.name)
node.isNotBuilt=false
} catch (error) {
//NOTE: could do an error popup
console.log("Build error:")
console.log(error)
}
}

}
}
}
1 change: 0 additions & 1 deletion meshroom/ui/qml/GraphEditor/Node.qml
Original file line number Diff line number Diff line change
@@ -31,7 +31,6 @@ Item {
property point position: Qt.point(x, y)
/// Styling
property color shadowColor: "#cc000000"
//readonly property color defaultColor: isCompatibilityNode ? "#444" : ((isPlugin && isNotBuilt) ? "#444": (!node.isComputable ? "#BA3D69" : activePalette.base))
readonly property color defaultColor: isCompatibilityNode ? "#444" : (!node.isComputable ? "#BA3D69" : activePalette.base)
property color baseColor: defaultColor