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/blenloader/intern/versioning_300.c')
-rw-r--r--source/blender/blenloader/intern/versioning_300.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 3088dc4c7e8..5ba7dc74e3d 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -30,6 +30,7 @@
#include "DNA_lineart_types.h"
#include "DNA_listBase.h"
#include "DNA_material_types.h"
+#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
@@ -41,8 +42,10 @@
#include "BKE_animsys.h"
#include "BKE_armature.h"
#include "BKE_asset.h"
+#include "BKE_attribute.h"
#include "BKE_collection.h"
#include "BKE_curve.h"
+#include "BKE_data_transfer.h"
#include "BKE_deform.h"
#include "BKE_fcurve.h"
#include "BKE_fcurve_driver.h"
@@ -2566,6 +2569,74 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 302, 10)) {
+ /* While vertex-colors were experimental the smear tool became corrupt due
+ * to bugs in the wm_toolsystem API (auto-creation of sculpt brushes
+ * was broken). Go through and reset all smear brushes. */
+ LISTBASE_FOREACH (Brush *, br, &bmain->brushes) {
+ if (br->sculpt_tool == SCULPT_TOOL_SMEAR) {
+ br->alpha = 1.0f;
+ br->spacing = 5;
+ br->flag &= ~BRUSH_ALPHA_PRESSURE;
+ br->flag &= ~BRUSH_SPACE_ATTEN;
+ br->curve_preset = BRUSH_CURVE_SPHERE;
+ }
+ }
+
+ /* Rebuild active/render color attribute references. */
+ LISTBASE_FOREACH (Mesh *, me, &bmain->meshes) {
+ for (int step = 0; step < 2; step++) {
+ CustomDataLayer *actlayer = NULL;
+
+ int vact1, vact2;
+
+ if (step) {
+ vact1 = CustomData_get_render_layer_index(&me->vdata, CD_PROP_COLOR);
+ vact2 = CustomData_get_render_layer_index(&me->ldata, CD_MLOOPCOL);
+ }
+ else {
+ vact1 = CustomData_get_active_layer_index(&me->vdata, CD_PROP_COLOR);
+ vact2 = CustomData_get_active_layer_index(&me->ldata, CD_MLOOPCOL);
+ }
+
+ if (vact1 != -1) {
+ actlayer = me->vdata.layers + vact1;
+ }
+ else if (vact2 != -1) {
+ actlayer = me->ldata.layers + vact2;
+ }
+
+ if (actlayer) {
+ if (step) {
+ BKE_id_attributes_render_color_set(&me->id, actlayer);
+ }
+ else {
+ BKE_id_attributes_active_color_set(&me->id, actlayer);
+ }
+ }
+ }
+ }
+
+ /* Update data transfer modifiers */
+ LISTBASE_FOREACH (Object *, ob, &bmain->objects) {
+ LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) {
+ if (md->type == eModifierType_DataTransfer) {
+ DataTransferModifierData *dtmd = (DataTransferModifierData *)md;
+
+ for (int i = 0; i < DT_MULTILAYER_INDEX_MAX; i++) {
+ if (dtmd->layers_select_src[i] == 0) {
+ dtmd->layers_select_src[i] = DT_LAYERS_ALL_SRC;
+ }
+
+ if (dtmd->layers_select_dst[i] == 0) {
+ dtmd->layers_select_dst[i] = DT_LAYERS_NAME_DST;
+ }
+ }
+ }
+ }
+ }
+ }
+
/**
* Versioning code until next subversion bump goes here.
*