Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-04-26 22:42:03 +0300
committerHans Goudey <h.goudey@me.com>2021-04-26 22:42:03 +0300
commite032ca2e25bf2e305b660da7a6026834e2e5006f (patch)
treeaca3fa8d4ab413c3e95518d7450a2af9dda21c6a /source/blender/blenkernel/intern/volume.cc
parenta7bda035163ec07901d590389a04d1730b291f13 (diff)
Cleanup: Replace modifyVolume with modifyGeometrySet
This allows us to remove a callback from the modifier type info struct. In the future the these modifiers might just be replaced by nodes internally anyway, but in the meantime it's nice to unify the handling of evaluated geometry a bit. Differential Revision: https://developer.blender.org/D11080
Diffstat (limited to 'source/blender/blenkernel/intern/volume.cc')
-rw-r--r--source/blender/blenkernel/intern/volume.cc18
1 files changed, 2 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc
index 93d5e116131..c0ce57818d1 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -1007,7 +1007,6 @@ static void volume_update_simplify_level(Volume *volume, const Depsgraph *depsgr
static void volume_evaluate_modifiers(struct Depsgraph *depsgraph,
struct Scene *scene,
Object *object,
- Volume *volume_input,
GeometrySet &geometry_set)
{
/* Modifier evaluation modes. */
@@ -1033,18 +1032,6 @@ static void volume_evaluate_modifiers(struct Depsgraph *depsgraph,
if (mti->modifyGeometrySet) {
mti->modifyGeometrySet(md, &mectx, &geometry_set);
}
- else if (mti->modifyVolume) {
- VolumeComponent &volume_component = geometry_set.get_component_for_write<VolumeComponent>();
- Volume *volume_old = volume_component.get_for_write();
- if (volume_old == nullptr) {
- volume_old = BKE_volume_new_for_eval(volume_input);
- volume_component.replace(volume_old);
- }
- Volume *volume_new = mti->modifyVolume(md, &mectx, volume_old);
- if (volume_new != volume_old) {
- volume_component.replace(volume_new);
- }
- }
}
}
@@ -1095,9 +1082,8 @@ void BKE_volume_data_update(struct Depsgraph *depsgraph, struct Scene *scene, Ob
/* Evaluate modifiers. */
Volume *volume = (Volume *)object->data;
GeometrySet geometry_set;
- VolumeComponent &volume_component = geometry_set.get_component_for_write<VolumeComponent>();
- volume_component.replace(volume, GeometryOwnershipType::ReadOnly);
- volume_evaluate_modifiers(depsgraph, scene, object, volume, geometry_set);
+ geometry_set.replace_volume(volume, GeometryOwnershipType::ReadOnly);
+ volume_evaluate_modifiers(depsgraph, scene, object, geometry_set);
Volume *volume_eval = take_volume_ownership_from_geometry_set(geometry_set);