Generic algorithms like join_geometries
and realize_instances
create attribute data when merging geometries where one part has an attribute and the other doesn't. Example: copying a default Grease Pencil stroke with no explicit "hardness" attribute into another curves geometry. The "hardness" gets initialized to 0 but should be 1.
https://projects.blender.org/blender/blender/issues/120297
Least intrusive solution for now: check attributes with known non-zero default values and initialize them before the join. This avoid the initialization to zero as the default attribute value. Problem: This recreates much of the recursion logic for realizing instances, defeating the purpose of a generic function and adding lots of opportunity for error.
Define attribute defaults as an optional part of the attribute declaration.
AttributeMetaData
gets a GPointer default_value
. Null for most attributes, meaning zero initialization.CustomData
. Default values don't have storage there yet.