Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_attribute_randomize.cc
| Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | static void randomize_attribute_on_component(GeometryComponent &component, | ||||
| const CustomDataType data_type, | const CustomDataType data_type, | ||||
| const GeometryNodeAttributeRandomizeMode operation, | const GeometryNodeAttributeRandomizeMode operation, | ||||
| const int seed) | const int seed) | ||||
| { | { | ||||
| /* If the node is not in "replace / create" mode and the attribute | /* If the node is not in "replace / create" mode and the attribute | ||||
| * doesn't already exist, don't do the operation. */ | * doesn't already exist, don't do the operation. */ | ||||
| if (operation != GEO_NODE_ATTRIBUTE_RANDOMIZE_REPLACE_CREATE) { | if (operation != GEO_NODE_ATTRIBUTE_RANDOMIZE_REPLACE_CREATE) { | ||||
| if (!component.attribute_exists(attribute_name)) { | if (!component.attribute_exists(attribute_name)) { | ||||
| params.error_message_add(NodeWarningType::Error, | |||||
| "Attribute with name \'" + attribute_name + "\' does not exist."); | |||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| const AttributeDomain domain = get_result_domain(component, params, attribute_name); | const AttributeDomain domain = get_result_domain(component, params, attribute_name); | ||||
| OutputAttributePtr attribute = component.attribute_try_get_for_output( | OutputAttributePtr attribute = component.attribute_try_get_for_output( | ||||
| attribute_name, domain, data_type); | attribute_name, domain, data_type); | ||||
| ▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines | |||||