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 2,100 Lines • ▼ Show 20 Lines | static const EnumPropertyItem *rna_FunctionNodeRandomValue_type_itemf(bContext *UNUSED(C), | ||||
| PointerRNA *UNUSED(ptr), | PointerRNA *UNUSED(ptr), | ||||
| PropertyRNA *UNUSED(prop), | PropertyRNA *UNUSED(prop), | ||||
| bool *r_free) | bool *r_free) | ||||
| { | { | ||||
| *r_free = true; | *r_free = true; | ||||
| return itemf_function_check(rna_enum_attribute_type_items, random_value_type_supported); | return itemf_function_check(rna_enum_attribute_type_items, random_value_type_supported); | ||||
| } | } | ||||
| static bool index_offset_type_supported(const EnumPropertyItem *item) | |||||
| { | |||||
| return ELEM(item->value, | |||||
| CD_PROP_FLOAT, | |||||
| CD_PROP_FLOAT3, | |||||
| CD_PROP_INT32, | |||||
| CD_PROP_BOOL, | |||||
| CD_PROP_COLOR, | |||||
| CD_PROP_STRING); | |||||
| } | |||||
| static const EnumPropertyItem *rna_GeoNodeIndexOffset_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, index_offset_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) | ||||
| { | { | ||||
| bNode *node = ptr->data; | bNode *node = ptr->data; | ||||
| const NodeAttributeRandomize *node_storage = (NodeAttributeRandomize *)node->storage; | const NodeAttributeRandomize *node_storage = (NodeAttributeRandomize *)node->storage; | ||||
| const CustomDataType data_type = (CustomDataType)node_storage->data_type; | const CustomDataType data_type = (CustomDataType)node_storage->data_type; | ||||
| EnumPropertyItem *item_array = NULL; | EnumPropertyItem *item_array = NULL; | ||||
| ▲ Show 20 Lines • Show All 7,171 Lines • ▼ Show 20 Lines | static void def_geo_subdivision_surface(StructRNA *srna) | ||||
| prop = RNA_def_property(srna, "boundary_smooth", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "boundary_smooth", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "boundary_smooth"); | RNA_def_property_enum_sdna(prop, NULL, "boundary_smooth"); | ||||
| RNA_def_property_enum_items(prop, rna_enum_subdivision_boundary_smooth_items); | RNA_def_property_enum_items(prop, rna_enum_subdivision_boundary_smooth_items); | ||||
| RNA_def_property_enum_default(prop, SUBSURF_BOUNDARY_SMOOTH_ALL); | RNA_def_property_enum_default(prop, SUBSURF_BOUNDARY_SMOOTH_ALL); | ||||
| RNA_def_property_ui_text(prop, "Boundary Smooth", "Controls how open boundaries are smoothed"); | RNA_def_property_ui_text(prop, "Boundary Smooth", "Controls how open boundaries are smoothed"); | ||||
| 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_geo_index_offset(StructRNA *srna) | |||||
| { | |||||
| PropertyRNA *prop; | |||||
| RNA_def_struct_sdna_from(srna, "NodeIndexOffset", "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_GeoNodeIndexOffset_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_fn_random_value(StructRNA *srna) | static void def_fn_random_value(StructRNA *srna) | ||||
| { | { | ||||
| PropertyRNA *prop; | PropertyRNA *prop; | ||||
| RNA_def_struct_sdna_from(srna, "NodeRandomValue", "storage"); | RNA_def_struct_sdna_from(srna, "NodeRandomValue", "storage"); | ||||
| prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); | prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE); | ||||
| RNA_def_property_enum_sdna(prop, NULL, "data_type"); | RNA_def_property_enum_sdna(prop, NULL, "data_type"); | ||||
| ▲ Show 20 Lines • Show All 3,863 Lines • Show Last 20 Lines | |||||