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-05-22 18:13:33 +0400
committerLukas Toenne <lukas.toenne@googlemail.com>2012-05-22 18:13:33 +0400
commit53b01d90023a850b17ded5deb9cace354c8e298a (patch)
treeab8ce43ddf8046dc54e2cacc5ff46cbc5806910b /source/blender/makesrna
parent85923aff288da072750447b44e492ebe5c59bcce (diff)
A number of new features for the node editor in general and the Frame node in particular.
For an detailed user-level description of new features see the following blogpost: http://code.blender.org/index.php/2012/05/node-editing-tweaks/ TL;DR: * Frame node gets more usable bounding-box behavior * Node resizing has helpful mouse cursor indicators and works on all borders * Node selection/active colors are themeable independently * Customizable background colors for nodes (useful for frames visual distinction).
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c28
-rw-r--r--source/blender/makesrna/intern/rna_userdef.c12
2 files changed, 39 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 3406a940967..8b7e7f7a5d9 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -205,6 +205,8 @@ static StructRNA *rna_Node_refine(struct PointerRNA *ptr)
return &RNA_NodeForLoop;
case NODE_WHILELOOP:
return &RNA_NodeWhileLoop;
+ case NODE_FRAME:
+ return &RNA_NodeFrame;
default:
return &RNA_Node;
@@ -1123,8 +1125,20 @@ static void def_whileloop(StructRNA *srna)
static void def_frame(StructRNA *srna)
{
-/* PropertyRNA *prop; */
+ PropertyRNA *prop;
+ RNA_def_struct_sdna_from(srna, "NodeFrame", "storage");
+
+ prop = RNA_def_property(srna, "shrink", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_FRAME_SHRINK);
+ RNA_def_property_ui_text(prop, "Shrink", "Shrink the frame to minimal bounding box");
+ RNA_def_property_update(prop, NC_NODE|ND_DISPLAY, NULL);
+
+ prop = RNA_def_property(srna, "label_size", PROP_INT, PROP_NONE);
+ RNA_def_property_int_sdna(prop, NULL, "label_size");
+ RNA_def_property_range(prop, 8, 64);
+ RNA_def_property_ui_text(prop, "Label Font Size", "Font size to use for displaying the label");
+ RNA_def_property_update(prop, NC_NODE|ND_DISPLAY, NULL);
}
static void def_math(StructRNA *srna)
@@ -3787,6 +3801,18 @@ static void rna_def_node(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "Node");
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_ui_text(prop, "Parent", "Parent this node is attached to");
+
+ prop = RNA_def_property(srna, "use_custom_color", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_CUSTOM_COLOR);
+ RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
+ RNA_def_property_ui_text(prop, "Custom Color", "Use custom color for the node");
+ RNA_def_property_update(prop, NC_NODE|ND_DISPLAY, NULL);
+
+ prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_ui_text(prop, "Color", "Custom color of the node body");
+ RNA_def_property_update(prop, NC_NODE|ND_DISPLAY, NULL);
prop = RNA_def_property(srna, "show_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", NODE_ACTIVE_TEXTURE);
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index e88eee5d64c..b2dbc6b4632 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -1526,6 +1526,18 @@ static void rna_def_userdef_theme_space_node(BlenderRNA *brna)
rna_def_userdef_theme_spaces_main(srna);
rna_def_userdef_theme_spaces_list_main(srna);
+ prop = RNA_def_property(srna, "node_selected", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "select");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Node Selected", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
+ prop = RNA_def_property(srna, "node_active", PROP_FLOAT, PROP_COLOR_GAMMA);
+ RNA_def_property_float_sdna(prop, NULL, "active");
+ RNA_def_property_array(prop, 3);
+ RNA_def_property_ui_text(prop, "Active Node", "");
+ RNA_def_property_update(prop, 0, "rna_userdef_update");
+
prop = RNA_def_property(srna, "wire", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "wire");
RNA_def_property_array(prop, 3);