Page MenuHome

Geometry Nodes: Support evaluating mesh object to geometry set.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Dec 14 2020, 4:17 PM.

Details

Summary

This implements the design proposed in https://developer.blender.org/T83357#1071135.

The goal to allow the geometry nodes modifier on mesh objects to output instances and potentially other geometry types than mesh (that second one is a bit less urgent now, because we hide point clouds again).
Both problems are tackled by allowing mesh objects to evaluate to a geometry set, instead of just a single mesh id data block. The geometry set can contain a mesh but also other data like instances and a point cloud.

An important part of the technical design is to make sure that ObjectRuntime->data_eval contains the same data before and after this patch. This helps to make sure that existing code paths are impacted as little as possible.
Instead of fully replacing data_eval, there is ObjectRuntime->geometry_set_eval which contains all the geometry components an object evaluated to (including the data referenced by data_eval).

For now, not much code has to be aware of geometry_set_eval. Mainly the depsgraph object iterator and the instances system have to know about it.


I can't say that I'm sure that this patch won't introduce bugs. Mainly the temporary object creation during rendering seems a bit brittle.
However, we can be reasonably sure that this patch won't introduce regressions (at least not ones that are hard to fix). This is because the code has been written in a way that minimizes changes for existing functionality.

Given that we will hide the point cloud object for the release, we won't even have to worry about changing object types for rendering. Without a point cloud object, a mesh can only evaluate to a mesh + instances component.


Here is a quick demo. As you can see, the geometry nodes modifier is evaluated on a mesh and can output a mesh, a point cloud and instances. Edit modes are supported as well (although not fully under some circumstances when the geometry nodes modifier is used).


Diff Detail

Repository
rB Blender
Branch
temp-geometry-set-eval (branched from master)
Build Status
Buildable 11738
Build 11738: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Dec 14 2020, 4:17 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/blenkernel/intern/DerivedMesh.cc
905

For performance reasons, at some point we should move this deeper into the nodes, so that we don't always have to convert between mesh and editmesh. Maybe leave a comment about that.

This revision is now accepted and ready to land.Dec 15 2020, 12:26 PM