Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-03-16 16:51:11 +0300
committerHans Goudey <h.goudey@me.com>2022-03-16 16:51:11 +0300
commit943b919fe807b53558631bcbc688c2d712d6b0cc (patch)
treec1c141866f50eb1f28e1875195395c8582898cc2 /source/blender/editors/space_node/node_view.cc
parentcb267cec5552c17092a99999e4e352bf266b578f (diff)
Geometry Nodes: Remove legacy node code
This commit removes the implementations of legacy nodes, their type definitions, and related code that becomes unused. Now that we have two releases that included the legacy nodes, there is not much reason to include them still. Removing the code means refactoring will be easier, and old code doesn't have to be tested and maintained. After this commit, the legacy nodes will be undefined in the UI, so 3.0 or 3.1 should be used to convert files to the fields system. The net change is 12184 lines removed! The tooltip for legacy nodes mentioned that we would remove them before 4.0, which was purposefully a bit vague to allow us this flexibility. In a poll in a devtalk post showed that the majority of people were okay with removing the nodes. https://devtalk.blender.org/t/geometry-nodes-backward-compatibility-poll/20199 Differential Revision: https://developer.blender.org/D14353
Diffstat (limited to 'source/blender/editors/space_node/node_view.cc')
-rw-r--r--source/blender/editors/space_node/node_view.cc86
1 files changed, 0 insertions, 86 deletions
diff --git a/source/blender/editors/space_node/node_view.cc b/source/blender/editors/space_node/node_view.cc
index 36fdcf37fd7..f5f5a9e6f67 100644
--- a/source/blender/editors/space_node/node_view.cc
+++ b/source/blender/editors/space_node/node_view.cc
@@ -686,90 +686,4 @@ void NODE_OT_backimage_sample(wmOperatorType *ot)
/** \} */
-/* -------------------------------------------------------------------- */
-/** \name View Geometry Nodes Legacy Operator
- *
- * This operator should be removed when the 2.93 legacy nodes are removed.
- * \{ */
-
-static int space_node_view_geometry_nodes_legacy(bContext *C, SpaceNode *snode, wmOperator *op)
-{
- ARegion *region = CTX_wm_region(C);
-
- /* Only use the node editor's active node tree. Otherwise this will be too complicated. */
- bNodeTree *node_tree = snode->nodetree;
- if (node_tree == nullptr || node_tree->type != NTREE_GEOMETRY) {
- return OPERATOR_CANCELLED;
- }
-
- bool found_legacy_node = false;
- LISTBASE_FOREACH_BACKWARD (bNode *, node, &node_tree->nodes) {
- StringRef idname{node->idname};
- if (idname.find("Legacy") == StringRef::not_found) {
- node->flag &= ~NODE_SELECT;
- }
- else {
- found_legacy_node = true;
- node->flag |= NODE_SELECT;
- }
- }
-
- if (!found_legacy_node) {
- WM_report(RPT_INFO, "Legacy node not found, may be in nested node group");
- }
-
- const int smooth_viewtx = WM_operator_smooth_viewtx_get(op);
- if (space_node_view_flag(*C, *snode, *region, NODE_SELECT, smooth_viewtx)) {
- return OPERATOR_FINISHED;
- }
- return OPERATOR_CANCELLED;
-}
-
-static int geometry_node_view_legacy_exec(bContext *C, wmOperator *op)
-{
- /* Allow running this operator directly in a specific node editor. */
- if (SpaceNode *snode = CTX_wm_space_node(C)) {
- return space_node_view_geometry_nodes_legacy(C, snode, op);
- }
-
- /* Since the operator is meant to be called from a button in the modifier panel, the node tree
- * must be found from the screen, using the largest node editor if there is more than one. */
- if (ScrArea *area = BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_NODE, 0)) {
- if (SpaceNode *snode = static_cast<SpaceNode *>(area->spacedata.first)) {
- ScrArea *old_area = CTX_wm_area(C);
- ARegion *old_region = CTX_wm_region(C);
-
- /* Override the context since it is used by the View2D panning code. */
- CTX_wm_area_set(C, area);
- CTX_wm_region_set(C, static_cast<ARegion *>(area->regionbase.last));
- const int result = space_node_view_geometry_nodes_legacy(C, snode, op);
- CTX_wm_area_set(C, old_area);
- CTX_wm_region_set(C, old_region);
- return result;
- }
- }
-
- return OPERATOR_CANCELLED;
-}
-
-static bool geometry_node_view_legacy_poll(bContext *C)
-{
- /* Allow direct execution in a node editor, but also affecting any visible node editor. */
- return ED_operator_node_active(C) || BKE_screen_find_big_area(CTX_wm_screen(C), SPACE_NODE, 0);
-}
-
-void NODE_OT_geometry_node_view_legacy(wmOperatorType *ot)
-{
- ot->name = "View Deprecated Geometry Nodes";
- ot->idname = "NODE_OT_geometry_node_view_legacy";
- ot->description = "Select and view legacy geometry nodes in the node editor";
-
- ot->exec = geometry_node_view_legacy_exec;
- ot->poll = geometry_node_view_legacy_poll;
-
- ot->flag = OPTYPE_INTERNAL;
-}
-
-/** \} */
-
} // namespace blender::ed::space_node