From 793547e7d1401ad545e0450b80c7bafd521c60e1 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Thu, 21 Jan 2021 10:32:42 +0100 Subject: Geometry Nodes: initial support for volumes For the most part, this just adds boilerplate code for volume support in geometry nodes: * Add `VolumeComponent` next to `MeshComponent`, etc. * Support `VolumeComponent` in depsgraph object iterator. Furthermore, I added initial volume support in a few nodes: * The Object Info node outputs an object instance when the input is a volume object (that will be the same for mesh objects soonish, to avoid copies). * Support transforming a `VolumeComponent` in the Transform node. * Support the `VolumeComponent` in Join Geometry nodes, but only when just one of the inputs has a volume component for now. Right now, there is no way to create a `VolumeComponent`, because the Object Info node outputs an object instance. The `VolumeComponent` will be necessary for upcoming nodes, which will generate volumes on the fly. Viewport selection does not work correctly with `VolumeComponent`s currently. I don't know why that is. That can be figured out a bit later, once we can actually create new volumes in geometry nodes. Ref T84604. Differential Revision: https://developer.blender.org/D10147 --- source/blender/blenkernel/intern/volume.cc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/blenkernel/intern/volume.cc') diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc index 9e7a3736141..0c64295b55b 100644 --- a/source/blender/blenkernel/intern/volume.cc +++ b/source/blender/blenkernel/intern/volume.cc @@ -523,6 +523,8 @@ static void volume_copy_data(Main *UNUSED(bmain), volume_dst->runtime.grids = OBJECT_GUARDED_NEW(VolumeGridVector, grids_src); } #endif + + volume_dst->batch_cache = nullptr; } static void volume_free_data(ID *id) -- cgit v1.2.3