diff options
author | Jacques Lucke <jacques@blender.org> | 2021-03-02 15:29:01 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-03-02 15:29:35 +0300 |
commit | f094b4fa08c970c48ff8f70952ecb3adf353539b (patch) | |
tree | 219ddcdd9cd8df01e1682b94b17b6cedb5f38dcc /source/blender/nodes | |
parent | 1e7d8a4ad512236ebc3bfbc31d8e155a574dba07 (diff) |
Fix T86172: check if attribute is actually accessible
The crash happened when the density in the Point Distribute node was
above zero but so small, that no point was generated. In this case, there
was a point cloud component, but the point cloud was empty, making some
attributes unavailable.
One could also make more attributes available in this case, but that can
be done separately if necessary.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/geometry/nodes/node_geo_point_scale.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/nodes/geometry/nodes/node_geo_point_scale.cc b/source/blender/nodes/geometry/nodes/node_geo_point_scale.cc index e28013a8bfc..9df103ff057 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_point_scale.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_point_scale.cc @@ -47,6 +47,9 @@ static void execute_on_component(GeoNodeExecParams params, GeometryComponent &co static const float3 scale_default = float3(1.0f); OutputAttributePtr scale_attribute = component.attribute_try_get_for_output( "scale", ATTR_DOMAIN_POINT, CD_PROP_FLOAT3, &scale_default); + if (!scale_attribute) { + return; + } ReadAttributePtr attribute = params.get_input_attribute( "Factor", component, ATTR_DOMAIN_POINT, CD_PROP_FLOAT3, nullptr); if (!attribute) { |