diff options
author | Jacques Lucke <jacques@blender.org> | 2020-12-15 14:42:10 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-12-15 14:42:10 +0300 |
commit | 0d58eabee620cc534fab075764a83f5a328100c1 (patch) | |
tree | 924856455cad7fa770e88f6f5c3ab118152c8363 /source/blender/makesdna/DNA_object_types.h | |
parent | d8db5cb6003c84594f5c2f6a85a02f60bafe72c1 (diff) |
Geometry Nodes: support evaluating mesh object to geometry set
This implements the design proposed in T83357.
The goal is to allow the geometry nodes modifier on mesh objects to
output instances and potentially other geometry types. 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.
I can't say that I'm sure that this commit won't introduce bugs. Mainly
the temporary object creation during rendering seems a bit brittle.
BUT, we can be reasonably sure that this commit will not 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 intend to hide the point cloud object for the next release,
we won't even have to worry about temporary object creation for now.
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 `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.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D9851
Diffstat (limited to 'source/blender/makesdna/DNA_object_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 71f67d8a3b4..0a3a2cd0b64 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -150,14 +150,17 @@ typedef struct Object_Runtime { */ struct ID *data_orig; /** - * Object data structure created during object evaluation. - * It has all modifiers applied. + * Object data structure created during object evaluation. It has all modifiers applied. + * The type is determined by the type of the original object. For example, for mesh and curve + * objects, this is a mesh. For a volume object, this is a volume. */ struct ID *data_eval; /** - * Some objects support evaluating to a geometry set instead of a single ID. In those cases the - * evaluated geometry will be stored here instead of in #data_eval. + * Objects can evaluate to a geometry set instead of a single ID. In those cases, the evaluated + * geometry set will be stored here. An ID of the correct type is still stored in #data_eval. + * #geometry_set_eval might reference the ID pointed to by #data_eval as well, but does not own + * the data. */ struct GeometrySet *geometry_set_eval; |