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
path: root/source
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2019-08-01 17:00:37 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2019-08-01 17:01:50 +0300
commit895201808c5714f82a86a059c7c533edb6c9b2fe (patch)
treec7c72ae64bbd22373846e4cb52449b18aaf3f834 /source
parent21c039f6ef3fb10c0439b096ed7e89d59e3997b3 (diff)
Fix T66040: Make Data Transfer' Mix Factor multiply with vgroup weights when given, instead of ignoring it.
Brings behavior of those options in line with the VGroup editing modifiers ones e.g.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_blender_version.h2
-rw-r--r--source/blender/blenkernel/intern/customdata.c3
-rw-r--r--source/blender/blenloader/intern/versioning_280.c16
-rw-r--r--source/blender/makesrna/intern/rna_modifier.c3
4 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 062e185eb23..ced9f4a3153 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -27,7 +27,7 @@
* \note Use #STRINGIFY() rather than defining with quotes.
*/
#define BLENDER_VERSION 281
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 1
/** Several breakages with 280, e.g. collections vs layers. */
#define BLENDER_MINVERSION 280
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 1fb29745dba..3c7ac5d8d2e 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -4756,7 +4756,8 @@ void CustomData_data_transfer(const MeshPairRemap *me_remap,
for (i = 0; i < totelem; i++, data_dst = POINTER_OFFSET(data_dst, data_step), mapit++) {
const int sources_num = mapit->sources_num;
- const float mix_factor = laymap->mix_weights ? laymap->mix_weights[i] : laymap->mix_factor;
+ const float mix_factor = laymap->mix_factor *
+ (laymap->mix_weights ? laymap->mix_weights[i] : 1.0f);
int j;
if (!sources_num) {
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index cb2b64957f0..1a79b7c9b5a 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -3533,6 +3533,22 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 281, 1)) {
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ for (ModifierData *md = ob->modifiers.first; md; md = md->next) {
+ if (md->type == eModifierType_DataTransfer) {
+ /* Now datatransfer's mix factor is multiplied with weights when any,
+ * instead of being ignored,
+ * we need to take care of that to keep 'old' files compatible. */
+ DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
+ if (dtmd->defgrp_name[0] != '\0') {
+ dtmd->mix_factor = 1.0f;
+ }
+ }
+ }
+ }
+ }
+
{
/* Versioning code until next subversion bump goes here. */
}
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index a04e0e6422f..7e1ff01a7c3 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -5668,7 +5668,8 @@ static void rna_def_modifier_datatransfer(BlenderRNA *brna)
0.0f,
1.0f,
"Mix Factor",
- "Factor to use when applying data to destination (exact behavior depends on mix mode)",
+ "Factor to use when applying data to destination (exact behavior depends on mix mode, "
+ "multiplied with weights from vertex group when defined)",
0.0f,
1.0f);
RNA_def_property_update(prop, 0, "rna_Modifier_update");