Access the evaluated geometry of an object (bpy.types.GeometrySet).
Evaluating an object normally only exposes a single geometry data-block, but Geometry Nodes can output multiple components at once: a mesh, a point cloud, curves, grease pencil and instances. This class evaluates the object’s modifiers and gives access to all of the resulting components and their attributes, for example to test the output of a node group.
The evaluated geometry is a snapshot from when the GeometrySet was created, and doesn’t change when the object is changed afterwards. Its components, such as mesh and instances, are owned by the GeometrySet and freed with it, so keep a reference to it while using them. db.GeometrySet(obj).mesh.vertices raises a ReferenceError, as the GeometrySet is freed before the mesh is used.
Examples
import bpyimport databpy as dbgeom = db.GeometrySet(bpy.data.objects["Cube"])geom.named_attribute("position")
A mapping of component names to their data-blocks, containing only the components that are present and contain geometry. Blender can include empty components (e.g. a 0-vertex mesh) in the evaluated geometry, which are excluded here; the mesh, pointcloud, curves and instances properties still return them.
list_attributes
GeometrySet.list_attributes(drop_hidden=False)
List the attribute names on each component of the evaluated geometry.
The component to read the attribute from. If None, the components are searched in order (MESH, POINTCLOUD, CURVES, GREASE_PENCIL, INSTANCES) and the first that has the attribute is used.