diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-05-08 19:40:58 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2013-05-08 19:40:58 +0400 |
commit | 3234f7e497d23a546a8fea1ad63886b99a17d4aa (patch) | |
tree | 295056130fea03ec191c1ae027fdd049b0daea93 /source/blender/makesrna/intern/rna_nodetree.c | |
parent | 3ebe7d970e77bb494a4454485e0ebe2b612f79c4 (diff) |
Expose the data type property of node group interfaces for easier comparison in python.
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 31c07c748e9..3a6cb60d18b 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -6304,7 +6304,7 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) */ StructRNA *srna; - PropertyRNA *parm; + PropertyRNA *parm, *prop; FunctionRNA *func; static float default_draw_color[] = { 0.0f, 0.0f, 0.0f, 1.0f }; @@ -6347,6 +6347,14 @@ static void rna_def_node_socket_standard_types(BlenderRNA *brna) srna = RNA_def_struct(brna, "NodeSocketInterfaceStandard", "NodeSocketInterface"); RNA_def_struct_sdna(srna, "bNodeSocket"); + /* for easier type comparison in python */ + prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "typeinfo->type"); + RNA_def_property_enum_items(prop, node_socket_type_items); + RNA_def_property_enum_default(prop, SOCK_FLOAT); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "Type", "Data type"); + func = RNA_def_function(srna, "draw", "rna_NodeSocketInterfaceStandard_draw"); RNA_def_function_flag(func, FUNC_USE_SELF_ID); RNA_def_function_ui_description(func, "Draw template settings"); |