Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_nodetree.c
| Context not available. | |||||
| return itemf_function_check(rna_enum_attribute_type_items, attribute_random_type_supported); | return itemf_function_check(rna_enum_attribute_type_items, attribute_random_type_supported); | ||||
| } | } | ||||
| static bool random_value_type_supported(const EnumPropertyItem *item) | |||||
| { | |||||
| return ELEM(item->value, CD_PROP_FLOAT, CD_PROP_FLOAT3, CD_PROP_BOOL, CD_PROP_INT32); | |||||
| } | |||||
| static const EnumPropertyItem *rna_FunctionNodeRandomValue_type_itemf(bContext *UNUSED(C), | |||||
| PointerRNA *UNUSED(ptr), | |||||
| PropertyRNA *UNUSED(prop), | |||||
| bool *r_free) | |||||
| { | |||||
| *r_free = true; | |||||
| return itemf_function_check(rna_enum_attribute_type_items, random_value_type_supported); | |||||
| } | |||||
| static const EnumPropertyItem *rna_GeometryNodeAttributeRandomize_operation_itemf( | static const EnumPropertyItem *rna_GeometryNodeAttributeRandomize_operation_itemf( | ||||
| bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | bContext *UNUSED(C), PointerRNA *ptr, PropertyRNA *UNUSED(prop), bool *r_free) | ||||
| { | { | ||||
| Context not available. | |||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); | RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update"); | ||||
| } | } | ||||
| static void def_fn_random_value(StructRNA *srna) | |||||
| { | |||||
| PropertyRNA *prop; | |||||
| RNA_def_struct_sdna_from(srna, "NodeRandomValue", "storage"); | |||||
| prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); | |||||
| RNA_def_property_enum_sdna(prop, NULL, "data_type"); | |||||
| RNA_def_property_enum_items(prop, rna_enum_attribute_type_items); | |||||
| RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_FunctionNodeRandomValue_type_itemf"); | |||||
| RNA_def_property_enum_default(prop, CD_PROP_FLOAT); | |||||
| RNA_def_property_ui_text(prop, "Data Type", "Type of data stored in attribute"); | |||||
| RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update"); | |||||
| } | |||||
| static void def_geo_attribute_randomize(StructRNA *srna) | static void def_geo_attribute_randomize(StructRNA *srna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| Context not available. | |||||