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:
authorLukas Toenne <lukas.toenne@googlemail.com>2012-08-08 20:44:16 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-08-08 20:44:16 +0400
commitbd3ec606517f0ca02d503a1856963b0a2ddc32e1 (patch)
tree4251dbafb08ca1c88dd1cd5613fa2f623d251dc3 /source/blender/makesrna/intern/rna_space.c
parenta1693168f24c818e3902bd95352aa0c5fb3b7d1c (diff)
Search option for adding nodes.
The 'Add' menu in the node editor now has an option 'Search' at the top, which opens a separate popup for searching node types by name. The operator for this is implemented completely in Python (this could also be done for the regular menu-based Add options in the future). There are a few necessary extensions to the RNA as well: * The View2D struct in regions is now exposed. Currently only contains converter functions for coordinates from the region to the view (i.e. scrolled and zoomed view space). Used for converting mouse location to node space. * The SpaceNode exposes the existing 'cursor_location' for operators to store mouse position beyond invoke calls. Not used for anything else (transforms) so far. * The edit_tree in SpaceNode is also exposed, this is needed for operators to work correctly inside node groups.
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 01a58463fb6..b09227a9461 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -2961,9 +2961,14 @@ static void rna_def_space_node(BlenderRNA *brna)
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
RNA_def_property_pointer_funcs(prop, NULL, NULL, NULL, "rna_SpaceNodeEditor_node_tree_poll");
RNA_def_property_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed and edited");
+ RNA_def_property_ui_text(prop, "Node Tree", "Node tree being displayed");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, "rna_SpaceNodeEditor_node_tree_update");
+ prop = RNA_def_property(srna, "edit_tree", PROP_POINTER, PROP_NONE);
+ RNA_def_property_pointer_sdna(prop, NULL, "edittree");
+ RNA_def_property_clear_flag(prop, PROP_EDITABLE);
+ RNA_def_property_ui_text(prop, "Edit Tree", "Edited node tree");
+
prop = RNA_def_property(srna, "show_backdrop", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_BACKDRAW);
RNA_def_property_ui_text(prop, "Backdrop", "Use active Viewer Node output as backdrop for compositing nodes");
@@ -3007,6 +3012,13 @@ static void rna_def_space_node(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "flag", SNODE_USE_HIDDEN_PREVIEW);
RNA_def_property_ui_text(prop, "Hide Preview", "Hide preview for newly creating nodes");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
+
+ /* the mx/my "cursor" in the node editor is used only by operators to store the mouse position */
+ prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_NONE);
+ RNA_def_property_float_sdna(prop, NULL, "mx");
+ RNA_def_property_array(prop, 2);
+ RNA_def_property_ui_text(prop, "Cursor Location", "Location for adding new nodes");
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE_VIEW, NULL);
}
static void rna_def_space_logic(BlenderRNA *brna)