Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_point_scale.cc
| Show All 28 Lines | static bNodeSocketTemplate geo_node_point_scale_out[] = { | ||||
| {SOCK_GEOMETRY, N_("Geometry")}, | {SOCK_GEOMETRY, N_("Geometry")}, | ||||
| {-1, ""}, | {-1, ""}, | ||||
| }; | }; | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void execute_on_component(GeoNodeExecParams params, GeometryComponent &component) | static void execute_on_component(GeoNodeExecParams params, GeometryComponent &component) | ||||
| { | { | ||||
| static const float3 scale_default = float3(1.0f); | |||||
| OutputAttributePtr scale_attribute = component.attribute_try_get_for_output( | OutputAttributePtr scale_attribute = component.attribute_try_get_for_output( | ||||
| "scale", ATTR_DOMAIN_POINT, CD_PROP_FLOAT3); | "scale", ATTR_DOMAIN_POINT, CD_PROP_FLOAT3, &scale_default); | ||||
| ReadAttributePtr attribute = params.get_input_attribute( | ReadAttributePtr attribute = params.get_input_attribute( | ||||
| "Factor", component, ATTR_DOMAIN_POINT, CD_PROP_FLOAT3, nullptr); | "Factor", component, ATTR_DOMAIN_POINT, CD_PROP_FLOAT3, nullptr); | ||||
| if (!attribute) { | if (!attribute) { | ||||
| return; | return; | ||||
| } | } | ||||
| Span<float3> data = attribute->get_span<float3>(); | Span<float3> data = attribute->get_span<float3>(); | ||||
| MutableSpan<float3> scale_span = scale_attribute->get_span<float3>(); | MutableSpan<float3> scale_span = scale_attribute->get_span<float3>(); | ||||
| ▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines | |||||