[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [56592] trunk/blender/source/blender/ makesrna/intern/rna_nodetree.c: Expose the data type property of node group interfaces for easier comparison in python .
Lukas Toenne
lukas.toenne at googlemail.com
Wed May 8 17:40:58 CEST 2013
Revision: 56592
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=56592
Author: lukastoenne
Date: 2013-05-08 15:40:58 +0000 (Wed, 08 May 2013)
Log Message:
-----------
Expose the data type property of node group interfaces for easier comparison in python.
Modified Paths:
--------------
trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
Modified: trunk/blender/source/blender/makesrna/intern/rna_nodetree.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-05-08 15:40:53 UTC (rev 56591)
+++ trunk/blender/source/blender/makesrna/intern/rna_nodetree.c 2013-05-08 15:40:58 UTC (rev 56592)
@@ -6304,7 +6304,7 @@
*/
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 @@
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");
More information about the Bf-blender-cvs
mailing list