Commit: f834939cebc7c608939d73c5a17a2aaea320c85e
Author: Jacques Lucke
Date: Fri Oct 15 13:39:11 2021 +0200
Branches: master
https://developer.blender.org/rBf834939cebc7c608939d73c5a17a2aaea320c85e
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.
===================================================================
M source/blender/blenkernel/intern/geometry_set.cc
===================================================================
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. */
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs