Page MenuHome

Initial Mesh to Volume modifier
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Sep 28 2020, 1:32 PM.
Tags
None
Tokens
"Love" token, awarded by Xlindvain."Like" token, awarded by klutz."Burninate" token, awarded by mindinsomnia."100" token, awarded by gilberto_rodrigues."Burninate" token, awarded by spiegelball."Love" token, awarded by kioku."Like" token, awarded by Pipeliner.

Details

Summary

This new "Mesh to Volume" modifier can only be added to Volume objects. It takes a mesh as input and generates a "density" near the surface or in the enclosed volume.

Ref T73201.

Diff Detail

Repository
rB Blender
Branch
mesh-to-volume-modifier (branched from master)
Build Status
Buildable 10433
Build 10433: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Sep 28 2020, 1:32 PM
Brecht Van Lommel (brecht) requested changes to this revision.Sep 28 2020, 4:57 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/makesrna/intern/rna_modifier.c
7035–7043

This is "band width" rather than "bandwidth". I see some other apps name it like that, but I think they made a mistake and didn't notice that it's exteriorBandWidth rather than exteriorBandwidth.

Perhaps best would be to more consistent with Blender terminology and parameters for the solidify modifier, where there is "thickness" and "offset". Offset would only available when fill volume is disabled. 0 would be only interior band, 0.5 in the middle and 1.0 only exterior.

source/blender/modifiers/intern/MOD_mesh_to_volume.cc
221

This can use BKE_modifier_get_evaluated_mesh_from_evaluated_object, and then it should work for other objects types that output meshes (like curves and metaballs).

243

false -> true to clear the grid contents? And then merging should be very cheap.

Otherwise the density grid may already exist, and I think we should replace it. The transform should also be reset.

251–252

Can this be added to the transform in OpenVDBMeshAdapter, or is it required after conversion?

It's not a big deal, just would be a bit more elegant without an additional translation in the output.

254

The density should be a setting on the modifier.

This revision now requires changes to proceed.Sep 28 2020, 4:57 PM
source/blender/makesrna/intern/rna_modifier.c
7035–7043

Changing to "band width" sounds good.

I think using "thickness" and "offset" could be quite confusing when the mesh does not enclose a mesh. In that case only the exterior band width has an effect. OpenVDB does not check the normals to decide what is inside/outside.

source/blender/modifiers/intern/MOD_mesh_to_volume.cc
243

Right now I'm creating a new volume object anyway, so the density grid never exists. I can change that and replace the density grid on the incoming volume.

source/blender/makesrna/intern/rna_modifier.c
7035–7043

Ok, that seems reasonable.

source/blender/modifiers/intern/MOD_mesh_to_volume.cc
243

Ah of course, I didn't even notice that.

Creating an entire new volume and discarding other grids seems correct as is. An option to combine with another grid would be useful, but probably that is best left to nodes and a merge volume node.

  • support other object types
  • "bandwidth" to "band width"
  • expose density parameter
  • improve comment
  • move better voxel alignment matrix
This revision is now accepted and ready to land.Sep 28 2020, 6:05 PM

Should I merge this now in bcon2 or wait for the next bcon1?

Here are some small comments on the tooltips. It's just nice to have newly added tooltips align with the guidelines being developed (T76261)

source/blender/makesrna/intern/rna_modifier.c
6991

I don't think "Specify the" is necessary here, or in the description for "Voxel Size"

7020

This one is more subtle, but this might be phrased more succintly with "Smaller values result in a higher resolution output"

7025

Similarly, "The desired" is just extra words here.

  • improve tooltips
  • fix voxel size computation when object is rotated
  • correct the grid-mesh-alignment

I think this is ok during bcon2. It's a fairly isolated feature that shouldn't break anything and improves on an existing project (the volume object).

This revision was automatically updated to reflect the committed changes.