Page MenuHome

Objects: add infrastructure for hair, pointcloud, volume modifiers
ClosedPublic

Authored by Brecht Van Lommel (brecht) on Mar 13 2020, 12:52 PM.

Details

Summary

There are no modifiers implemented and there is no user visible difference,
but this makes it possible to start implementing them for future releases.

There is no urgency to this review, as I don't plan to add any modifiers for
2.83, but it's convenient to have the whole new-object-types branch merged
into master.

Diff Detail

Repository
rB Blender

Event Timeline

Remove unintentional changes.

Brecht Van Lommel (brecht) planned changes to this revision.Mar 26 2020, 2:04 PM

Marking as planned changes. Not sure if it will change, but doesn't need to be in the review queue at the moment.

Brecht Van Lommel (brecht) requested review of this revision.Apr 21 2020, 1:20 PM

This is now needed for particle nodes, and will also be useful for further development of pointclouds, hair and volumes.

Brecht Van Lommel (brecht) edited the summary of this revision. (Show Details)

Rebase on master.

source/blender/blenkernel/intern/hair.c
260

apply_flag

source/blender/blenkernel/intern/pointcloud.c
260

Is the modifier responsible for calling CustomData_duplicate_referenced_layer, when it wants to change the positions?

Brecht Van Lommel (brecht) marked 2 inline comments as done.Apr 21 2020, 3:02 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/blenkernel/intern/pointcloud.c
260

Modifiers are expected to use either BKE_pointcloud_new_for_eval or BKE_pointcloud_copy_for_eval, which has a reference parameter.

When creating a copy referencing data layers, then indeed CustomData_duplicate_referenced_layer should be used before modifying them.

Brecht Van Lommel (brecht) marked an inline comment as done.

Rename to apply_flag

Jacques Lucke (JacquesLucke) added inline comments.
source/blender/blenkernel/intern/pointcloud.c
260

I see, so we create potentially two (shallow) copies of the point cloud for every modifier?

This revision is now accepted and ready to land.Apr 21 2020, 3:06 PM
source/blender/blenkernel/intern/pointcloud.c
260

Ah, my fault. I just overlooked pointcloud == pointcloud_input.

LGTM, think 'cleanup' changes (var renaming, comments tweaking) should be committed separately though? Would also have made the patch a bit less noisy. ;)