diff options
author | Jacques Lucke <jacques@blender.org> | 2020-10-19 13:11:38 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-10-19 13:12:44 +0300 |
commit | f7832b1583cd13bde182192bce358db3062a0547 (patch) | |
tree | ffde72d963ea62b239c6a57c928534823a22808d /source/blender/makesdna/DNA_modifier_types.h | |
parent | bd15efefd2f2d3554364303a09b67198e39d7bcd (diff) |
Volumes: new Volume to Mesh modifier
This modifier is the opposite of the recently added Mesh to Volume modifier.
It converts the "surface" of a volume into a mesh. The "surface" is defined
by a threshold value. All voxels with a density higher than the threshold
are considered to be inside the volume, while all others will be outside.
By default, the resolution of the generated mesh depends on the voxel
size of the volume grid. The resolution can be customized. It should be
noted that a lower resolution might not make this modifier faster. This
is because we have to downsample the openvdb grid, which isn't a cheap
operation.
Converting a mesh to a volume and then back to a mesh is possible,
but it does require two separate mesh objects for now.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D9141
Diffstat (limited to 'source/blender/makesdna/DNA_modifier_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_modifier_types.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_modifier_types.h b/source/blender/makesdna/DNA_modifier_types.h index 7a13b9f4852..34d2c80dc5d 100644 --- a/source/blender/makesdna/DNA_modifier_types.h +++ b/source/blender/makesdna/DNA_modifier_types.h @@ -97,6 +97,7 @@ typedef enum ModifierType { eModifierType_Simulation = 57, eModifierType_MeshToVolume = 58, eModifierType_VolumeDisplace = 59, + eModifierType_VolumeToMesh = 60, NUM_MODIFIER_TYPES, } ModifierType; @@ -2275,6 +2276,39 @@ enum { MOD_VOLUME_DISPLACE_MAP_OBJECT = 2, }; +typedef struct VolumeToMeshModifierData { + ModifierData modifier; + + /** This is the volume object that is supposed to be converted to a mesh. */ + struct Object *object; + + float threshold; + float adaptivity; + + /** VolumeToMeshFlag */ + uint32_t flag; + + /** VolumeToMeshResolutionMode */ + int resolution_mode; + float voxel_size; + int voxel_amount; + + /** MAX_NAME */ + char grid_name[64]; +} VolumeToMeshModifierData; + +/** VolumeToMeshModifierData->resolution_mode */ +typedef enum VolumeToMeshResolutionMode { + VOLUME_TO_MESH_RESOLUTION_MODE_GRID = 0, + VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_AMOUNT = 1, + VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_SIZE = 2, +} VolumeToMeshResolutionMode; + +/** VolumeToMeshModifierData->flag */ +typedef enum VolumeToMeshFlag { + VOLUME_TO_MESH_USE_SMOOTH_SHADE = 1 << 0, +} VolumeToMeshFlag; + #ifdef __cplusplus } #endif |