Changeset View
Changeset View
Standalone View
Standalone View
source/blender/modifiers/intern/MOD_mesh_to_volume.cc
| Show First 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | #ifdef WITH_OPENVDB | ||||
| } | } | ||||
| Mesh *mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(object_to_convert); | Mesh *mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(object_to_convert); | ||||
| if (mesh == nullptr) { | if (mesh == nullptr) { | ||||
| return input_volume; | return input_volume; | ||||
| } | } | ||||
| BKE_mesh_wrapper_ensure_mdata(mesh); | BKE_mesh_wrapper_ensure_mdata(mesh); | ||||
| const float4x4 mesh_to_own_object_space_transform = float4x4(ctx->object->imat) * | const float4x4 mesh_to_own_object_space_transform = float4x4(ctx->object->imat) * | ||||
| float4x4(object_to_convert->obmat); | float4x4(object_to_convert->object_to_world); | ||||
| geometry::MeshToVolumeResolution resolution; | geometry::MeshToVolumeResolution resolution; | ||||
| resolution.mode = (MeshToVolumeModifierResolutionMode)mvmd->resolution_mode; | resolution.mode = (MeshToVolumeModifierResolutionMode)mvmd->resolution_mode; | ||||
| if (resolution.mode == MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_AMOUNT) { | if (resolution.mode == MESH_TO_VOLUME_RESOLUTION_MODE_VOXEL_AMOUNT) { | ||||
| resolution.settings.voxel_amount = mvmd->voxel_amount; | resolution.settings.voxel_amount = mvmd->voxel_amount; | ||||
| if (resolution.settings.voxel_amount <= 0.0f) { | if (resolution.settings.voxel_amount <= 0.0f) { | ||||
| return input_volume; | return input_volume; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines | |||||