Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-10-15 14:39:11 +0300
committerJacques Lucke <jacques@blender.org>2021-10-15 14:39:26 +0300
commitf834939cebc7c608939d73c5a17a2aaea320c85e (patch)
treeaa2eb6ae53372e1c8484f80ada35dea646ee518a /source
parentda3946b7108dc43e2783031ad8d231b65c6145ff (diff)
Geometry Nodes: fix getting mutable geometry component
The previous code did not take into account that they geometry component may not be mutable because it is shared between multiple geometry sets.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/geometry_set.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc
index 33ead37979d..e439cc838e3 100644
--- a/source/blender/blenkernel/intern/geometry_set.cc
+++ b/source/blender/blenkernel/intern/geometry_set.cc
@@ -145,8 +145,10 @@ GeometryComponent &GeometrySet::get_component_for_write(GeometryComponentType co
*/
GeometryComponent *GeometrySet::get_component_ptr(GeometryComponentType type)
{
- GeometryComponentPtr *component_ptr = components_.lookup_ptr(type);
- return component_ptr == nullptr ? nullptr : component_ptr->get();
+ if (this->has(type)) {
+ return &this->get_component_for_write(type);
+ }
+ return nullptr;
}
/* Get the component of the given type. Might return null if the component does not exist yet. */