Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_nodetree.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | |||||
| #include "NOD_composite.h" | #include "NOD_composite.h" | ||||
| EnumPropertyItem rna_enum_node_socket_in_out_items[] = { | EnumPropertyItem rna_enum_node_socket_in_out_items[] = { | ||||
| { SOCK_IN, "IN", 0, "Input", "" }, | { SOCK_IN, "IN", 0, "Input", "" }, | ||||
| { SOCK_OUT, "OUT", 0, "Output", "" }, | { SOCK_OUT, "OUT", 0, "Output", "" }, | ||||
| { 0, NULL, 0, NULL, NULL } | { 0, NULL, 0, NULL, NULL } | ||||
| }; | }; | ||||
| EnumPropertyItem rna_enum_node_socket_shape_items[] = { | |||||
| { SOCK_SHAPE_CIRCLE, "CIRCLE", 0, "Circle", "" }, | |||||
| { SOCK_SHAPE_SQUARE, "SQUARE", 0, "Square", "" }, | |||||
| { SOCK_SHAPE_DIAMOND, "DIAMOND", 0, "Diamond", "" }, | |||||
| { 0, NULL, 0, NULL, NULL } | |||||
| }; | |||||
| #ifndef RNA_RUNTIME | #ifndef RNA_RUNTIME | ||||
| static EnumPropertyItem node_socket_type_items[] = { | static EnumPropertyItem node_socket_type_items[] = { | ||||
| {SOCK_CUSTOM, "CUSTOM", 0, "Custom", ""}, | {SOCK_CUSTOM, "CUSTOM", 0, "Custom", ""}, | ||||
| {SOCK_FLOAT, "VALUE", 0, "Value", ""}, | {SOCK_FLOAT, "VALUE", 0, "Value", ""}, | ||||
| {SOCK_INT, "INT", 0, "Int", ""}, | {SOCK_INT, "INT", 0, "Int", ""}, | ||||
| {SOCK_BOOLEAN, "BOOLEAN", 0, "Boolean", ""}, | {SOCK_BOOLEAN, "BOOLEAN", 0, "Boolean", ""}, | ||||
| {SOCK_VECTOR, "VECTOR", 0, "Vector", ""}, | {SOCK_VECTOR, "VECTOR", 0, "Vector", ""}, | ||||
| {SOCK_STRING, "STRING", 0, "String", ""}, | {SOCK_STRING, "STRING", 0, "String", ""}, | ||||
| ▲ Show 20 Lines • Show All 6,908 Lines • ▼ Show 20 Lines | static void rna_def_node_socket(BlenderRNA *brna) | ||||
| */ | */ | ||||
| prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "type"); | RNA_def_property_enum_sdna(prop, NULL, "type"); | ||||
| RNA_def_property_enum_items(prop, node_socket_type_items); | RNA_def_property_enum_items(prop, node_socket_type_items); | ||||
| RNA_def_property_enum_default(prop, SOCK_FLOAT); | RNA_def_property_enum_default(prop, SOCK_FLOAT); | ||||
| RNA_def_property_ui_text(prop, "Type", "Data type"); | RNA_def_property_ui_text(prop, "Type", "Data type"); | ||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocket_update"); | RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocket_update"); | ||||
| prop = RNA_def_property(srna, "shape", PROP_ENUM, PROP_NONE); | |||||
campbellbarton: Suggest call it `draw_shape` - to make it clear this is only for display (DNA also). | |||||
| RNA_def_property_enum_sdna(prop, NULL, "shape"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_node_socket_shape_items); | |||||
| RNA_def_property_enum_default(prop, SOCK_SHAPE_CIRCLE); | |||||
| RNA_def_property_ui_text(prop, "Shape", "Socket shape"); | |||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_NodeSocket_update"); | |||||
| /* registration */ | /* registration */ | ||||
| prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); | prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE); | ||||
| RNA_def_property_string_sdna(prop, NULL, "typeinfo->idname"); | RNA_def_property_string_sdna(prop, NULL, "typeinfo->idname"); | ||||
| RNA_def_property_flag(prop, PROP_REGISTER); | RNA_def_property_flag(prop, PROP_REGISTER); | ||||
| RNA_def_property_ui_text(prop, "ID Name", ""); | RNA_def_property_ui_text(prop, "ID Name", ""); | ||||
| /* draw socket */ | /* draw socket */ | ||||
| func = RNA_def_function(srna, "draw", NULL); | func = RNA_def_function(srna, "draw", NULL); | ||||
| ▲ Show 20 Lines • Show All 1,448 Lines • Show Last 20 Lines | |||||
Suggest call it draw_shape - to make it clear this is only for display (DNA also).