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:
Diffstat (limited to 'source/blender/modifiers/intern/MOD_mesh_to_volume.cc')
-rw-r--r--source/blender/modifiers/intern/MOD_mesh_to_volume.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
index 682fad6063e..1d63ee1f186 100644
--- a/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
+++ b/source/blender/modifiers/intern/MOD_mesh_to_volume.cc
@@ -7,6 +7,7 @@
#include <vector>
#include "BKE_geometry_set.hh"
+#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_mesh_runtime.h"
#include "BKE_mesh_wrapper.h"
@@ -14,6 +15,8 @@
#include "BKE_object.h"
#include "BKE_volume.h"
+#include "BLT_translation.h"
+
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
@@ -125,7 +128,7 @@ static Volume *mesh_to_volume(ModifierData *md,
if (object_to_convert == nullptr) {
return input_volume;
}
- Mesh *mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(object_to_convert, false);
+ Mesh *mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(object_to_convert);
if (mesh == nullptr) {
return input_volume;
}
@@ -161,7 +164,13 @@ static Volume *mesh_to_volume(ModifierData *md,
mesh_to_own_object_space_transform);
/* Create a new volume. */
- Volume *volume = BKE_volume_new_for_eval(input_volume);
+ Volume *volume;
+ if (input_volume == nullptr) {
+ volume = static_cast<Volume *>(BKE_id_new_nomain(ID_VO, "Volume"));
+ }
+ else {
+ volume = BKE_volume_new_for_eval(input_volume);
+ }
/* Convert mesh to grid and add to volume. */
geometry::volume_grid_add_from_mesh(volume,
@@ -195,7 +204,7 @@ static void modifyGeometrySet(ModifierData *md,
}
ModifierTypeInfo modifierType_MeshToVolume = {
- /* name */ "Mesh to Volume",
+ /* name */ N_("Mesh to Volume"),
/* structName */ "MeshToVolumeModifierData",
/* structSize */ sizeof(MeshToVolumeModifierData),
/* srna */ &RNA_MeshToVolumeModifier,