diff options
Diffstat (limited to 'source/blender/modifiers/intern')
58 files changed, 183 insertions, 124 deletions
diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index 06d7d1aac82..ee42b4a23ed 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -266,7 +266,7 @@ static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) } ModifierTypeInfo modifierType_Armature = { - /* name */ "Armature", + /* name */ N_("Armature"), /* structName */ "ArmatureModifierData", /* structSize */ sizeof(ArmatureModifierData), /* srna */ &RNA_ArmatureModifier, diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index a73faaf894b..88c43cc15d3 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -402,7 +402,7 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, start_cap_ob, ctx->object, &vgroup_start_cap_remap_len); } - start_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(start_cap_ob, false); + start_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(start_cap_ob); if (start_cap_mesh) { start_cap_nverts = start_cap_mesh->totvert; start_cap_nedges = start_cap_mesh->totedge; @@ -417,7 +417,7 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, end_cap_ob, ctx->object, &vgroup_end_cap_remap_len); } - end_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(end_cap_ob, false); + end_cap_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(end_cap_ob); if (end_cap_mesh) { end_cap_nverts = end_cap_mesh->totvert; end_cap_nedges = end_cap_mesh->totedge; @@ -1002,7 +1002,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Array = { - /* name */ "Array", + /* name */ N_("Array"), /* structName */ "ArrayModifierData", /* structSize */ sizeof(ArrayModifierData), /* srna */ &RNA_ArrayModifier, diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 6669837e8ee..f16d6c61d08 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -417,7 +417,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_Bevel = { - /* name */ "Bevel", + /* name */ N_("Bevel"), /* structName */ "BevelModifierData", /* structSize */ sizeof(BevelModifierData), /* srna */ &RNA_BevelModifier, diff --git a/source/blender/modifiers/intern/MOD_boolean.cc b/source/blender/modifiers/intern/MOD_boolean.cc index bfee108a306..6ff9cd560e7 100644 --- a/source/blender/modifiers/intern/MOD_boolean.cc +++ b/source/blender/modifiers/intern/MOD_boolean.cc @@ -14,6 +14,7 @@ #include "BLI_math_geom.h" #include "BLI_math_matrix.h" #include "BLI_vector.hh" +#include "BLI_vector_set.hh" #include "BLT_translation.h" @@ -62,7 +63,11 @@ using blender::Array; using blender::float4x4; +using blender::IndexRange; +using blender::MutableSpan; +using blender::Span; using blender::Vector; +using blender::VectorSet; static void initData(ModifierData *md) { @@ -375,19 +380,23 @@ static void BMD_mesh_intersection(BMesh *bm, #ifdef WITH_GMP -/* Get a mapping from material slot numbers in the src_ob to slot numbers in the dst_ob. - * If a material doesn't exist in the dst_ob, the mapping just goes to the same slot - * or to zero if there aren't enough slots in the destination. - * Caller owns the returned array. */ -static Array<short> get_material_remap(Object *dest_ob, Object *src_ob) +/* Get a mapping from material slot numbers in the source geometry to slot numbers in the result + * geometry. The material is added to the result geometry if it doesn't already use it. */ +static Array<short> get_material_remap(Object &object, + const Mesh &mesh, + VectorSet<Material *> &materials) { - int n = src_ob->totcol; - if (n <= 0) { - n = 1; + const int material_num = mesh.totcol; + if (material_num == 0) { + /* Necessary for faces using the default material when there are no material slots. */ + return Array<short>({materials.index_of_or_add(nullptr)}); } - Array<short> remap(n); - BKE_object_material_remap_calc(dest_ob, src_ob, remap.data()); - return remap; + Array<short> map(material_num); + for (const int i : IndexRange(material_num)) { + Material *material = BKE_object_material_get_eval(&object, i + 1); + map[i] = materials.index_of_or_add(material); + } + return map; } static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, @@ -396,6 +405,8 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, { Vector<const Mesh *> meshes; Vector<float4x4 *> obmats; + + VectorSet<Material *> materials; Vector<Array<short>> material_remaps; # ifdef DEBUG_TIME @@ -409,15 +420,23 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, meshes.append(mesh); obmats.append((float4x4 *)&ctx->object->obmat); material_remaps.append({}); + if (mesh->totcol == 0) { + /* Necessary for faces using the default material when there are no material slots. */ + materials.add(nullptr); + } + else { + materials.add_multiple({mesh->mat, mesh->totcol}); + } + if (bmd->flag & eBooleanModifierFlag_Object) { - Mesh *mesh_operand = BKE_modifier_get_evaluated_mesh_from_evaluated_object(bmd->object, false); + Mesh *mesh_operand = BKE_modifier_get_evaluated_mesh_from_evaluated_object(bmd->object); if (!mesh_operand) { return mesh; } BKE_mesh_wrapper_ensure_mdata(mesh_operand); meshes.append(mesh_operand); obmats.append((float4x4 *)&bmd->object->obmat); - material_remaps.append(get_material_remap(ctx->object, bmd->object)); + material_remaps.append(get_material_remap(*bmd->object, *mesh_operand, materials)); } else if (bmd->flag & eBooleanModifierFlag_Collection) { Collection *collection = bmd->collection; @@ -425,14 +444,14 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, if (collection) { FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, ob) { if (ob->type == OB_MESH && ob != ctx->object) { - Mesh *collection_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob, false); + Mesh *collection_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob); if (!collection_mesh) { continue; } BKE_mesh_wrapper_ensure_mdata(collection_mesh); meshes.append(collection_mesh); obmats.append((float4x4 *)&ob->obmat); - material_remaps.append(get_material_remap(ctx->object, ob)); + material_remaps.append(get_material_remap(*ob, *collection_mesh, materials)); } } FOREACH_COLLECTION_OBJECT_RECURSIVE_END; @@ -441,14 +460,19 @@ static Mesh *exact_boolean_mesh(BooleanModifierData *bmd, const bool use_self = (bmd->flag & eBooleanModifierFlag_Self) != 0; const bool hole_tolerant = (bmd->flag & eBooleanModifierFlag_HoleTolerant) != 0; - return blender::meshintersect::direct_mesh_boolean(meshes, - obmats, - *(float4x4 *)&ctx->object->obmat, - material_remaps, - use_self, - hole_tolerant, - bmd->operation, - nullptr); + Mesh *result = blender::meshintersect::direct_mesh_boolean(meshes, + obmats, + *(float4x4 *)&ctx->object->obmat, + material_remaps, + use_self, + hole_tolerant, + bmd->operation, + nullptr); + MEM_SAFE_FREE(result->mat); + result->mat = (Material **)MEM_malloc_arrayN(materials.size(), sizeof(Material *), __func__); + result->totcol = materials.size(); + MutableSpan(result->mat, result->totcol).copy_from(materials); + return result; } #endif @@ -481,8 +505,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * Object *operand_ob = bmd->object; - Mesh *mesh_operand_ob = BKE_modifier_get_evaluated_mesh_from_evaluated_object(operand_ob, - false); + Mesh *mesh_operand_ob = BKE_modifier_get_evaluated_mesh_from_evaluated_object(operand_ob); if (mesh_operand_ob) { /* XXX This is utterly non-optimal, we may go from a bmesh to a mesh back to a bmesh! @@ -516,8 +539,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, operand_ob) { if (operand_ob->type == OB_MESH && operand_ob != ctx->object) { - Mesh *mesh_operand_ob = BKE_modifier_get_evaluated_mesh_from_evaluated_object(operand_ob, - false); + Mesh *mesh_operand_ob = BKE_modifier_get_evaluated_mesh_from_evaluated_object(operand_ob); if (mesh_operand_ob == nullptr) { continue; @@ -615,7 +637,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Boolean = { - /* name */ "Boolean", + /* name */ N_("Boolean"), /* structName */ "BooleanModifierData", /* structSize */ sizeof(BooleanModifierData), /* srna */ &RNA_BooleanModifier, diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index a5214a868a8..3648a1e8984 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -13,6 +13,8 @@ #include "BLI_math_vector.h" #include "BLI_rand.h" +#include "BLT_translation.h" + #include "DNA_defaults.h" #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" @@ -311,7 +313,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Build = { - /* name */ "Build", + /* name */ N_("Build"), /* structName */ "BuildModifierData", /* structSize */ sizeof(BuildModifierData), /* srna */ &RNA_BuildModifier, diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 50d5c0d3342..cd27ec0cec5 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -559,7 +559,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Cast = { - /* name */ "Cast", + /* name */ N_("Cast"), /* structName */ "CastModifierData", /* structSize */ sizeof(CastModifierData), /* srna */ &RNA_CastModifier, diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index a386a806f98..bafd254afc6 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -275,7 +275,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Cloth = { - /* name */ "Cloth", + /* name */ N_("Cloth"), /* structName */ "ClothModifierData", /* structSize */ sizeof(ClothModifierData), /* srna */ &RNA_ClothModifier, diff --git a/source/blender/modifiers/intern/MOD_collision.c b/source/blender/modifiers/intern/MOD_collision.c index 1a28d4c2ba1..d98a1ee1c4e 100644 --- a/source/blender/modifiers/intern/MOD_collision.c +++ b/source/blender/modifiers/intern/MOD_collision.c @@ -284,7 +284,7 @@ static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) } ModifierTypeInfo modifierType_Collision = { - /* name */ "Collision", + /* name */ N_("Collision"), /* structName */ "CollisionModifierData", /* structSize */ sizeof(CollisionModifierData), /* srna */ &RNA_CollisionModifier, diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c index ac7b5aa0aa8..b6b4586c0b0 100644 --- a/source/blender/modifiers/intern/MOD_correctivesmooth.c +++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c @@ -835,7 +835,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_CorrectiveSmooth = { - /* name */ "CorrectiveSmooth", + /* name */ N_("CorrectiveSmooth"), /* structName */ "CorrectiveSmoothModifierData", /* structSize */ sizeof(CorrectiveSmoothModifierData), /* srna */ &RNA_CorrectiveSmoothModifier, diff --git a/source/blender/modifiers/intern/MOD_curve.c b/source/blender/modifiers/intern/MOD_curve.c index 62eeba8e184..2e8b7dc5ff5 100644 --- a/source/blender/modifiers/intern/MOD_curve.c +++ b/source/blender/modifiers/intern/MOD_curve.c @@ -203,7 +203,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Curve = { - /* name */ "Curve", + /* name */ N_("Curve"), /* structName */ "CurveModifierData", /* structSize */ sizeof(CurveModifierData), /* srna */ &RNA_CurveModifier, diff --git a/source/blender/modifiers/intern/MOD_datatransfer.c b/source/blender/modifiers/intern/MOD_datatransfer.c index 291d3a02786..7ad1cdb55c2 100644 --- a/source/blender/modifiers/intern/MOD_datatransfer.c +++ b/source/blender/modifiers/intern/MOD_datatransfer.c @@ -474,7 +474,7 @@ static void panelRegister(ARegionType *region_type) #undef DT_TYPES_AFFECT_MESH ModifierTypeInfo modifierType_DataTransfer = { - /* name */ "DataTransfer", + /* name */ N_("DataTransfer"), /* structName */ "DataTransferModifierData", /* structSize */ sizeof(DataTransferModifierData), /* srna */ &RNA_DataTransferModifier, diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index f461fc1e6f1..ea6e597de0a 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -271,7 +271,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Decimate = { - /* name */ "Decimate", + /* name */ N_("Decimate"), /* structName */ "DecimateModifierData", /* structSize */ sizeof(DecimateModifierData), /* srna */ &RNA_DecimateModifier, diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index e04580eb05e..dd70c5872c1 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -473,7 +473,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Displace = { - /* name */ "Displace", + /* name */ N_("Displace"), /* structName */ "DisplaceModifierData", /* structSize */ sizeof(DisplaceModifierData), /* srna */ &RNA_DisplaceModifier, diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index 0bd69964bc6..55f267db907 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -189,7 +189,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_DynamicPaint = { - /* name */ "Dynamic Paint", + /* name */ N_("Dynamic Paint"), /* structName */ "DynamicPaintModifierData", /* structSize */ sizeof(DynamicPaintModifierData), /* srna */ &RNA_DynamicPaintModifier, diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index 3d45c2652ef..f72f239dc42 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -154,7 +154,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_EdgeSplit = { - /* name */ "EdgeSplit", + /* name */ N_("EdgeSplit"), /* structName */ "EdgeSplitModifierData", /* structSize */ sizeof(EdgeSplitModifierData), /* srna */ &RNA_EdgeSplitModifier, diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index c79a9cba1ed..3803ae5eefd 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -26,6 +26,7 @@ #include "BKE_lattice.h" #include "BKE_lib_id.h" #include "BKE_mesh.h" +#include "BKE_mesh_legacy_convert.h" #include "BKE_modifier.h" #include "BKE_particle.h" #include "BKE_scene.h" @@ -1223,7 +1224,7 @@ static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) } ModifierTypeInfo modifierType_Explode = { - /* name */ "Explode", + /* name */ N_("Explode"), /* structName */ "ExplodeModifierData", /* structSize */ sizeof(ExplodeModifierData), /* srna */ &RNA_ExplodeModifier, diff --git a/source/blender/modifiers/intern/MOD_fluid.c b/source/blender/modifiers/intern/MOD_fluid.c index ee16b5ee1a6..e9e0416a124 100644 --- a/source/blender/modifiers/intern/MOD_fluid.c +++ b/source/blender/modifiers/intern/MOD_fluid.c @@ -241,7 +241,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Fluid = { - /* name */ "Fluid", + /* name */ N_("Fluid"), /* structName */ "FluidModifierData", /* structSize */ sizeof(FluidModifierData), /* srna */ &RNA_FluidModifier, diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index d24b1777e7d..ee74d5a2f10 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -545,7 +545,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_Hook = { - /* name */ "Hook", + /* name */ N_("Hook"), /* structName */ "HookModifierData", /* structSize */ sizeof(HookModifierData), /* srna */ &RNA_HookModifier, diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c index 2409590bcae..012e75e5e64 100644 --- a/source/blender/modifiers/intern/MOD_laplaciandeform.c +++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c @@ -875,7 +875,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_LaplacianDeform = { - /* name */ "LaplacianDeform", + /* name */ N_("LaplacianDeform"), /* structName */ "LaplacianDeformModifierData", /* structSize */ sizeof(LaplacianDeformModifierData), /* srna */ &RNA_LaplacianDeformModifier, diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c index d738cf449a8..eb504672e70 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c @@ -608,7 +608,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_LaplacianSmooth = { - /* name */ "LaplacianSmooth", + /* name */ N_("LaplacianSmooth"), /* structName */ "LaplacianSmoothModifierData", /* structSize */ sizeof(LaplacianSmoothModifierData), /* srna */ &RNA_LaplacianSmoothModifier, diff --git a/source/blender/modifiers/intern/MOD_lattice.c b/source/blender/modifiers/intern/MOD_lattice.c index 841ca5e4c08..a2295021eb8 100644 --- a/source/blender/modifiers/intern/MOD_lattice.c +++ b/source/blender/modifiers/intern/MOD_lattice.c @@ -160,7 +160,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Lattice = { - /* name */ "Lattice", + /* name */ N_("Lattice"), /* structName */ "LatticeModifierData", /* structSize */ sizeof(LatticeModifierData), /* srna */ &RNA_LatticeModifier, diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index 0851bf97513..c08564ee75e 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -804,7 +804,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Mask = { - /* name */ "Mask", + /* name */ N_("Mask"), /* structName */ "MaskModifierData", /* structSize */ sizeof(MaskModifierData), /* srna */ &RNA_MaskModifier, 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, diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c index ab34294a6d0..0c984f5efe5 100644 --- a/source/blender/modifiers/intern/MOD_meshcache.c +++ b/source/blender/modifiers/intern/MOD_meshcache.c @@ -416,7 +416,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_MeshCache = { - /* name */ "MeshCache", + /* name */ N_("MeshCache"), /* structName */ "MeshCacheModifierData", /* structSize */ sizeof(MeshCacheModifierData), /* srna */ &RNA_MeshCacheModifier, diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index 9309c205802..ed1de905b81 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -353,7 +353,7 @@ static void meshdeformModifier_do(ModifierData *md, * We'll support this case once granular dependency graph is landed. */ Object *ob_target = mmd->object; - cagemesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false); + cagemesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target); if (cagemesh == NULL) { BKE_modifier_set_error(ctx->object, md, "Cannot get mesh from cage object"); return; @@ -650,7 +650,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_MeshDeform = { - /* name */ "MeshDeform", + /* name */ N_("MeshDeform"), /* structName */ "MeshDeformModifierData", /* structSize */ sizeof(MeshDeformModifierData), /* srna */ &RNA_MeshDeformModifier, diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.cc b/source/blender/modifiers/intern/MOD_meshsequencecache.cc index cce59eadc15..0f739d44d45 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.cc +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.cc @@ -392,7 +392,7 @@ static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) } ModifierTypeInfo modifierType_MeshSequenceCache = { - /* name */ "MeshSequenceCache", + /* name */ N_("MeshSequenceCache"), /* structName */ "MeshSeqCacheModifierData", /* structSize */ sizeof(MeshSeqCacheModifierData), /* srna */ &RNA_MeshSequenceCacheModifier, diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index dbcdd80a836..b5fcccfcd82 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -204,7 +204,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Mirror = { - /* name */ "Mirror", + /* name */ N_("Mirror"), /* structName */ "MirrorModifierData", /* structSize */ sizeof(MirrorModifierData), /* srna */ &RNA_MirrorModifier, diff --git a/source/blender/modifiers/intern/MOD_multires.c b/source/blender/modifiers/intern/MOD_multires.c index 98407eb46db..86a28a76b63 100644 --- a/source/blender/modifiers/intern/MOD_multires.c +++ b/source/blender/modifiers/intern/MOD_multires.c @@ -487,7 +487,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Multires = { - /* name */ "Multires", + /* name */ N_("Multires"), /* structName */ "MultiresModifierData", /* structSize */ sizeof(MultiresModifierData), /* srna */ &RNA_MultiresModifier, diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 824b979ac8d..061eab5a19d 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -21,6 +21,7 @@ #include "BLI_utildefines.h" #include "DNA_collection_types.h" +#include "DNA_curves_types.h" #include "DNA_defaults.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" @@ -112,7 +113,7 @@ using blender::Span; using blender::StringRef; using blender::StringRefNull; using blender::Vector; -using blender::bke::OutputAttribute; +using blender::bke::AttributeMetaData; using blender::fn::Field; using blender::fn::GField; using blender::fn::ValueOrField; @@ -210,13 +211,17 @@ static bool node_needs_own_transform_relation(const bNode &node) return storage.transform_space == GEO_NODE_TRANSFORM_SPACE_RELATIVE; } + if (node.type == GEO_NODE_DEFORM_CURVES_ON_SURFACE) { + return true; + } + return false; } static void process_nodes_for_depsgraph(const bNodeTree &tree, Set<ID *> &ids, - bool &needs_own_transform_relation, - bool &needs_rigid_body_sim) + bool &r_needs_own_transform_relation, + bool &r_needs_rigid_body_sim) { Set<const bNodeTree *> handled_groups; @@ -228,14 +233,14 @@ static void process_nodes_for_depsgraph(const bNodeTree &tree, const bNodeTree *group = (bNodeTree *)node->id; if (group != nullptr && handled_groups.add(group)) { process_nodes_for_depsgraph( - *group, ids, needs_own_transform_relation, needs_rigid_body_sim); + *group, ids, r_needs_own_transform_relation, r_needs_rigid_body_sim); } } - needs_own_transform_relation |= node_needs_own_transform_relation(*node); + r_needs_own_transform_relation |= node_needs_own_transform_relation(*node); } /* XXX dummy */ - needs_rigid_body_sim = nodes_need_rigid_body_sim(tree); + r_needs_rigid_body_sim = nodes_need_rigid_body_sim(tree); } static void find_used_ids_from_settings(const NodesModifierSettings &settings, Set<ID *> &ids) @@ -309,6 +314,14 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte find_used_ids_from_settings(nmd->settings, used_ids); process_nodes_for_depsgraph( *nmd->node_group, used_ids, needs_own_transform_relation, needs_rigid_body_sim); + + if (ctx->object->type == OB_CURVES) { + Curves *curves_id = static_cast<Curves *>(ctx->object->data); + if (curves_id->surface != nullptr) { + used_ids.add(&curves_id->surface->id); + } + } + for (ID *id : used_ids) { switch ((ID_Type)GS(id->name)) { case ID_OB: { @@ -1049,22 +1062,27 @@ static Vector<OutputAttributeToStore> compute_attributes_to_store( continue; } const GeometryComponent &component = *geometry.get_component_for_read(component_type); + if (component.is_empty()) { + continue; + } + const blender::bke::AttributeAccessor attributes = *component.attributes(); for (const auto item : outputs_by_domain.items()) { const eAttrDomain domain = item.key; const Span<OutputAttributeInfo> outputs_info = item.value; - if (!component.attribute_domain_supported(domain)) { + if (!attributes.domain_supported(domain)) { continue; } - const int domain_num = component.attribute_domain_num(domain); + const int domain_size = attributes.domain_size(domain); blender::bke::GeometryComponentFieldContext field_context{component, domain}; - blender::fn::FieldEvaluator field_evaluator{field_context, domain_num}; + blender::fn::FieldEvaluator field_evaluator{field_context, domain_size}; for (const OutputAttributeInfo &output_info : outputs_info) { const CPPType &type = output_info.field.cpp_type(); OutputAttributeToStore store{ component_type, domain, output_info.name, - GMutableSpan{type, MEM_malloc_arrayN(domain_num, type.size(), __func__), domain_num}}; + GMutableSpan{ + type, MEM_malloc_arrayN(domain_size, type.size(), __func__), domain_size}}; field_evaluator.add_with_destination(output_info.field, store.data); attributes_to_store.append(store); } @@ -1079,33 +1097,33 @@ static void store_computed_output_attributes( { for (const OutputAttributeToStore &store : attributes_to_store) { GeometryComponent &component = geometry.get_component_for_write(store.component_type); + blender::bke::MutableAttributeAccessor attributes = *component.attributes_for_write(); + const eCustomDataType data_type = blender::bke::cpp_type_to_custom_data_type( store.data.type()); - const std::optional<AttributeMetaData> meta_data = component.attribute_get_meta_data( - store.name); + const std::optional<AttributeMetaData> meta_data = attributes.lookup_meta_data(store.name); /* Attempt to remove the attribute if it already exists but the domain and type don't match. * Removing the attribute won't succeed if it is built in and non-removable. */ if (meta_data.has_value() && (meta_data->domain != store.domain || meta_data->data_type != data_type)) { - component.attribute_try_delete(store.name); + attributes.remove(store.name); } /* Try to create the attribute reusing the stored buffer. This will only succeed if the * attribute didn't exist before, or if it existed but was removed above. */ - if (component.attribute_try_create( - store.name, - store.domain, - blender::bke::cpp_type_to_custom_data_type(store.data.type()), - AttributeInitMove(store.data.data()))) { + if (attributes.add(store.name, + store.domain, + blender::bke::cpp_type_to_custom_data_type(store.data.type()), + blender::bke::AttributeInitMove(store.data.data()))) { continue; } - OutputAttribute attribute = component.attribute_try_get_for_output_only( + blender::bke::GAttributeWriter attribute = attributes.lookup_or_add_for_write( store.name, store.domain, data_type); if (attribute) { - attribute.varray().set_all(store.data.data()); - attribute.save(); + attribute.varray.set_all(store.data.data()); + attribute.finish(); } /* We were unable to reuse the data, so it must be destructed and freed. */ @@ -1893,7 +1911,7 @@ static void requiredDataMask(Object *UNUSED(ob), } ModifierTypeInfo modifierType_Nodes = { - /* name */ "GeometryNodes", + /* name */ N_("GeometryNodes"), /* structName */ "NodesModifierData", /* structSize */ sizeof(NodesModifierData), /* srna */ &RNA_NodesModifier, diff --git a/source/blender/modifiers/intern/MOD_normal_edit.c b/source/blender/modifiers/intern/MOD_normal_edit.c index cd06c1c10a0..b8c471f1c0e 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.c +++ b/source/blender/modifiers/intern/MOD_normal_edit.c @@ -756,7 +756,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_NormalEdit = { - /* name */ "NormalEdit", + /* name */ N_("NormalEdit"), /* structName */ "NormalEditModifierData", /* structSize */ sizeof(NormalEditModifierData), /* srna */ &RNA_NormalEditModifier, diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index 1e6b27e712a..dc4cef9dc10 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -701,7 +701,7 @@ static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) } ModifierTypeInfo modifierType_Ocean = { - /* name */ "Ocean", + /* name */ N_("Ocean"), /* structName */ "OceanModifierData", /* structSize */ sizeof(OceanModifierData), /* srna */ &RNA_OceanModifier, diff --git a/source/blender/modifiers/intern/MOD_particleinstance.c b/source/blender/modifiers/intern/MOD_particleinstance.c index 120dd430301..0d1ff41f65f 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.c +++ b/source/blender/modifiers/intern/MOD_particleinstance.c @@ -644,7 +644,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_ParticleInstance = { - /* name */ "ParticleInstance", + /* name */ N_("ParticleInstance"), /* structName */ "ParticleInstanceModifierData", /* structSize */ sizeof(ParticleInstanceModifierData), /* srna */ &RNA_ParticleInstanceModifier, diff --git a/source/blender/modifiers/intern/MOD_particlesystem.cc b/source/blender/modifiers/intern/MOD_particlesystem.cc index 7259ef8448d..dacfdee81a5 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.cc +++ b/source/blender/modifiers/intern/MOD_particlesystem.cc @@ -21,6 +21,7 @@ #include "BKE_editmesh.h" #include "BKE_lib_id.h" #include "BKE_mesh.h" +#include "BKE_mesh_legacy_convert.h" #include "BKE_modifier.h" #include "BKE_particle.h" #include "BKE_screen.h" @@ -300,7 +301,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_ParticleSystem = { - /* name */ "ParticleSystem", + /* name */ N_("ParticleSystem"), /* structName */ "ParticleSystemModifierData", /* structSize */ sizeof(ParticleSystemModifierData), /* srna */ &RNA_ParticleSystemModifier, diff --git a/source/blender/modifiers/intern/MOD_remesh.c b/source/blender/modifiers/intern/MOD_remesh.c index 3221df55dd5..096920c5234 100644 --- a/source/blender/modifiers/intern/MOD_remesh.c +++ b/source/blender/modifiers/intern/MOD_remesh.c @@ -268,7 +268,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Remesh = { - /* name */ "Remesh", + /* name */ N_("Remesh"), /* structName */ "RemeshModifierData", /* structSize */ sizeof(RemeshModifierData), /* srna */ &RNA_RemeshModifier, diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index d235f9b5448..11ed312269f 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -1235,7 +1235,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Screw = { - /* name */ "Screw", + /* name */ N_("Screw"), /* structName */ "ScrewModifierData", /* structSize */ sizeof(ScrewModifierData), /* srna */ &RNA_ScrewModifier, diff --git a/source/blender/modifiers/intern/MOD_shapekey.c b/source/blender/modifiers/intern/MOD_shapekey.c index cb8aafd1eed..e30b616e921 100644 --- a/source/blender/modifiers/intern/MOD_shapekey.c +++ b/source/blender/modifiers/intern/MOD_shapekey.c @@ -9,6 +9,8 @@ #include "BLI_math.h" +#include "BLT_translation.h" + #include "DNA_key_types.h" #include "DNA_mesh_types.h" #include "DNA_object_types.h" @@ -34,7 +36,7 @@ static void deformVerts(ModifierData *UNUSED(md), if (key && key->block.first) { int deformedVerts_tot; BKE_key_evaluate_object_ex( - ctx->object, &deformedVerts_tot, (float *)vertexCos, sizeof(*vertexCos) * verts_num); + ctx->object, &deformedVerts_tot, (float *)vertexCos, sizeof(*vertexCos) * verts_num, NULL); } } @@ -108,7 +110,7 @@ static void deformMatricesEM(ModifierData *UNUSED(md), } ModifierTypeInfo modifierType_ShapeKey = { - /* name */ "ShapeKey", + /* name */ N_("ShapeKey"), /* structName */ "ShapeKeyModifierData", /* structSize */ sizeof(ShapeKeyModifierData), /* srna */ &RNA_Modifier, diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index ca01fffce56..3d3a4f5ca8a 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -260,7 +260,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Shrinkwrap = { - /* name */ "Shrinkwrap", + /* name */ N_("Shrinkwrap"), /* structName */ "ShrinkwrapModifierData", /* structSize */ sizeof(ShrinkwrapModifierData), /* srna */ &RNA_ShrinkwrapModifier, diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index cdfb6d6f179..46501d9420c 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -564,7 +564,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_SimpleDeform = { - /* name */ "SimpleDeform", + /* name */ N_("SimpleDeform"), /* structName */ "SimpleDeformModifierData", /* structSize */ sizeof(SimpleDeformModifierData), /* srna */ &RNA_SimpleDeformModifier, diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 7901f3a2fc7..7c1c5298664 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -2069,7 +2069,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Skin = { - /* name */ "Skin", + /* name */ N_("Skin"), /* structName */ "SkinModifierData", /* structSize */ sizeof(SkinModifierData), /* srna */ &RNA_SkinModifier, diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index 1e36891f55c..ef02b5ec32f 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -253,7 +253,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Smooth = { - /* name */ "Smooth", + /* name */ N_("Smooth"), /* structName */ "SmoothModifierData", /* structSize */ sizeof(SmoothModifierData), /* srna */ &RNA_SmoothModifier, diff --git a/source/blender/modifiers/intern/MOD_softbody.c b/source/blender/modifiers/intern/MOD_softbody.c index a47fa2c54d4..0db618f6f37 100644 --- a/source/blender/modifiers/intern/MOD_softbody.c +++ b/source/blender/modifiers/intern/MOD_softbody.c @@ -86,7 +86,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Softbody = { - /* name */ "Softbody", + /* name */ N_("Softbody"), /* structName */ "SoftbodyModifierData", /* structSize */ sizeof(SoftbodyModifierData), /* srna */ &RNA_SoftBodyModifier, diff --git a/source/blender/modifiers/intern/MOD_solidify.c b/source/blender/modifiers/intern/MOD_solidify.c index 129b75e370f..3fd6d5792a3 100644 --- a/source/blender/modifiers/intern/MOD_solidify.c +++ b/source/blender/modifiers/intern/MOD_solidify.c @@ -241,7 +241,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Solidify = { - /* name */ "Solidify", + /* name */ N_("Solidify"), /* structName */ "SolidifyModifierData", /* structSize */ sizeof(SolidifyModifierData), /* srna */ &RNA_SolidifyModifier, diff --git a/source/blender/modifiers/intern/MOD_subsurf.c b/source/blender/modifiers/intern/MOD_subsurf.c index e8287460196..2f70d45b7f6 100644 --- a/source/blender/modifiers/intern/MOD_subsurf.c +++ b/source/blender/modifiers/intern/MOD_subsurf.c @@ -472,7 +472,7 @@ static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) } ModifierTypeInfo modifierType_Subsurf = { - /* name */ "Subdivision", + /* name */ N_("Subdivision"), /* structName */ "SubsurfModifierData", /* structSize */ sizeof(SubsurfModifierData), /* srna */ &RNA_SubsurfModifier, diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index 0979a2f9590..a8c24dc1454 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -211,7 +211,7 @@ static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) } ModifierTypeInfo modifierType_Surface = { - /* name */ "Surface", + /* name */ N_("Surface"), /* structName */ "SurfaceModifierData", /* structSize */ sizeof(SurfaceModifierData), /* srna */ &RNA_SurfaceModifier, diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.c b/source/blender/modifiers/intern/MOD_surfacedeform.c index 45b3d9a249a..761c074f790 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.c +++ b/source/blender/modifiers/intern/MOD_surfacedeform.c @@ -1449,7 +1449,7 @@ static void surfacedeformModifier_do(ModifierData *md, } Object *ob_target = smd->target; - target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target, false); + target = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_target); if (!target) { BKE_modifier_set_error(ob, md, "No valid target mesh"); return; @@ -1521,11 +1521,11 @@ static void surfacedeformModifier_do(ModifierData *md, * added after the original ones. This covers typical case when target was at the subdivision * level 0 and then subdivision was increased (i.e. for the render purposes). */ - BKE_modifier_set_error(ob, - md, - "Target vertices changed from %u to %u, continuing anyway", - smd->target_verts_num, - target_verts_num); + BKE_modifier_set_warning(ob, + md, + "Target vertices changed from %u to %u, continuing anyway", + smd->target_verts_num, + target_verts_num); /* In theory we only need the `smd->verts_num` vertices in the `targetCos` for evaluation, but * it is not currently possible to request a subset of coordinates: the API expects that the @@ -1741,7 +1741,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_SurfaceDeform = { - /* name */ "SurfaceDeform", + /* name */ N_("SurfaceDeform"), /* structName */ "SurfaceDeformModifierData", /* structSize */ sizeof(SurfaceDeformModifierData), /* srna */ &RNA_SurfaceDeformModifier, diff --git a/source/blender/modifiers/intern/MOD_triangulate.c b/source/blender/modifiers/intern/MOD_triangulate.c index ebd44667bc0..bff05233f82 100644 --- a/source/blender/modifiers/intern/MOD_triangulate.c +++ b/source/blender/modifiers/intern/MOD_triangulate.c @@ -139,7 +139,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Triangulate = { - /* name */ "Triangulate", + /* name */ N_("Triangulate"), /* structName */ "TriangulateModifierData", /* structSize */ sizeof(TriangulateModifierData), /* srna */ &RNA_TriangulateModifier, diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c index 807ad255849..6906f8ba669 100644 --- a/source/blender/modifiers/intern/MOD_uvproject.c +++ b/source/blender/modifiers/intern/MOD_uvproject.c @@ -349,7 +349,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_UVProject = { - /* name */ "UVProject", + /* name */ N_("UVProject"), /* structName */ "UVProjectModifierData", /* structSize */ sizeof(UVProjectModifierData), /* srna */ &RNA_UVProjectModifier, diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c index e76677d9678..65f333eb034 100644 --- a/source/blender/modifiers/intern/MOD_uvwarp.c +++ b/source/blender/modifiers/intern/MOD_uvwarp.c @@ -308,7 +308,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_UVWarp = { - /* name */ "UVWarp", + /* name */ N_("UVWarp"), /* structName */ "UVWarpModifierData", /* structSize */ sizeof(UVWarpModifierData), /* srna */ &RNA_UVWarpModifier, diff --git a/source/blender/modifiers/intern/MOD_volume_displace.cc b/source/blender/modifiers/intern/MOD_volume_displace.cc index 4d0118a4517..65672622e1f 100644 --- a/source/blender/modifiers/intern/MOD_volume_displace.cc +++ b/source/blender/modifiers/intern/MOD_volume_displace.cc @@ -12,6 +12,8 @@ #include "BKE_texture.h" #include "BKE_volume.h" +#include "BLT_translation.h" + #include "DNA_mesh_types.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" @@ -307,7 +309,7 @@ static void modifyGeometrySet(ModifierData *md, } ModifierTypeInfo modifierType_VolumeDisplace = { - /* name */ "Volume Displace", + /* name */ N_("Volume Displace"), /* structName */ "VolumeDisplaceModifierData", /* structSize */ sizeof(VolumeDisplaceModifierData), /* srna */ &RNA_VolumeDisplaceModifier, diff --git a/source/blender/modifiers/intern/MOD_volume_to_mesh.cc b/source/blender/modifiers/intern/MOD_volume_to_mesh.cc index 4115a083400..edc1ac311d1 100644 --- a/source/blender/modifiers/intern/MOD_volume_to_mesh.cc +++ b/source/blender/modifiers/intern/MOD_volume_to_mesh.cc @@ -12,6 +12,8 @@ #include "BKE_volume.h" #include "BKE_volume_to_mesh.hh" +#include "BLT_translation.h" + #include "MOD_modifiertypes.h" #include "MOD_ui_common.h" @@ -193,7 +195,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * } ModifierTypeInfo modifierType_VolumeToMesh = { - /* name */ "Volume to Mesh", + /* name */ N_("Volume to Mesh"), /* structName */ "VolumeToMeshModifierData", /* structSize */ sizeof(VolumeToMeshModifierData), /* srna */ &RNA_VolumeToMeshModifier, diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index db739f315e9..040f1f28cb5 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -510,7 +510,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_Warp = { - /* name */ "Warp", + /* name */ N_("Warp"), /* structName */ "WarpModifierData", /* structSize */ sizeof(WarpModifierData), /* srna */ &RNA_WarpModifier, diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index 183d9ea1339..393554413b3 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -372,7 +372,7 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) uiItemR(sub, ptr, "use_normal_z", UI_ITEM_R_TOGGLE, "Z", ICON_NONE); col = uiLayoutColumn(layout, false); - uiItemR(col, ptr, "falloff_radius", 0, "Falloff", ICON_NONE); + uiItemR(col, ptr, "falloff_radius", 0, IFACE_("Falloff"), ICON_NONE); uiItemR(col, ptr, "height", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "width", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(col, ptr, "narrowness", UI_ITEM_R_SLIDER, NULL, ICON_NONE); @@ -394,7 +394,7 @@ static void position_panel_draw(const bContext *UNUSED(C), Panel *panel) uiItemR(layout, ptr, "start_position_object", 0, IFACE_("Object"), ICON_NONE); col = uiLayoutColumn(layout, true); - uiItemR(col, ptr, "start_position_x", 0, "Start Position X", ICON_NONE); + uiItemR(col, ptr, "start_position_x", 0, IFACE_("Start Position X"), ICON_NONE); uiItemR(col, ptr, "start_position_y", 0, "Y", ICON_NONE); } @@ -408,9 +408,9 @@ static void time_panel_draw(const bContext *UNUSED(C), Panel *panel) uiLayoutSetPropSep(layout, true); col = uiLayoutColumn(layout, false); - uiItemR(col, ptr, "time_offset", 0, "Offset", ICON_NONE); - uiItemR(col, ptr, "lifetime", 0, "Life", ICON_NONE); - uiItemR(col, ptr, "damping_time", 0, "Damping", ICON_NONE); + uiItemR(col, ptr, "time_offset", 0, IFACE_("Offset"), ICON_NONE); + uiItemR(col, ptr, "lifetime", 0, IFACE_("Life"), ICON_NONE); + uiItemR(col, ptr, "damping_time", 0, IFACE_("Damping"), ICON_NONE); uiItemR(col, ptr, "speed", UI_ITEM_R_SLIDER, NULL, ICON_NONE); } @@ -462,7 +462,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Wave = { - /* name */ "Wave", + /* name */ N_("Wave"), /* structName */ "WaveModifierData", /* structSize */ sizeof(WaveModifierData), /* srna */ &RNA_WaveModifier, diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c index 134bcc741ab..5ea1f6ae7dd 100644 --- a/source/blender/modifiers/intern/MOD_weighted_normal.c +++ b/source/blender/modifiers/intern/MOD_weighted_normal.c @@ -726,7 +726,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_WeightedNormal = { - /* name */ "WeightedNormal", + /* name */ N_("WeightedNormal"), /* structName */ "WeightedNormalModifierData", /* structSize */ sizeof(WeightedNormalModifierData), /* srna */ &RNA_WeightedNormalModifier, diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index 6e6802e0631..d4c74953efb 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -397,7 +397,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_WeightVGEdit = { - /* name */ "VertexWeightEdit", + /* name */ N_("VertexWeightEdit"), /* structName */ "WeightVGEditModifierData", /* structSize */ sizeof(WeightVGEditModifierData), /* srna */ &RNA_VertexWeightEditModifier, diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index 2e8acdaed72..095be60a63a 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -496,7 +496,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_WeightVGMix = { - /* name */ "VertexWeightMix", + /* name */ N_("VertexWeightMix"), /* structName */ "WeightVGMixModifierData", /* structSize */ sizeof(WeightVGMixModifierData), /* srna */ &RNA_VertexWeightMixModifier, diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index f2185d6902b..5314d7c9d80 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -544,7 +544,7 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * const bool use_trgt_faces = (wmd->proximity_flags & MOD_WVG_PROXIMITY_GEOM_FACES) != 0; if (use_trgt_verts || use_trgt_edges || use_trgt_faces) { - Mesh *target_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(obr, false); + Mesh *target_mesh = BKE_modifier_get_evaluated_mesh_from_evaluated_object(obr); /* We must check that we do have a valid target_mesh! */ if (target_mesh != NULL) { @@ -737,7 +737,7 @@ static void blendRead(BlendDataReader *reader, ModifierData *md) } ModifierTypeInfo modifierType_WeightVGProximity = { - /* name */ "VertexWeightProximity", + /* name */ N_("VertexWeightProximity"), /* structName */ "WeightVGProximityModifierData", /* structSize */ sizeof(WeightVGProximityModifierData), /* srna */ &RNA_VertexWeightProximityModifier, diff --git a/source/blender/modifiers/intern/MOD_weld.cc b/source/blender/modifiers/intern/MOD_weld.cc index f530a93a246..aef08735680 100644 --- a/source/blender/modifiers/intern/MOD_weld.cc +++ b/source/blender/modifiers/intern/MOD_weld.cc @@ -185,7 +185,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Weld = { - /* name */ "Weld", + /* name */ N_("Weld"), /* structName */ "WeldModifierData", /* structSize */ sizeof(WeldModifierData), /* srna */ &RNA_WeldModifier, diff --git a/source/blender/modifiers/intern/MOD_wireframe.c b/source/blender/modifiers/intern/MOD_wireframe.c index b657ea87244..5799da5d156 100644 --- a/source/blender/modifiers/intern/MOD_wireframe.c +++ b/source/blender/modifiers/intern/MOD_wireframe.c @@ -165,7 +165,7 @@ static void panelRegister(ARegionType *region_type) } ModifierTypeInfo modifierType_Wireframe = { - /* name */ "Wireframe", + /* name */ N_("Wireframe"), /* structName */ "WireframeModifierData", /* structSize */ sizeof(WireframeModifierData), /* srna */ &RNA_WireframeModifier, |