Skip to content

Commit

Permalink
GuiApp: doc
Browse files Browse the repository at this point in the history
  • Loading branch information
devernay committed Oct 6, 2021
1 parent cdbeae1 commit a1cbb64
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
- Fix ASCII curve import. #656
- New color selection dialog for RGB and RGBA knobs. #210
- Fix histogram smoothing (was 5 times too strong).
- Add Python functions `guiApp.copySelectedNodes` and `guiApp.pasteNodes`. #390 #674 #675


### Plugins

Expand Down
16 changes: 16 additions & 0 deletions Documentation/source/devel/PythonReference/NatronGui/GuiApp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ Functions
- def :meth:`deselectNode<NatronGui.GuiApp.deselectNode>` (node)
- def :meth:`setSelection<NatronGui.GuiApp.setSelection>` (nodes)
- def :meth:`selectAllNodes<NatronGui.GuiApp.selectAllNodes>` ([group=None])
- def :meth:`copySelectedNodes<NatronGui.GuiApp.copySelectedNodes>` ([group=None])
- def :meth:`pasteNodes<NatronGui.GuiApp.pasteNodes>` ([group=None])
- def :meth:`clearSelection<NatronGui.GuiApp.clearSelection>` ([group=None])
- def :meth:`registerPythonPanel<NatronGui.GuiApp.registerPythonPanel>` (panel,pythonFunction)
- def :meth:`unregisterPythonPanel<NatronGui.GuiApp.unregisterPythonPanel>` (panel)
Expand Down Expand Up @@ -258,6 +260,20 @@ Returns a user panel matching the given *scriptName* if there is any.
Select all nodes in the given *group*. You can pass the *app* object to get the top-level
NodeGraph. If passing None, the last user-selected NodeGraph will be used.

.. method:: NatronGui.GuiApp.copySelectedNodes([group=None])

:param group: :class:`Group<NatronEngine.Group>`

Copy all nodes in the given *group*. You can pass the *app* object to get the top-level
NodeGraph. If passing None, the last user-selected NodeGraph will be used.

.. method:: NatronGui.GuiApp.pasteNodes([group=None])

:param group: :class:`Group<NatronEngine.Group>`

Paste copied nodes in the given *group*. You can pass the *app* object to get the top-level
NodeGraph. If passing None, the last user-selected NodeGraph will be used.

.. method:: NatronGui.GuiApp.clearSelection([group=None])

Wipe any current selection in the given *group*. You can pass the *app* object to get the top-level
Expand Down
10 changes: 5 additions & 5 deletions Gui/PyGuiApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ GuiApp::selectNode(Effect* effect,
}
assert(graph);
if (!graph) {
throw std::logic_error("");
throw std::logic_error("invalid graph");
}
graph->selectNode(nodeUi, !clearPreviousSelection);
}
Expand Down Expand Up @@ -388,7 +388,7 @@ GuiApp::setSelection(const std::list<Effect*>& nodes)
}
assert(graph);
if (!graph) {
throw std::logic_error("");
throw std::logic_error("invalid graph");
}
graph->setSelection(selection);
}
Expand Down Expand Up @@ -419,7 +419,7 @@ GuiApp::selectAllNodes(Group* group)
}
assert(graph);
if (!graph) {
throw std::logic_error("");
throw std::logic_error("invalid graph");
}
graph->selectAllNodes(false);
}
Expand Down Expand Up @@ -450,7 +450,7 @@ GuiApp::copySelectedNodes(Group* group)
}
assert(graph);
if (!graph) {
throw std::logic_error("invalid ggraph");
throw std::logic_error("invalid graph");
}
graph->copySelectedNodes();
}
Expand Down Expand Up @@ -541,7 +541,7 @@ GuiApp::clearSelection(Group* group)
}
assert(graph);
if (!graph) {
throw std::logic_error("");
throw std::logic_error("invalid graph");
}
graph->clearSelection();
}
Expand Down

0 comments on commit a1cbb64

Please sign in to comment.