diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-02-08 15:54:32 +0300 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-02-08 15:54:32 +0300 |
commit | 24db3d17aafd1b2027cd62afd39b2d648e8ec7d5 (patch) | |
tree | 0c27787854b73b384f0d3c46a1b8d9927a341b78 /source/blender/nodes/intern/node_util.c | |
parent | cd95dd42d7d8ee6eecde8e08cf406f6fa55f66c3 (diff) |
Per-type node labels and customizable names. The label displayed in the node header is now by default the node type string. A custom label callback can be implemented to display more detailed information. This is currently used by group nodes, which display their internal tree name, and math, vector math, mix and filter nodes, which use their internal operation sub-type. Also the node tree selection/naming box for groups is now displayed only on open groups, to make it clearer that this is the internal type of the group and get a cleaner main tree.
Diffstat (limited to 'source/blender/nodes/intern/node_util.c')
-rw-r--r-- | source/blender/nodes/intern/node_util.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c index 746b8a37f5b..baf0fc17bf7 100644 --- a/source/blender/nodes/intern/node_util.c +++ b/source/blender/nodes/intern/node_util.c @@ -30,6 +30,9 @@ #include "CMP_util.h" #include "SHD_util.h" +#include "RNA_access.h" +#include "RNA_enum_types.h" + void node_free_curves(bNode *node) { curvemapping_free(node->storage); @@ -50,3 +53,30 @@ void node_copy_standard_storage(bNode *orig_node, bNode *new_node) new_node->storage= MEM_dupallocN(orig_node->storage); } +const char *node_blend_label(bNode *node) +{ + const char *name; + RNA_enum_name(node_blend_type_items, node->custom1, &name); + return name; +} + +const char *node_math_label(bNode *node) +{ + const char *name; + RNA_enum_name(node_math_items, node->custom1, &name); + return name; +} + +const char *node_vect_math_label(bNode *node) +{ + const char *name; + RNA_enum_name(node_vec_math_items, node->custom1, &name); + return name; +} + +const char *node_filter_label(bNode *node) +{ + const char *name; + RNA_enum_name(node_filter_items, node->custom1, &name); + return name; +} |