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:
authorCampbell Barton <ideasman42@gmail.com>2019-07-26 14:54:57 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-07-26 14:55:53 +0300
commitba94aaedba26acc4a43b78ad7fd3552f1dbafc36 (patch)
treeffcb094131f4e42bacb2e92e4d807a9f0c4ce933 /source/blender/blenloader
parent9e9c6eac6a3b4c02938f2c3e908648df23e089c3 (diff)
Fix T67639: Default cube UVs are incorrectly arranged
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 57c674ae1b1..1cbafc7a707 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -36,6 +36,8 @@
#include "DNA_userdef_types.h"
#include "DNA_windowmanager_types.h"
#include "DNA_workspace_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_meshdata_types.h"
#include "BKE_appdir.h"
#include "BKE_brush.h"
@@ -358,6 +360,20 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene)
CURVE_PRESET_BELL,
CURVEMAP_SLOPE_POSITIVE);
}
+
+ /* Correct default startup UV's. */
+ Mesh *me = BLI_findstring(&bmain->meshes, "Cube", offsetof(ID, name) + 2);
+ if (me && (me->totloop == 24) && (me->mloopuv != NULL)) {
+ const float uv_values[24][2] = {
+ {0.625, 0.50}, {0.875, 0.50}, {0.875, 0.75}, {0.625, 0.75}, {0.375, 0.75}, {0.625, 0.75},
+ {0.625, 1.00}, {0.375, 1.00}, {0.375, 0.00}, {0.625, 0.00}, {0.625, 0.25}, {0.375, 0.25},
+ {0.125, 0.50}, {0.375, 0.50}, {0.375, 0.75}, {0.125, 0.75}, {0.375, 0.50}, {0.625, 0.50},
+ {0.625, 0.75}, {0.375, 0.75}, {0.375, 0.25}, {0.625, 0.25}, {0.625, 0.50}, {0.375, 0.50},
+ };
+ for (int i = 0; i < ARRAY_SIZE(uv_values); i++) {
+ copy_v2_v2(me->mloopuv[i].uv, uv_values[i]);
+ }
+ }
}
/**