diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_nodetree.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_nodetree.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index b9ddb6a772a..df0271d81d5 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -4954,18 +4954,32 @@ static void def_clamp(StructRNA *srna) static void def_map_range(StructRNA *srna) { + static const EnumPropertyItem rna_enum_data_type_items[] = { + {CD_PROP_FLOAT, "FLOAT", 0, "Float", "Floating-point value"}, + {CD_PROP_FLOAT3, "FLOAT_VECTOR", 0, "Vector", "3D vector with floating-point values"}, + {0, NULL, 0, NULL, NULL}, + }; + + RNA_def_struct_sdna_from(srna, "NodeMapRange", "storage"); + PropertyRNA *prop; prop = RNA_def_property(srna, "clamp", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "custom1", 1); + RNA_def_property_boolean_sdna(prop, NULL, "clamp", 1); RNA_def_property_ui_text(prop, "Clamp", "Clamp the result to the target range [To Min, To Max]"); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); prop = RNA_def_property(srna, "interpolation_type", PROP_ENUM, PROP_NONE); - RNA_def_property_enum_sdna(prop, NULL, "custom2"); + RNA_def_property_enum_sdna(prop, NULL, "interpolation_type"); RNA_def_property_enum_items(prop, rna_enum_node_map_range_items); RNA_def_property_ui_text(prop, "Interpolation Type", ""); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); + + prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_bitflag_sdna(prop, NULL, "data_type"); + RNA_def_property_enum_items(prop, rna_enum_data_type_items); + RNA_def_property_ui_text(prop, "Data Type", ""); + RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); } static void def_math(StructRNA *srna) |